Click here to Skip to main content
15,888,051 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm clearly missing the obvious but I can't seem to find a way of adding or removing static libraries from the Link stage of a build in RAD studio ( Formerly CPPBuilder )
I have a static library project that builds fine. MyStatic.lib is in the output Win32\Debug folder shared with the other projects in the group.
One of those other projects TestCmp.exe needs to have MyStatic.lib linked in. Easy right? Except I can't find anywhere to actually add it. There are a bundle of things on the command line for TestCmp.exe including some static libs clearly put there by the IDE but I can't find any way to edit it.

Currently the command line looks like this:
c:\program files\embarcadero\rad studio\10.0\bin\ilink32.exe -L.\Win32\Debug;"c:\program files\embarcadero\rad studio\10.0\lib\Win32\debug";"c:\program files\embarcadero\rad studio\10.0\lib\win32\release";"c:\program files\embarcadero\rad studio\10.0\lib\win32\release\psdk";"C:\Program Files\FastReports\LibD17";"C:\Program Files\Raize\CS5\Lib\RS-XE3\Win32";"C:\Documents and Settings\All Users\Documents\RAD Studio\10.0\DCP" -j.\Win32\Debug;"c:\program files\embarcadero\rad studio\10.0\lib\Win32\debug";"c:\program files\embarcadero\rad studio\10.0\lib\win32\release";"c:\program files\embarcadero\rad studio\10.0\lib\win32\release\psdk";"C:\Program Files\FastReports\LibD17";"C:\Program Files\Raize\CS5\Lib\RS-XE3\Win32";"C:\Documents and Settings\All Users\Documents\RAD Studio\10.0\DCP" -l.\Win32\Debug -r -v -w -G8 -Tpe  c0x32 .\Win32\Debug\TestCmp.obj , .\Win32\Debug\TestCmp.exe , .\Win32\Debug\TestCmp.map , import32.lib cw32mti.lib , , TestCmp.res


I'd like to see MyStatic.lib right in there after cw32mti.lib and I guess the path would need to be in there as an -L option as well.

Any help would be much appreciated.
Posted
Updated 26-Jan-13 5:40am
v2

OK panic over I finally found the incredibly obvious and incredibly dumb solution in this article http://edn.embarcadero.com/article/22694[^] which in summary is, add a file to the .exe project as if you were adding an existing source file, only fiddle the file extension so it shows .lib files and add the built static lib. Sadly this means there is no way to actually control the linker command line directly, no equivalent of --nodefault libs and Code Gear/RAD Studio/CppBuilder is technology locked to their own libraries. Even Microsoft and Apple don't do that. This means I'll have to drop support for it from my project :-( but at least I think I've got the bottom of the issue.
I wait in hope to be corrected by any CodeGear RAD Studio users out there who know a better way.
 
Share this answer
 
I'd like to see MyStatic.lib right in there after cw32mti.lib

You do appreciate that you will need to add it in somewhere. Either manually to your linker command string or via some project settings.
 
Share this answer
 
Comments
Matthew Faithfull 26-Jan-13 12:32pm    
Absolutely. I just can't find anywhere in the rambling obfuscated GUI where I can actually edit or sensibly affect in any way that generated linker command line.
Ultimately I'd like to find the equivalent of a --nodefaultlibs switch as well but I'd be satified just to get MyStatic.lib added in for the moment.
Richard MacCutchan 26-Jan-13 12:41pm    
Get yourself a copy of Visual Studio (or the free Express version).
Matthew Faithfull 26-Jan-13 19:32pm    
Thanks for the advice but I already have 4 versions of Visual Studio, Intel, IBM, Digital Mars, Watcom, Borland, MinGW GCC and GCC compilers, not to mention a ropy build of llvm/clang. Working on a compiler compatability article will do that to you :-)
Richard MacCutchan 27-Jan-13 6:10am    
Sorry, but your original question did not mention what you were actually doing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900