Link Error when Building DBTools Application

Article ID: 790
Last updated: 05 Feb, 2008
Article ID: 790
Last updated: 05 Feb, 2008
Revision: 1
Views: 2677
Posted: 26 Jun, 1997
by Dean J.
Updated: 05 Feb, 2008
by Dean J.
Problem


While trying to build an application, I get the following link error: unresolved external "newSybDbLibDatabaseImpl..." or "newOraDbDatabaseImpl..."


Cause


You are probably linking your static application to the dynamic version of the librwdblib (librwora) library. This usually happens when you have both the static and shared library versions of the access library in the same directory. Since on the link line there is no explicit specification of which library to use, the linker defaults to the shared library. librwdblib.so will then be linked to the static application instead of librwdblib.a.


Action


  • Keep the static and the shared libraries in different directories.

OR

  • When building a static application, force the linker to link to static libraries by adding the option -Bstatic (Sunpro compilers) or -Wl,-a,archive (HPUX) followed by the library name. However, you'll still need to link to dynamic versions of your system (not database) libraries. On Solaris, you can do this by specifying -Bdynamic on the compiler command line, after all of the database libraries are listed but before the system libraries. On HPUX, you should specify -Wl,-a,shared on the command line, after all of the database libraries are listed but before the system libraries.
This article was:   Helpful | Not helpful
Report an issue
Article ID: 790
Last updated: 05 Feb, 2008
Revision: 1
Views: 2677
Posted: 26 Jun, 1997 by Dean J.
Updated: 05 Feb, 2008 by Dean J.

Others in this category