All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
gcc (using Makefile)

This guide shows how to compile the library and build executable programs using the library.

Install library

Uncompress the zip file, then compile & install the library using make command. (You don't need add "sudo" when installing in MinGW. Please remove "sudo" when in MinGW.)

% unzip urg_library-*.*.*.zip
% cd urg_library-*.*.* /
% make
% sudo make install 

The default installation directory on linux is /usr/local, on the subdirectories lib/, bin/ and bin/ respectively. Change the PREFIX variable on urg_library-*.*.* /Makefile if you need changing the installation location for these directories.

For example, to change installation directory to /usr/, edit urg_library-*.*.* /Makefile as follows:

PREFIX = /usr 

How to compile a program with the library

Compile command example for test.c file.

% gcc -I/usr/local/include/urg_c test.c -o test -lurg_c -lm

You can also use the urg_c-config compile script (installed with the library). The example above can be compiled as:

% gcc `urg_c-config --cflags` test.c -o test `urg_c-config --libs` -lm