![]() |
Telelogic Rhapsody (steve huntington) | ![]() |
Topic Title: How to add lib directories to search path using -L Topic Summary: Created On: 27-Sep-2006 15:29 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I'm using the makefiles generated by Rhapsody to build my code. I'm using the gcc compiler. I need to link several libraries to an executable that I'm building and I would like to add several library directories to the search path the linker uses when searching for the libraries. I believe I need to add the directories using the -L option but I can't figure out how to add this option or the directories in my Rhapsody project. Anyone have any ideas?
|
|
![]() |
|
![]() |
|
You have to specify the entire path (absolute or relative to your output dir), if you would use the Component or Configuration feature dialogs.
Another way is to add the -L<path> expression to the <lang>_CP::<Environment>::MakeFileContent property to the "LINK_FLAGS" macro. We use gcc too and in our setup we do something like this: In the bat file specified under <lang>_CP::<Environment>::InvokeMake property we set an environment variable, OPT_LC: [CODE] set OPT_LC= -L../../../eCosBoard/eCos_install/lib[/CODE]The OPT_LC environment variable is then used in the <lang>_CP::<Environment>::MakeFileContent property: [CODE]LINK_FLAGS= $(OPT_LC) $OMConfigurationLinkSwitches[/CODE] ------------------------- Jesper Gissel Johnson Controls Denmark, Marine Controls |
|
![]() |
|
![]() |
|
Hi Shawn
I agree with Jesper's suggestions, and would like to add another: If you wish to avoid editing the make file template or batch files, you can add your -L<path> expressions to one of the following properties: [list] [*]<lang>_CPP::<Env>::LinkDebug (for debug builds only) [*]<lang>_CPP::<Env>::LinkRelease (for release builds only) [*]<lang>_CPP::<Env>::LinkSwitches (for any build) [/list] The last of these is available in the configuration features dialogue, at the bottom of the Settings tab. Alternatively, you can apply any of these to components or configurations, via their Properties tabs. best regards, Simon ------------------------- Simon Morrish simon.morrish@eu.panasonic.com http://panasonic.co.uk Panasonic ideas for life |
|
![]() |
|
![]() |
|
Hi Shawn,
this is like the copy/paste in Windows, you can do it several ways ![]() You could also place a comma separated list of the libraries and their full pathnames in either: 1. the Libraries field of the General tab of the Component features dialog. 2. the Libraries field of the Setting tab of the Configuration features dialog. The second list will preceed the first in the generated makefile. This option is probably best with only one or two libraries. Regards, Ian |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.