From: David E. <de...@us...> - 2007-12-13 02:27:29
|
Reg wrote: > This now works to create a static binary, but > how do I create a dynamic loading system? What was created in the example was a binary linked with shared libraries (DLL's) and a static TC RT library. The system linker will try to use a shared library, failing that it will try using a static library. So I'm not sure what you mean by a 'dynamic loading system'. If you want to create a shared TC RT library (DLL), just change the 'lib' make file. #all: static-libs all: static-libs shared-libs ... #install: install-rts-config install-static-libs install: install-rts-config install-static-libs install-shared-libs Then from the 'development' directory, make clean make make install (as root) If you prefer to use modules (shared library), just use the '-m' option then run it using 'htcobrun'. > When I change the -c to -x on the compile stage, > I get the problem again. > What do I need to put in on the compile line? > (htcobol ......-x or -m.....XYZ.COB) The reason you are getting those linkage error messages, is that you are using two different versions of TC to create a binary. You are using 'htcobol' from version 0.63.87 (I think), and the RTL from another TC version. The best fix would be to remove all installed TC files, then do a new TC install using the source from version 0.63.87. A quich fix is to use add the following to the xterm config ('.bashrc' or '.profile'), or what ever you are using as a terminal. export TCOB_OPTIONS_PATH=/TinyCobol/development/compiler export TCOB_RTCONFIG_PATH=/TinyCobol/development/lib export TCOB_LD_LIBRARY_PATH=/TinyCat export LD_LIBRARY_PATH=/TinyCobol/development/lib:/TinyCat To the TC compile time resource file 'htcobolrc', found in the 'development/compiler' directory, add the following. LD_PATH: -L/TinyCobol/development/lib Now do the following. Check the version of TC used, a test compile and run the binary created. You should get the following results with no linker errors. #/TinyCobol/development/compiler/htcobol -V TinyCOBOL - pre alpha 0.63.87 ... #cd /TinyCat #/TinyCobol/development/compiler/htcobol -v -x DEGRABBER.COB as -o DEGRABBER.o DEGRABBER.s gcc -o DEGRABBER DEGRABBER.o -L/TinyCobol/development/lib -lhtcobol -ldl -ldb -lncurses -lm #./DEGRABBER Now create a module and use 'htcobrun' to load it and run it. #/TinyCobol/development/compiler/htcobol -v -m DEGRABBER.COB as -o DEGRABBER.o DEGRABBER.s gcc -shared -Wl,-soname,DEGRABBER.so -o DEGRABBER.so DEGRABBER.o -L/TinyCobol/development/lib -lhtcobol #/TinyCobol/development/cobrun/htcobrun DEGRABBER Cheers. |