| |||||
Technical Support Support Resources
Product Information | BL51: NOT FINDING SOME FUNCTIONS IN LIBRARIESInformation in this article applies to:
SYMPTOMSThe linker is not finding some functions in my libraries. In main.c, I have a call to foo(). foo() calls bar(). foo() is in library foo.lib. bar() is in library bar.lib. I run the linker from the command line: BL51 main.obj, bar.lib, foo.lib I get these messages:
*** WARNING 1: UNRESOLVED EXTERNAL SYMBOL
SYMBOL: BAR
MODULE: FOO.LIB (FOO)
*** WARNING 2: REFERENCE MADE TO UNRESOLVED EXTERNAL
SYMBOL: BAR
MODULE: FOO.LIB (FOO)
ADDRESS: 0014H
CAUSEThe linker processes files in the order you specify them. From library files, it takes only those modules required to satisfy unresolved external references it has already encountered. In this example, when the linker reads bar.lib there have been no references to bar(), so the linker does not link bar() into the program. When it reads foo.lib, it is able to resolve the reference to foo(). Since foo() calls bar(), this creates a reference to bar(). The linker does not backtrack to reprocess library files it has already read, so this reference to bar() is never resolved. RESOLUTIONThere are two ways to solve this problem:
SEE ALSO
FORUM THREADSThe following Discussion Forum threads may provide information related to this topic. Last Reviewed: Saturday, July 09, 2005 | ||||
| |||||