[m-users.] ODBC library

Volker Wysk post at volker-wysk.de
Sun Jan 16 04:12:58 AEDT 2022


Hi

I'm trying to build a program which uses the ODBC library. I've played
around, but couldn't get mmc to link the program. It doesn't work with the
odbc_test program in extras/odbc, even though it had worked before I
installed the Mercury ODBC library:


desktop /usr/local/src/mercury-srcdist-rotd-2022-01-13/extras/odbc $ \
mmc --make odbc_test -lodbc  --cflag "-DMODBC_UNIX" --cflag "-DMODBC_MYSQL"
Making odbc_test
** Error making `odbc_test'.
/usr/bin/ld: Mercury/os/odbc.o: in function `odbc_do_cleanup_statement':
odbc.c:(.text+0x3317): undefined reference to `SQLFreeStmt'
/usr/bin/ld: Mercury/os/odbc.o: in function `odbc_check.part.0':
odbc.c:(.text+0x3808): undefined reference to `SQLError'
/usr/bin/ld: Mercury/os/odbc.o: in function `odbc_transaction_c_code':
odbc.c:(.text+0x3983): undefined reference to `SQLTransact'
/usr/bin/ld: odbc.c:(.text+0x3a13): undefined reference to `SQLTransact'
/usr/bin/ld: odbc.c:(.text+0x3a5e): undefined reference to `SQLTransact'
/usr/bin/ld: Mercury/os/odbc.o: in function `odbc_get_data_in_one_go':
odbc.c:(.text+0x3bd1): undefined reference to `SQLGetData'
/usr/bin/ld: Mercury/os/odbc.o: in function `odbc_get_data_in_chunks':
odbc.c:(.text+0x3ca0): undefined reference to `SQLGetData'
/usr/bin/ld: Mercury/os/odbc.o: in function `odbc_do_get_data':
odbc.c:(.text+0x3e0a): undefined reference to `SQLGetData'
/usr/bin/ld: Mercury/os/odbc.o: in function `odbc_do_get_data_sources':
... error log truncated, see `odbc_test.err' for the complete log.


"mmake depend ; mmake" doesn't work either. The error messages seem to
indicate the same problem.

It looks like the UnixODBC library is missing, not getting linked... Might
it be a name clash, since the UnixODBC library has the same name
"libodbc.so" as the Mercury ODBC library which is installed in
/usr/local/lib/mercury/lib/... ?


Regards, Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mercurylang.org/archives/users/attachments/20220115/52ec35e6/attachment.sig>


More information about the users mailing list