Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subj Compiling with gcc no longer finds included defines

Status
Not open for further replies.

pipemole

Programmer
May 9, 2003
19
IE
Subj Compiling with gcc no longer finds included defines

Compiling / linking c code with the gcc compiler began to have a problem. Although the process worked 48 hr. earlier, now it does not - - even on the same code file as before. The command, then the beginning of error messages, follows below.

$> gcc prog1.c -o porg1

/tmp/ccbPLX4E.o: In function ‘main’:0
/tmp/ccbPLX4E.o: (.text+0x72) undefined reference to ‘SQLAllocHandle’
/tmp/ccbPLX4E.o: (.text+0xc3) undefined reference to ‘SQLSetEnvAttr’
/tmp/ccbPLX4E.o: (.text+0x103) undefined reference to ‘SQLAllocHandle’

I then checked and found that those definitions can still be read inside /usr/include/sql.h, cited in the c code file as #include <sql.h>, prior to start of the function block for int main().. The references are function names in the API for unixODBC. Operating system is Suse 8.0 Linux.

How should this situation be resolved?

- - pipemole - - 4/15/2005;
 
included defines are found.
What's not found are the libraries for linking.

Code:
gcc prog1c -lsql -o prog1
if the name of the library is 'sql' and found in the librarypath (as libsql.so).

If the libraryname is xyOdbc or so, you have to adjust the library name of course.

seeking a job as java-programmer in Berlin:
 
re: gcc stopped being able to find references to odbc api functions

Your reply, stefanwagner, has given me something to think about.

I am still wondering, though, what could account for the change in behavior over several days. Earlier, the compile / link had finished without error, on a prior prog0.c file, having the same library function calls which you point out are what is not now being found any more.

- - pipemole - - 4/16/2004 b;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top