OS: Windows 7 Enterprise x64 IDE: Eclipse Juno / CDT Compiler: MinGW 4.6.2 (C: \ MinGW)
Like user697111 , I cannot get ld.exe to find the external library.
Simple program compilation and communication is fine, but when I try to add SQL functionality to the supplied library, I get this error message in Eclipse: "c: / mingw / bin /../ lib / gcc / mingw32 / 4.6. 2 / .. /../../../mingw32/bin/ld.exe: Cannot find -lC: \ MinGW \ lib \ libodbc32.a ".
I specified C: \ MinGW \ lib as the path to the project library. I specified C: \ MinGW \ lib \ libodbc32.a as a single project library (this led to unresolved link errors disappearing in the IDE).
I switched to the CLI and inserted the compilation command. For the library name I tried: odbc32, odbc32.a, libodbc32, libcodbc32.a I also tried: odbccp32, odbccp32.a, libodbccp32, libodbccp32.a I used slashes, backslash, double backslash, quotes around the path, quotes around the entire -l option (which is what Eclipse does for the -L option).
I copied the libraries to a directory containing the compiled code to eliminate the need for a path. I copied them to the directory containing ld.exe. I updated the Windows path to include the directory and restarted Eclipse and the CLI.
If I completely remove the -l option, I get all kinds of unresolved link errors. Ld.exe seems to find the library, but tends to hide the real problem.
What is the secret of linking to built-in SQL libraries?
source share