MCU Linker Path Error - Release mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCU Linker Path Error - Release mode

416 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by AHeng on Tue Apr 26 08:50:02 MST 2011
Hi all,

I am trying to build in Release mode and get the following error:
"cannot find -lCMSISv1p30_LPC11xx"

In the project properties MCU Linker/Libraries I have "${workspace_loc:/CMSISv1p30_LPC11xx/Release}" for my search path and "CMSISv1p30_LPC11xx" for the library, however in the Linker Options the path is clearly missing from -L"":
-nostdlib -L"" -Xlinker -Map=TestProject11xx.map -Xlinker --gc-sections -mcpu=cortex-m0 -mthumb -T "TestProject11xx_Release.ld"

When I compare this with the Debug mode, Linker options shows the proper search path:
-nostdlib -L"G:\LPCXpresso\workspace.11xx\CMSISv1p30_LPC11xx\Debug" -Xlinker -Map=TestProject11xx.map -Xlinker --gc-sections -mcpu=cortex-m0 -mthumb -T "TestProject11xx_Debug.ld"


I can build in Debug mode without any problems, optimization or not, but the Release mode always gives me the error and can't find the path I already added in the Linker Libraries.

Any tips or recommendations would be greatly appreciated!
0 Kudos
7 Replies

384 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Wed Apr 27 01:25:55 MST 2011

Quote: CodeRedSupport
...
OK, once you know what you are doing, you can perhaps not bother doing this. But certainly it makes life "safer" to start with.



When do I know when I know what I'm doing?:rolleyes:  I like to live dangerously.

Thank you for the reply,
Larry
0 Kudos

384 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Apr 27 01:14:37 MST 2011

Quote: larryvc

Why?


Because recommending that users switch the build configurations of all projects at the same means that they won't run into the "cannot find -lCMSISv1p30_LPC11xx" type error when they then build a particular project :rolleyes: This is particularly the case where multiple library projects are involved (for example, as per the RDB1768 examples).

OK, once you know what you are doing, you can perhaps not bother doing this. But certainly it makes life "safer" to start with.

Regards,
CodeRedSupport
0 Kudos

384 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Wed Apr 27 00:16:02 MST 2011

Quote: CodeRedSupport

As larryvc, says, once you have built the CMSIS library project (in both build configurations) there is normally no need to flip the build configuration of the CMSIS project when you change the build configurations of projects that use it (unless you actually change the CMSIS project sources/properties for some reason). [B]However doing so is probably a good practice to get into[/B].



If I understood this correctly you are recommending flipping the build configuration of CMSIS to match that of the build configuration of the projects.

Why?

Don't the projects use the correct CMSIS build configuration?
0 Kudos

384 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Apr 26 23:46:30 MST 2011

Quote: AHeng

I am trying to build in Release mode and get the following error:
"cannot find -lCMSISv1p30_LPC11xx"



For future reference, this error is covered in the following FAQ:

http://support.code-red-tech.com/CodeRedWiki/CannotFindLinkerError

And changing the current build configurations is covered in these FAQs:

http://support.code-red-tech.com/CodeRedWiki/ChangeBuildConfig
http://support.code-red-tech.com/CodeRedWiki/BuildConfigMultipleProjs


Quote: AHeng

Do I have to re-build it every time I change the system settings?    


As larryvc, says, once you have built the CMSIS library project (in both build configurations) there is normally no need to flip the build configuration of the CMSIS project when you change the build configurations of projects that use it (unless you actually change the CMSIS project sources/properties for some reason). However doing so is probably a good practice to get into.

Regards,
CodeRedSupport
0 Kudos

384 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Tue Apr 26 20:22:51 MST 2011

Quote: AHeng

Do I have to re-build it every time I change the system settings?



What do you mean by change the system settings?

If you have built both the debug and release builds of CMSIS in the current workspace then your project can be switched to/from debug/release without having to rebuild CMSIS again.
0 Kudos

384 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by AHeng on Tue Apr 26 16:40:46 MST 2011
That fixed it! Thanks a lot!

Do I have to re-build it every time I change the system settings?
0 Kudos

384 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by TheFallGuy on Tue Apr 26 10:01:42 MST 2011
You need to build the CMSIS library for release too.
0 Kudos