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 an external library.
Simple programs compile and link fine, but when I try to add SQL funcionality with 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 Project Library Path. I specified C:\MinGW\lib\libodbc32.a as the one-and-only Project Library (this made the unresolved-reference errors go away in the IDE).
I switched to the CLI and pasted the compile command. For the library name, I've tried: odbc32, odbc32.a, libodbc32, libcodbc32.a I also tried: odbccp32, odbccp32.a, libodbccp32, libodbccp32.a I've used forward slashes, backslashes, double-backslashes, quotes around the path, quotes around the entire -l parameter (which is what Eclipse does to the -L parameter).
I copied the libraries into the directory containing the compiled code to eliminate the need to specify the path. I copied them into the directory containing ld.exe. I updated the Windows path to include the directory and restarted Eclipse and the CLI.
If I remove the -l parameter entirely, I get all kinds of unresolved-reference errors. It seems ld.exe is finding the library but is bent on hiding the real problem.
What is the secret to linking to the built-in SQL libraries?