Compiling with ODBC

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
jab121
Earned a small fee
Earned a small fee
Posts: 17
Joined: Tue Jan 25, 2005 12:05 pm

Compiling with ODBC

Post by jab121 » Sat Feb 19, 2005 4:28 pm

Im trying to compile the wxWindows sample "db". I had to recompile wxWindows to include support. Following the documentation I changed setup.h to have

wxUSE_ODBC 1

and did a "make" and "make install".
When I try to compile the sample code (db) I get the following errors:

c++ -o dbtest dbtest.o listdb.o ../../lib/libwx_gtk-2.4.so.0.1.1 -pthread -Wl,--version-script,../../version-script -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule -lgthread -lglib -lpthread -ldl -lXext -lX11 -lm -lpng -ljpeg -ltiff -lz -ldl -lm
dbtest.o(.text+0x1a48a): In function `DisplayDbDiagnostics(wxDb*)':
: undefined reference to `SQLGetConnectOption'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLTables'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLExecDirect'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLGetInfo'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLSetConnectOption'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLFreeConnect'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLGetTypeInfo'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLDataSources'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLAllocConnect'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLForeignKeys'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLTablePrivileges'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLPrepare'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLPrimaryKeys'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLSetStmtOption'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLTransact'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLAllocEnv'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLBindParameter'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLError'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLFreeStmt'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLBindCol'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLFetch'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLGetData'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLConnect'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLExtendedFetch'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLFreeEnv'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLColumns'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLGetStmtOption'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLExecute'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLDisconnect'
../../lib/libwx_gtk-2.4.so.0.1.1: undefined reference to `SQLAllocStmt'
collect2: ld returned 1 exit status
make: *** [dbtest] Error 1



Any ideas?
Thanks

mjs
Experienced Solver
Experienced Solver
Posts: 93
Joined: Wed Feb 09, 2005 3:53 am
Contact:

Post by mjs » Sat Feb 19, 2005 5:56 pm

You must use
./configure
with
--with-odbc
... otherwise -lodbc32 (or -lodbc or -liodbc) isn't specified to the link command.

Regards,
Mark

jab121
Earned a small fee
Earned a small fee
Posts: 17
Joined: Tue Jan 25, 2005 12:05 pm

Post by jab121 » Sun Feb 20, 2005 10:41 am

Thanks, it all works now.

J

Post Reply