gclib ships with a compiled version of the open source portion, gclibo. However, if a source modification is desired, the following instructions will help with recompiling this portion of the library.
For brevity, these instructions assume the default installation location of C:\Program Files (x86)\Galil\gclib and a build type of x86 (win32). The following instructions were performed on Visual Studio Professional 2013 and can be extended to other Visual Studio versions.
Open VS2013 x86 Native Tools Command Prompt.
Navigate to a convenient, empty, writable location, e.g. C:\temp.
C:\temp>set base=C:\Program Files (x86)\Galil\gclib
C:\temp>copy "%base%\source\gclibo\*.c" .
Make any necessary changes. For this example, the GInfo() function was changed from
to
C:\temp>cl -c *.c -I "%base%\include" -DBUILDING_GCLIB
C:\temp>link /DLL *.obj "%base%\lib\dynamic\x86\gclib.lib" /OUT:gclibo.dll
Copy back to the installation location from the file explorer.
C:\temp>copy "%base%\examples\cpp\x_simple.c" .
C:\temp>cl x_simple.c "%base%\lib\dynamic\x86\*.lib" -I "%base%\include"
C:\temp>set PATH=%base%\dll\x86\;%PATH%
C:\temp>x_simple.exe rc: 0 version: 85.60.138 rc: 0 rc: 0 info: My controller rc: 0 response: 355000958.0000 :
$ mkdir test $ cd test $ tar -xvf /usr/share/doc/gclib/src/gclibo_164_src.tar.gz gclibo.h gclibo.c arrays.c makefile_gclibo $ cp /usr/include/gclib*.h . $ ls arrays.c gclib.h gclibo.h makefile_gclibo gclib_errors.h gclibo.c gclib_record.h
Make any necessary changes. For this example, the GInfo() function was changed from
to
$ make -f makefile_gclibo Open source component, libgclibo.so.0.0 Compiling open source component. gcc -c -Wall -Werror -fPIC -fvisibility=hidden -DBUILDING_GCLIB -DHAVE_VISIBILITY *.c Linking open source component into shared library. gcc -shared -o libgclibo.so.0.0 *.o -Wl,-soname=libgclibo.so.0 strip --strip-unneeded libgclibo.so.0.0 Cleaning up. $ sudo make install -f makefile_gclibo Installing libgclibo.so.0.0 install -m 755 libgclibo.so.0.0 /usr/lib ldconfig $ make clean -f makefile_gclibo Cleaning project...
$ tar -xzf /usr/share/doc/gclib/src/gclib_165_examples.tar.gz x_simple.c
$ gcc x_simple.c -Wall -Werror -lgclib -lgclibo -o simple
$ ./simple rc: 0 version: 85.60.131 rc: 0 rc: 0 info: My controller rc: 0 response: 182879322.0000 :
$ mkdir test $ cd test $ tar -xvf /Applications/gclib/source/gclibo_253_src.tar.gz x gclibo.h x gclibo.c x arrays.c x makefile_gclibo $ cp /Applications/gclib/include/* . $ cp /Applications/gclib/dylib/gclib.0.dylib . $ ls arrays.c gclib.h gclib_record.h gclibo.h gclib.0.dylib gclib_errors.h gclibo.c makefile_gclibo
Make any necessary changes. For this example, the GInfo() function was changed from
to
$ make -f makefile_gclibo Open source component, gclibo.0.dylib Compiling open source component. gcc -c -Wall -Werror -fPIC -fvisibility=hidden -DBUILDING_GCLIB -DHAVE_VISIBILITY *.c Linking open source component into shared library. gcc -dynamiclib -o gclibo.0.dylib *.o gclib.0.dylib strip -u -r gclibo.0.dylib Cleaning up. $ make install -f makefile_gclibo Installing gclibo.0.dylib cp gclibo.0.dylib /Applications/gclib/dylib $ make clean -f makefile_gclibo Cleaning project...
$ tar -xzf /Applications/gclib/examples/gclib_253_examples.tar.gz x_simple.c
$ gcc x_simple.c -Wall -Werror gclib.0.dylib gclibo.0.dylib -o simple
$ ./simple rc: 0 version: 127.110.253 rc: 0 rc: 0 info: My controller rc: 0 response: 182879322.0000 :