Sign in to follow this  

Intermittent linker errors in VS2008

Recommended Posts

I've been working on a build server that has to handle monolithic solutions numbering 70+ projects. It has been a growing problem from the beginning that these builds fail occasionally due to LNK2019 (Unresolved external) errors. At first I suspected incorrectly specified dependences, but that was quickly ruled out. In most cases the required library has already been built, and is set as a direct dependency of the linking project. I've heard that this is caused by a bug in the linker causing it to 'forget' some of its dependencies, but I haven't been able to find anyone else talking about it online. I'm beginning to wonder if I just overlooked something painfully obvious. Any suggestions or resources on what could be causing this would be appreciated :). Below is a more detailed list of observations since I first encountered this 3 months ago. --------- -Built on Windows Vista Business with VS2008 SP1 on a quad core, 64 bit machine. -Built using command line - devenv.exe xyz.sln /build "target|platform" -A clean is performed before each build using - devenv.exe xyz.sln /clean "target|platform" -Only one instance of devenv is running at a time. -Errors appear in both... *32 and 64 bit *Debug and Release *builds using incremental and non-incremental linking *builds linking to .lib and .obj files (Use Library Dependency Inputs = YES) *With and without optimizations enabled -It only happens when linking to libraries that are built as part of the solution. -Defining the dependencies in the solution or using references makes no difference. -It appears to happen more when building the entire solution as opposed to building a single project (and all of its dependencies). -It happens more frequently, but not exclusively, to certain projects over any given period of time. -It has occurred as rarely as once every 50 or so builds and as frequently as two builds in a row. -It can build a code base successfully once, then try the same one again and fail. -The LNK2019 errors can pertain to functions spanning multiple different libraries in a single build. All of which successfully linked to different projects during that build. For example: Project A fails to link functions from compiled library projects C and D, but project B linked the same functions without issue. -Deleting and refreshing the code base from source control has no effect -It has happened with multiple different solution files. -A virus scanner has caused intermittent problems in the past, but those all involved write-locked files. So far I haven’t been able to prove a connection with the scanner and these linker errors yet.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this