Linker Error "cannot find -l<lib_name>"
Sometimes when you build a project, you may encounter a link error of the form "cannot find -l<lib_name>". Typical examples of the actual error message seen are:
TI/Luminary Stellaris family MCUs :
cannot find -ldriver
NXP LPC1xxx family MCUs :
cannot find -lCMSISv1p30_LPC11xx cannot find -lLPC11xx_Lib cannot find -lCMSISv1p30_LPC13xx cannot find -lLPC13xx_Lib cannot find -lCMSISv1p30_LPC17xx
This error is telling you that the linker has been unable to find a specific library archive that is required in order to build your project.
Often this library is contained in a library project that should be in the same workspace as the project that you are trying to build. Typically the reason why such a library cannot be found the linker is one of the following:
Library project does not exist
The required library project has not been imported into the current workspace (though often this will cause compile step errors that requested header files cannot be found). In this case import the appropriate library project - typically from within the examples subdirectory of your Code Red IDE installation, or from our the examples section of our website.
Library not built / No project reference to library project
If your application project does not have a "project reference" set up to the library project, this will prevent the automatic building of the library project when your application project is built. Thus unless you had already built the library project manually, the actual library archive will not exist when the link step of your application project takes place.
For more details of setting links up between projects, see the FAQ Using library projects from your own projects.
Build configurations do not match
When you build your application project and it is linked to a library project, typically a build of the application project will require the library archive from the library project that has been built for the same build configuration (typically either Debug or Release). If this does not yet exist, then the project reference between your project and the library project will trigger a build. However this will only work if the build configurations of the two projects match (ie both set to Debug, or both set to Release). If this is not the case, then you will need to change the build configuration of one of the projects to match the other.
For more details please see the FAQ How do I switch between Debug and Release builds?.