Skip to Content.
Sympa Menu

freetds - Re: [freetds] Undefined references to all database functions

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Undefined references to all database functions
  • Date: Wed, 21 May 2008 15:48:24 -0400

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
> examples.
>
> 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
mangling.

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.

HTH.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page