Open yutaro-sakamoto opened 2 years ago
It seems difficult to solve this issue. I added note to README.
LD_PRELOAD is a quite bad hack, with that README note people will likely export
it which commonly breaks something and tells the dynamic link loader to do this for every executable. The issue is that libcob does not find the module, very likely because the actual CALL is a dynamic one and/or the dynamic linker removed the "unused" library.
To work around this each of the following solutions should work;
CALL
s as CALL STATIC 'OCESQLConnect' ...
(cobc will directly insert the library call, the dynamic linker will resolve that from libocesqlcobc -static -m ...
-Wl,--no-as-needed
(depending on the cobc used that can be passed via -Q
or by overriding cobc's linker call via environment variables)... or: use COB_PRE_LOAD
to load the library, or relink libcob/cobcrun to have the library linked with the -Wl,--no-as-needed
option.
I removed the description of LD_PRELOAD in README and created a new wiki page for Ubuntu users. I will fix this issue in the future.
A sample program INSERTTBL in sample/ directory does not work on Ubuntu.
In order to execute INSERTTBL, it is necessary to set the environment variable LD_PRELOAD to /usr/local/lib/libocesql.so
This problem is probably caused by an incorrect configuration of libocesql.so The following Dockerfile describes the full installation process on Ubuntu.