Re: linkage problems when building a VC7.1 project from the command line

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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


.



Relevant Pages

  • [opensuse] nmccollector / segfault
    ... CPU0 - ACPI performance management activated. ... SMBus Quick command not supported, ... segfault at 000000001ef2ef6c rip 000000000045eec7 rsp ...
    (SuSE)
  • Re: Software Distribution with response files
    ... The rsp is located in the package folder on the distribution point. ... run from a command line with a mapped drive to the package folder on the ... >> environment tab and then use that drive letter in front of the rsp file. ...
    (microsoft.public.sms.swdist)
  • Re: .rsp files
    ... When you run vcbuild, does it not write the contents of the .rsp ... If I put /logcommands on the vcbuild command line, ... with any additional include/lib paths added manually to ...
    (microsoft.public.vc.language)
  • Re: [opensuse] Using aria2
    ... On Friday 15 December 2006 03:57, Patrick Shanahan wrote: ... Does LOG refer to the log file? ... Can you tell me the command using this program ... SourceForge is not an openSUSE site. ...
    (SuSE)
  • Re: LoadLibrary race/deadlock
    ... Can you include the callstack for that thread by using the 'k' command? ... > Closing open log file c:\enclog ... > Intel compiler which we want to use because of its Pentium-M> optimizations. ... >> Most likely your problem is caused by somebody holding the loader>> lock, so you should see something like this in the output:>> ...
    (microsoft.public.win32.programmer.kernel)