Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ libraries
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 26-Jan-13 5:37am
Edited 26-Jan-13 5:40am
ProgramFOX118.7K
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
Matthew Faithfull at 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 at 26-Jan-13 12:41pm
   
Get yourself a copy of Visual Studio (or the free Express version).
Matthew Faithfull at 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 at 27-Jan-13 6:10am
   
Sorry, but your original question did not mention what you were actually doing.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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 Frown | :-( 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.
  Permalink  

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

  Print Answers RSS
0 Maciej Los 469
1 OriginalGriff 379
2 CPallini 205
3 Sergey Alexandrovich Kryukov 170
4 Sharmanuj 109
0 OriginalGriff 5,649
1 Sergey Alexandrovich Kryukov 4,783
2 Peter Leow 2,954
3 Maciej Los 2,689
4 DamithSL 2,465


Advertise | Privacy | Mobile
Web04 | 2.8.140718.1 | Last Updated 26 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid