Joined: 14 Mar 2007
Location: Ålesund, Norway
|Posted: Tue 8 May 11:53:59 2007 Post subject: Linker errors during build
|Common causes for linker error during build:
A library is included in CDP_Application\Libraries.h, but not linked.
When a library header file is included, the library must be linked by either:
If a pre-compiled library is available (the typical case for add-ons)
List the library under linker options (CDP_Application->Properties->Linker->Input->Additional dependencies).
Take care to configure the correct project configuration (for instance Release_RTOS), and remember that all used configurations must be updated separately. Typically, the library filename will be LibName_ConfigurationName.lib, for instance CDPEventManagerLib_Release_RTOS.lib when linking CDPEventManagerLib in the Release_RTOS configuration.
Also remember that the library listed here must be found in one of the directories listed under Linker->General->Additional Library Directories.
If source code is available
Add the project to the same solution and setting CDP_Application dependent of the project (CDP_Application->Project dependecies...)
Mismatching versions is used of header files and libs
The header files used must be the same as was used when the .lib was built. For example, for CDP22.214.171.124, line 15 in $(CDPBase)/CDP/CDPDefines.h should read:
#define CDP_VERSION_STRING "126.96.36.199"
and the libraries in $(CDPBase)/libs should have modified date 30.3.2006.
Check that the project setting C/C++/General/Additional Include Directories point to the desired location of header files for all projects. The default value is $(CDPBase)\CDP.
To check which libs that are used, check the Linker settings for the CDP_Application project. Linker->General->Additional Include Directories should include $(CDPBase)\libs, and Linker->Input->Additional Dependencies should include CDP_$(ConfigurationName).lib (that is, CDP_Release.lib, CDP_Release_RTOS.lib or similar).
Svein Erling Linge, ICD