[freetds] Undefined references to all database functions
James K. Lowden
jklowden at freetds.org
Wed May 21 15:48:24 EDT 2008
panssarikomppania at gmail.com wrote:
> The language used is C. I [use] a Windows machine and an IDE
> called Dev-C++. [...] I get a total of 71 errors, below are some
> main.c: Undefined reference to 'dbinit'.
> main.c: Undefined reference to 'dblogin'.
> main.c: Undefined reference to 'dbsetluser'.
> main.c: Undefined reference to 'dbsetlpwd'.
> main.c: Undefined reference to 'dbfcmd'.
> main.c: Undefined reference to 'dbsqlexec'.
> I think this is a linker problem.
Correctomundo, it's a linkage problem. Either the library isn't really
being linked in (or was built wrong and doesn't have those symbols), or
the symbol the application wants is somehow different from the one
exported by the library.
I had to look it up: Dev-C++ is a MinGW front-end. If one side or the
other were compiled as C++, the symbols wouldn't match because of
You want to use the GNU binutils to see what's what, and look closely at
the command line (I assume is) generated by Dev-C++. Make sure 1) it's
compiling as C, not C++, and 2) that libsybdb is really being linked in.
More information about the FreeTDS