You very likely want to (what is found when using the search function of this discussion board as well) either add -static to your cobc command or (then the linker will see the OCESQL symbols being requested and not optimize the "unnecessary " library away) or leave as is (but getting rid of the ocesql link) and instead use COB_PRE_LOAD to dynamically call the ocesql library (which is my personal preference).
... in any case I'm now quite sure that cygwin is not the environment you want but MSYS2 would be...
Or just using the binaries provided by OCAMLPro (which would include GixSQL instead of ocesql).
$> nm /cygdrive/c/Program\ Files/PostgreSQL/17/lib/libocesql.a | grep OCESQLConnect
0000000000003640 T OCESQLConnect
00000000000039a0 T OCESQLConnectInformal
00000000000037c0 T OCESQLConnectShort
$> pwd
/home/stealth_droid/Open-COBOL-ESQL-develop/sample
$> cobc -x -v -o INSERTBL INSERTTBL.cob "-I/cygdrive/c/Program Files/PostgreSQL/17/include" "-L/cygdrive/c/Program Files/PostgreSQL/17/lib" "/cygdrive/c/Program Files/PostgreSQL/17/lib/libpq.a" "/usr/local/lib/libocesql.a" -locesql
cobc (GnuCOBOL) 3.2.0
Built Oct 09 2024 07:56:37 Packaged Jul 28 2023 17:02:56 UTC
C version "13.3.1 20241004"
loading standard configuration file 'default.conf'
command line: cobc -x -v -o INSERTBL -I/cygdrive/c/Program Files/PostgreSQL/17/include -L/cygdrive/c/Program Files/PostgreSQL/17/lib -locesql INSERTTBL.cob /cygdrive/c/Program Files/PostgreSQL/17/lib/libpq.a /usr/local/lib/libocesql.a
preprocessing: INSERTTBL.cob -> /tmp/cob545_0.cob
return status: 0
parsing: /tmp/cob545_0.cob (INSERTTBL.cob)
return status: 0
translating: /tmp/cob545_0.cob -> /tmp/cob545_0.c (INSERTTBL.cob)
executing: gcc -c -pipe -I/usr/local/include -Wno-unused -fsigned-char
-Wno-pointer-sign -I"/cygdrive/c/Program
Files/PostgreSQL/17/include" -o "/tmp/cob545_0.o"
"/tmp/cob545_0.c"
return status: 0
executing: gcc -Wl,--export-all-symbols -Wl,--enable-auto-import
-Wl,--enable-auto-image-base -o "INSERTBL.exe"
"/tmp/cob545_0.o" "/cygdrive/c/Program
Files/PostgreSQL/17/lib/libpq.a" "/usr/local/lib/libocesql.a"
-L"/cygdrive/c/Program Files/PostgreSQL/17/lib"
-L/usr/local/lib -lcob -l"ocesql"
return status: 0
$> ./INSERTTBL.exe
*** INSERTTBL STARTED ***
libcob: error: module 'OCESQLConnect' not found
$>
Please advise what I did wrong I keep trying.
thanks,
jim
Sent with Proton Mail secure email.
You very likely want to (what is found when using the search function of this discussion board as well) either add -static to your cobc command or (then the linker will see the OCESQL symbols being requested and not optimize the "unnecessary " library away) or leave as is (but getting rid of the ocesql link) and instead use COB_PRE_LOAD to dynamically call the ocesql library (which is my personal preference).
... in any case I'm now quite sure that cygwin is not the environment you want but MSYS2 would be...
Or just using the binaries provided by OCAMLPro (which would include GixSQL instead of ocesql).