ROX-CLib: A library for ROX applications written in C.

- Main Page
- Data Structures
- Files
- Related Pages

# A library for ROX applications written in C.

### 2.1.8

## For users

### Installation

Copy to a suitable place such as `~/lib` or make sure it is on your `$LIBDIRPATH`. If you use Archive to extract it from the downloaded archive then make sure you rename it to `ROX-CLib`.

Compile using `ROX-CLib/AppRun --compile` or running ROX-CLib from the filer.

You will need

- GTK+ 2.x
- libxml 2.4.x
- GNU `make`.

Linux users should already have GNU make installed `/usr/bin`. Other OS's may require you use a different directory (`/usr/bin/local`) or program name (`gmake`). Set the environment variable MAKE to the correct value before compiling, e.g.

    $ MAKE=gmake ROX-CLib/AppRun --compile

## For Programmers

### Compiling and linking against the library

Compile the library first as above.

Copy the libdir script from `ROX-CLib/$PLATFORM/bin/libdir` into your app dir.

Add the output of

       ROX-CLib --cflags

to your compile line, e.g.

       ROX_CLIB="`$APP_DIR/libdir ROX-CLib`/AppRun"

       gcc `$ROX_CLIB --cflags` -c main.c

You should include the main file:

       # include <rox/rox.h>

and any of the others you need.

Add the output of

       ROX-CLib --cflags
       ROX-CLib --libs

to your link line, e.g.

       ROX_CLIB="`$APP_DIR/libdir ROX-CLib`/AppRun"

       gcc `$ROX_CLIB --cflags` -o main main.o `$ROX_CLIB --libs`

If you are using other libraries in conjunction with pkg-config you can use the alternative:

    $ROX_CLIB --pkg-config --cflags ROX-CLib other-pkg

If you are using autoconf and building a ROX program then:

- In src/configure.in add:

      ROX_CLIB(2, 0, 0)

- Copy ROX-CLib/Help/rox-clib.m4 to your programs src directory then execute

      aclocal -I .

- In src/Makefile.in add:

        ROX_CLIB = @ROX_CLIB_PATH@/AppRun

  and to CFLAGS add: ``${ROX_CLIB} --cflags`` and to LDFLAGS add: ``${ROX_CLIB} --libs``
- In AppRun (and AppletRun if it is an applet) ensure you have:

         APP_DIR=`dirname $0`
         APP_DIR=`cd $APP_DIR;pwd`; export APP_DIR
         ROX_CLIB=`$APP_DIR/libdir ROX-CLib` export ROX_CLIB
         if [ -z "$LD_LIBRARY_PATH" ]; then
             LD_LIBRARY_PATH=`"$ROX_CLIB/AppRun" --runtime`
         else
             LD_LIBRARY_PATH=`"$ROX_CLIB/AppRun" --runtime`:$LD_LIBRARY_PATH
         fi
         export LD_LIBRARY_PATH