Re: Undefined references to all database functions

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
[email protected] 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.