How to fix Incremental Link Error?  
Author Message
yabansu





PostPosted: Visual C++ General, How to fix Incremental Link Error? Top

Hi all,

I implemented a basic client application. It communicates with server and works properly. Building processes succeed just by giving the following warning:

LINK : D:\DOC\Visual Studio 2005\Projects\Client01\Debug/Client01.exe not found or not built by the last incremental link; performing full link

This warning occurs when building/rebuilding the project after cleaning the intermediate and output files. If the project is once built then this warning is not given.

In the solution, I have only one project consisting of the following files(I also added wsock32.lib to Project configuration as the Linker Input in order to use the socket functions):

  • main.cpp
  • MyMessage.h
  • MyMessage.cpp
  • MyConnection.h
  • MyConnection.cpp

What is the reason behind this warning It is really disturbing!

I hope someone could help me..
Thanks,
yabansu

The build log is the following:

Build Log
Build started: Project: Client01, Configuration: Debug|Win32

Command Lines
Creating temporary file "d:\DOC\Visual Studio 2005\Projects\Client01\Client01\Debug\RSP00000139643532.rsp" with contents[
/Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /c /Wp64 /ZI /TP
".\MyMessage.cpp"
".\main.cpp"
".\MyConnection.cpp"
]

Creating temporary file "d:\DOC\Visual Studio 2005\Projects\Client01\Client01\Debug\TMP00000239643532.tmp" with contents
[
1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ ".\\Debug\\Client01.exe.embed.manifest"
]
Creating command line "rc.exe /fo".\Debug\Client01.exe.embed.manifest.res" "d:\DOC\Visual Studio 2005\Projects\Client01\Client01\Debug\TMP00000239643532.tmp""
Creating temporary file "d:\DOC\Visual Studio 2005\Projects\Client01\Client01\Debug\RSP00000339643532.rsp" with contents
[
/OUT:"D:\DOC\Visual Studio 2005\Projects\Client01\Debug\Client01.exe" /INCREMENTAL /MANIFEST /MANIFESTFILE:"Debug\Client01.exe.intermediate.manifest"
/DEBUG /PDB:"d:\DOC\Visual Studio 2005\Projects\Client01\debug\Client01.pdb" /SUBSYSTEM:CONSOLE
/MACHINE:X86 wsock32.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\MyConnection.obj""
.\Debug\main.obj""
.\Debug\MyMessage.obj"
".\Debug\Client01.exe.embed.manifest.res"
]

Creating temporary file "d:\DOC\Visual Studio 2005\Projects\Client01\Client01\Debug\RSP00000439643532.rsp" with contents
[
/out:".\Debug\Client01.exe.embed.manifest" /notify_update /manifest
".\Debug\Client01.exe.intermediate.manifest"
]

Creating temporary file "d:\DOC\Visual Studio 2005\Projects\Client01\Client01\Debug\BAT00000539643532.bat" with contents

]
Creating command line """d:\DOC\Visual Studio 2005\Projects\Client01\Client01\Debug\BAT00000539643532.bat"""
Creating temporary file "d:\DOC\Visual Studio 2005\Projects\Client01\Client01\Debug\TMP00000639643532.tmp" with contents
[
1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ ".\\Debug\\Client01.exe.embed.manifest"
]
Creating command line "rc.exe /fo".\Debug\Client01.exe.embed.manifest.res" "d:\DOC\Visual Studio 2005\Projects\Client01\Client01\Debug\TMP00000639643532.tmp""
Creating temporary file "d:\DOC\Visual Studio 2005\Projects\Client01\Client01\Debug\RSP00000739643532.rsp" with contents
[
/OUT:"D:\DOC\Visual Studio 2005\Projects\Client01\Debug\Client01.exe" /INCREMENTAL /MANIFEST /MANIFESTFILE:"Debug\Client01.exe.intermediate.manifest"
/DEBUG /PDB:"d:\DOC\Visual Studio 2005\Projects\Client01\debug\Client01.pdb" /SUBSYSTEM:CONSOLE
/MACHINE:X86 wsock32.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\MyConnection.obj"
".\Debug\main.obj"
".\Debug\MyMessage.obj"
".\Debug\Client01.exe.embed.manifest.res"
]


Output Window
Compiling...
MyConnection.cpp
main.cpp
MyMessage.cpp
Generating Code...
Compiling manifest to resources...
Linking...
LINK : D:\DOC\Visual Studio 2005\Projects\Client01\Debug\Client01.exe not found or not built by the last incremental link; performing full link
Embedding manifest...


Results
Build log was saved at "file://d:\DOC\Visual Studio 2005\Projects\Client01\Client01\Debug\BuildLog.htm"
Client01 - 0 error(s), 0 warning(s)



Visual C++2  
 
 
einaros





PostPosted: Visual C++ General, How to fix Incremental Link Error? Top

Why exactly do you need incremental linking

If you've got no good reason to use it, switch it off and the warning will go away.



 
 
yabansu





PostPosted: Visual C++ General, How to fix Incremental Link Error? Top

Hi,

This warning occurs in none of my other VC++ projects although the Incremental Link options is enabled in all of them. So, I just wanted to know why it happened. I thought, I had done something wrong.

The matter here is not to hide the warning but to find out the reason behind this warning. It is some kind of educational purpose.


 
 
stinosky





PostPosted: Visual C++ General, How to fix Incremental Link Error? Top

isn't it logical that, if the executable does not exist, it cannot be built incrementally afaik the point of linking incrementally is that instead of recreating the whole executable, only the part that changed is injected in the file. So if the file doesn't exist (eg after clean), nothing can be injected in it.. It is strange though that you don't have it with every project.. I just checked a couple of my own, and they all give me the warning if I build them after deleting the executable or dll.
 
 
einaros





PostPosted: Visual C++ General, How to fix Incremental Link Error? Top

isn't it logical that, if the executable does not exist, it cannot be built incrementally afaik the point of linking incrementally is that instead of recreating the whole executable, only the part that changed is injected in the file. So if the file doesn't exist (eg after clean), nothing can be injected in it.. It is strange though that you don't have it with every project.. I just checked a couple of my own, and they all give me the warning if I build them after deleting the executable or dll.

Yes, as far as the warning goes, that's head on. Problems can also occur if you've got date skews.

Incremental linking shouldn't be used for anything but debug builds, since it introduces extra indirections on library calls. That's why I'm saying that if you don't know that you need it especially, you should switch it off.



 
 
stinosky





PostPosted: Visual C++ General, How to fix Incremental Link Error? Top



Incremental linking shouldn't be used for anything but debug builds, since it introduces extra indirections on library calls. That's why I'm saying that if you don't know that you need it especially, you should switch it off.



indeed. I guess the sole reason you'd use incremental linking is that you need it for Edit&Continue to work, and that is a feature that seriously speeds up development, at least for me it does.
It's quite a time-saver: if you're stepping through source and you see a simple error, you can just fix it right before you get to the line, and it only takes a minimum amount of time to link the fix into the executable.