Unresolved externals using db2api

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
atrichtch
Forum Newbie
Posts: 18
Joined: Sun Apr 03, 2011 4:57 pm

Unresolved externals using db2api

Post by atrichtch »

Hi,

I'm trying to make a small DLL to make simple administrative manipulations on DB2 (create/drop database, display active databases etc.). I did include sqlenv.h, and did specify the SQLLIB/lib and db2api.lib in the linking. Still, this is what I get:

Code: Select all

$ gcc -Wall -L"/home/alex/sqllib/lib" "/home/alex/sqllib/lib/db2api.lib" -share
d  dboperations.o -o dbops.dll
dboperations.o:dboperations.cpp:(.text+0x53): undefined reference to `sqlecrea_a
pi@32'
dboperations.o:dboperations.cpp:(.text+0xac): undefined reference to `sqledosd_a
pi@16'
dboperations.o:dboperations.cpp:(.text+0xfd): undefined reference to `sqlengne_a
pi@12'
collect2: ld returned 1 exit status
Is anybody familiar with DB2?
Thanks.
atrichtch
Forum Newbie
Posts: 18
Joined: Sun Apr 03, 2011 4:57 pm

Re: Unresolved externals using db2api

Post by atrichtch »

OK, DB2 libraries can only be linked in Visual Studio. Also, it's necessary to specify "Link library dependencies" in the linker option; otherwise you'll keep wondering what's wrong.
Post Reply