Re: linkage problems when building a VC7.1 project from the command line
- From: "Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@xxxxxxxxxxxxxxx>
- Date: Sun, 7 May 2006 13:23:51 -0700
Bit byte wrote:
I think you're onto something here Bruno - there appears to be a
difference in the commands used in the log file. Specifically, a .rsp
file is created which I am not doing at the command line:
<BuildLog>
Creating temporary file "c:\timer\Debug\RSP000007.rsp" with contents
[
/Od /D "WIN32" /D "BUILDING_DLL" /D "_WINDLL" /D "_MBCS" /Gm /EHsc
/RTC1 /MTd /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /Wp64 /ZI /TP
.\timer.cpp
]
Creating command line "cl.exe @c:\timer\Debug\RSP000007.rsp /nologo"
Creating temporary file "c:\timer\Debug\RSP000008.rsp" with contents
[
/OUT:"Debug/timer.dll" /INCREMENTAL /NOLOGO /DLL /DEBUG
/PDB:"Debug/timer.pdb" /SUBSYSTEM:WINDOWS /IMPLIB:"Debug/timer.lib"
/MACHINE:X86 Winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
odbc32.lib odbccp32.lib
.\Debug\timer.obj
]
Creating command line "link.exe @c:\timer\Debug\RSP000008.rsp"
</BuildLog>
My questions are:
1). What are these .rsp (linker response) files and how may I
re-create them on the command line? - when I run the EXACT command shown
in the
buildlog for the compiler, I do not get a message saying that a
temporary *.rsp file is being created - WHY ?
The .rsp file simply contains more command-line options for the linker. You
can simply pile everything on the command line in most cases. There is an
upper limit though - the linker only accepts (IIRC) about 4000 characters on
the command line, so if you're linking a lot of modules it's not too hard to
exceed that limit. That's why the IDE uses the response file to hold the
list of files to be linked - there's no limit on how much stuff you can pile
into a response file.
2). How are these .rsp files named? Are the assigned numbers (07 and
08 in the above log - random numbers?)
For all practical purposes, yes. The name is unimportant - the IDE simply
generates consequtive numbers. The file extension is also unimportant -
there's nothing special about .rsp - it's just a text file.
3). Why is the compiler (cl.exe) using linker options ("/DLL",
"/SUBSYSTEM:WINDOWS", "/MACHINE:X86" etc ?) - are these simply being
passed to the linker?
I don't see those options in the cl command line you've shown above.
Rather, those are being passed to the linker.
-cd
.
- References:
- linkage problems when building a VC7.1 project from the command line
- From: Bit byte
- Re: linkage problems when building a VC7.1 project from the command line
- From: Bruno van Dooren
- Re: linkage problems when building a VC7.1 project from the command line
- From: Bit byte
- linkage problems when building a VC7.1 project from the command line
- Prev by Date: Re: linkage problems when building a VC7.1 project from the command line
- Next by Date: error C2440
- Previous by thread: Re: linkage problems when building a VC7.1 project from the command line
- Next by thread: Re: linkage problems when building a VC7.1 project from the command line
- Index(es):
Relevant Pages
|