We have recently upgraded from VS2002 to VS2005 and I'm having a problem
with the linker always performing a full link even though nothing has
changed. In searching the newsgroups I found that I could add "/test" to the
linker options and it would tell me why it was causing it to re-link (full
link). This is what I get.
Linking...
LINK : file alignment: 512, section alignment: 4096
LINK : LINK options changed; performing full link
LINK : performing full link
It tells me that something changed in the link options, but it doesn't tell
me what. The other problem is that nothing was changed. I can do two builds
back to back and it will do a full re-link every time.
After fighting this for a week, I finally found something. The problem is I
don't know what to do about it.
We are a Unicode MFC (static linked) app and use the unicows layer so we can
run on 9x. Unicows layer requires the linker options "/nod:<various windows
libs>" in order to work correctly. If I remove all the "/nod" linker
options, the re-link is no longer done. If I make a small change, then
incremental linking works. This is exactly what we need. But, I can't leave
out the /nod options.
Has anyone ran into this issue and/or does anyone have a solution to this?
Thanks
Scott
Marcus Heege - 31 May 2006 10:31 GMT
Hi
a) can you please run
dumpbin /directives xxx.obj
where xxx.obj is a typical object file of your project and tell us what
you see.
b) what are your linker options (you can find them in buildlog.htm)
Marcus
> We have recently upgraded from VS2002 to VS2005 and I'm having a problem
> with the linker always performing a full link even though nothing has
[quoted text clipped - 26 lines]
>
> Scott
Scott - 31 May 2006 18:26 GMT
Thank you for your help. Below are the items you requested.
a) dumpbin of our main application object file (.obj)
File Type: COFF OBJECT
Linker Directives
-----------------
/DEFAULTLIB:"uafxcwd.lib"
/DEFAULTLIB:"libcmtd.lib"
/DEFAULTLIB:"kernel32.lib"
/DEFAULTLIB:"user32.lib"
/DEFAULTLIB:"gdi32.lib"
/DEFAULTLIB:"msimg32.lib"
/DEFAULTLIB:"comdlg32.lib"
/DEFAULTLIB:"winspool.lib"
/DEFAULTLIB:"advapi32.lib"
/DEFAULTLIB:"shell32.lib"
/DEFAULTLIB:"comctl32.lib"
/DEFAULTLIB:"shlwapi.lib"
/include:__afxForceEXCLUDE
/include:??3@YAXPAX@Z
/DEFAULTLIB:"uuid.lib"
/DEFAULTLIB:"uuid.lib"
/DEFAULTLIB:"uuid.lib"
/DEFAULTLIB:"uuid.lib"
/DEFAULTLIB:"uuid.lib"
/DEFAULTLIB:"oledlg.lib"
/DEFAULTLIB:"ole32.lib"
/DEFAULTLIB:"oleaut32.lib"
/DEFAULTLIB:"uuid.lib"
/DEFAULTLIB:"urlmon.lib"
/DEFAULTLIB:"uuid.lib"
/DEFAULTLIB:"urlmon.lib"
/DEFAULTLIB:"comsuppwd.lib"
/DEFAULTLIB:"user32.lib"
/DEFAULTLIB:"ole32.lib"
/DEFAULTLIB:"oleaut32.lib"
/DEFAULTLIB:"ToolkitPro1011vc80SUD.lib"
/NODEFAULTLIB:libcd.lib
/DEFAULTLIB:"uuid.lib"
/DEFAULTLIB:"libcpmtd"
/DEFAULTLIB:"ToolkitPro1011vc80SUD.lib"
/NODEFAULTLIB:libcd.lib
/DEFAULTLIB:"Rpcrt4"
/alternatename:??$HashKey@PB_W@@YGIPB_W@Z=?HashKey@@YGIPB_W@Z
/alternatename:??$SerializeElements@V?$CStringT@_WV?$StrTraitMFC@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@@@YGXAAVCArchive@@PAV?$CStringT@_WV?$StrTraitMFC@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@H@Z=?SerializeElements@@YGXAAVCArchive@@PAV?$CStringT@_WV?$StrTraitMFC@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@H@Z
/DEFAULTLIB:"LIBCMTD"
/DEFAULTLIB:"OLDNAMES"
Summary
28 .CRT$XCU
724 .bss
542 .data
474A0 .debug$S
64 .debug$T
543 .drectve
178DF .rdata
468 .rdata$r
4 .rtc$IMZ
4 .rtc$TMZ
130 .sxdata
11376 .text
1307 .text$x
140 .text$yc
B0 .text$yd
1410 .xdata$x
b) Linker options from BuildLog.htm
/OUT:".\Debug/BarTend.exe" /INCREMENTAL /LIBPATH:"..\Lib\Bin\Debug"
/LIBPATH:".\Debug" /LIBPATH:"..\Lib\LibCodeJock\lib\vc80" /MANIFEST
/MANIFESTFILE:".\Debug\obj\BarTender\BarTend.exe.intermediate.manifest"
/MANIFESTDEPENDENCY:"type='Win32' name='Microsoft.Windows.Common-Controls'
version='6.0.0.0' processorArchitecture='X86'
publicKeyToken='6595b64144ccf1df' language='*'" /NODEFAULTLIB:"libc.lib"
/NODEFAULTLIB:"libcmt.lib" /NODEFAULTLIB:"msvcrt.lib"
/NODEFAULTLIB:"libcd.lib" /NODEFAULTLIB:"msvcrtd.lib"
/DELAYLOAD:"shlwapi.dll" /DELAYLOAD:"oleacc.dll" /DELAYLOAD:"wininet.dll"
/DELAYLOAD:"wtsapi32.dll" /DELAYLOAD:"msimg32.dll" /DELAYLOAD:"odbc32.dll"
/DELAYLOAD:"gdiplus.dll" /DEBUG /PDB:".\Debug/BarTend.pdb"
/SUBSYSTEM:WINDOWS /ENTRY:"wWinMainCRTStartup" /MACHINE:X86 /test
Unicows+.lib /nod:kernel32.lib /nod:advapi32.lib /nod:user32.lib
/nod:gdi32.lib /nod:shell32.lib /nod:comdlg32.lib /nod:version.lib
/nod:mpr.lib /nod:rasapi32.lib /nod:winmm.lib /nod:winspool.lib
/nod:vfw32.lib /nod:secur32.lib /nod:oleacc.lib /nod:oledlg.lib
/nod:sensapi.lib UnicoWS.lib kernel32.lib advapi32.lib user32.lib gdi32.lib
shell32.lib comdlg32.lib version.lib mpr.lib rasapi32.lib winmm.lib
winspool.lib vfw32.lib secur32.lib oleacc.lib oledlg.lib sensapi.lib
odbc32.lib odbccp32.lib htmlhelp.lib Iphlpapi.lib netapi32.lib Wtsapi32.lib
Usp10.lib "..\lib\bin\debug\libimage.lib" "..\lib\bin\debug\libs.lib"
"..\lib\bin\debug\libvalidation.lib" "..\lib\bin\debug\libmail.lib"
"..\lib\bin\debug\libhasp4.lib" "..\lib\bin\debug\libappcommon.lib"
"..\lib\bin\debug\libpcm.lib" "..\lib\bin\debug\libwizard.lib"
"..\lib\bin\debug\libtoolbox.lib" "..\lib\bin\debug\libactivationwizard.lib"
"..\lib\bin\debug\libmessaging.lib" "..\lib\bin\debug\liblicense.lib"
"..\lib\bin\debug\libtoolbar.lib" "..\lib\bin\debug\libxml.lib"
"..\lib\bin\debug\libbcencoder.lib" ".\debug\btenu.lib"
"..\lib\bin\debug\libls.lib" "..\lib\bin\debug\libgrid.lib" DelayImp.lib
Scott
Email: SearchAndReplace(email, "invlaid", "com")
> Hi
>
[quoted text clipped - 37 lines]
>>
>> Scott
Marcus Heege - 31 May 2006 19:42 GMT
Hi Scott,
> Thank you for your help. Below are the items you requested.
>
[quoted text clipped - 143 lines]
>>>
>>> Scott
To me it seems the alignment of a section unicows.lib causes the problem.
Maybe you find another unicows.lib file that causes less problems. Do you
use the one from the platform SDK?
Marcus
David Wilkinson - 31 May 2006 12:23 GMT
> We have recently upgraded from VS2002 to VS2005 and I'm having a problem
> with the linker always performing a full link even though nothing has
[quoted text clipped - 26 lines]
>
> Scott
Scott:
At least in VC6, incremental linking is only used in debug build. You do
not really need the unicows stuff in debug build, do you?
David Wilkinson
Scott - 31 May 2006 18:33 GMT
I would like to fix this if at all possible, but if not, this is a great
work around.
Thanks for sharing.
Scott
Email: SearchAndReplace(email, "invlaid", "com")
>> We have recently upgraded from VS2002 to VS2005 and I'm having a problem
>> with the linker always performing a full link even though nothing has
[quoted text clipped - 34 lines]
>
> David Wilkinson