Re: db samples just wont compile

165 views
Skip to first unread message

Bryan Bulten

unread,
Nov 11, 2003, 3:05:56 AM11/11/03
to wx-u...@lists.wxwindows.org

> I'm out of my wits.
> I've installed iODBC and ensure that the useODBC is turned on. and
> re-compile my wxWindows. But still, when I come to compiling my db
> example on Linux the built still fail. Would someone be kind enough to
>
> point me what am I missing?

You need to link with libiodbc. Add '-liodbc' (I think that's what it
was) to your linker flags.


Cheers.

--
Bryan Bulten
http://www.bulten.ca/
http://wxnet.sourceforge.net/

nkb

unread,
Nov 11, 2003, 3:00:16 AM11/11/03
to wx-u...@lists.wxwindows.org
Hi.

I'm out of my wits.
I've installed iODBC and ensure that the useODBC is turned on. and
re-compile my wxWindows. But still, when I come to compiling my db
example on Linux the built still fail. Would someone be kind enough to
point me what am I missing?

Thanks!!

===
c++ -c -I../../lib/wx/include/gtk-2.4 -I../../include -I../../src/zlib
-I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include
-D_REENTRANT -I/usr/X11R6/include -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES
-D__WXGTK__ -DGTK_NO_CHECK_CASTS -O2 -MMD -pthread -Wall -o
listdb.o listdb.cpp
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 -lXi -lXext -lX11 -lm -lpng -ljpeg -ltiff -ldl -lm
dbtest.o: In function `DisplayDbDiagnostics(wxDb *)':
dbtest.o(.text+0x19772): 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'

Bryan Bulten

unread,
Nov 11, 2003, 3:46:46 AM11/11/03
to wx-u...@lists.wxwindows.org

> dbtest: error while loading shared libraries: libiodbc.so.2: cannot
> open shared object file: No such file or directory
>
> The library is there under /usr/local/lib and I've my path envrionment
>
> set to include this path as well. What am I missing again?

The path environment is not what you need to set for this.

- Ensure that /usr/local/lib is entered in your /etc/ld.so.conf.
- Run ldconfig after adding it.
- Run ldconfig -v, and enure that libiodbc.so.2 is listed in the
output.

Alternatively, if you cannot modify /etc/ld.so.conf, set LD_LIBRARY_PATH
to /usr/local/lib.

nkb

unread,
Nov 11, 2003, 3:40:10 AM11/11/03
to wx-u...@lists.wxwindows.org
Thanks. It works. But I got this error:

dbtest: error while loading shared libraries: libiodbc.so.2: cannot open
shared object file: No such file or directory

The library is there under /usr/local/lib and I've my path envrionment
set to include this path as well. What am I missing again?

Thanks.

Okami no Kaze

unread,
Nov 11, 2003, 4:07:47 AM11/11/03
to wx-u...@lists.wxwindows.org
Did you try using configure with the option '--with-odbc'? That looks
like what you're missing.

~Michael

nkb wrote:

> ---------------------------------------------------------------------
> Please read http://www.wxwindows.org/mlhowto.htm before posting.
>
> To unsubscribe, e-mail: wx-users-u...@lists.wxwindows.org
> For additional commands, e-mail: wx-use...@lists.wxwindows.org
>


Reply all
Reply to author
Forward
0 new messages