Visual Studio 2010 Linker Question

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Visual Studio 2010 Linker Question

      Hi everyone, I'm teaching myself the ins and outs of VS2010 by creating a new solution and copying over the settings in the book source solutions. It's quite instructive, and is pointing out quite a bit about linking and compiling that I was never aware of.

      There is one thing I've noticed that I was wondering if anyone had an answer to. I've created a barebones system where the GCC project just has a few windows includes, but is still compiled into a .lib file. TeapotWars just calls the WinMain function, opens a Messagebox, and quits.

      Sometimes, when I'm compiling the Release versions of the projects, I get a linker error saying that gamecode4.lib cannot be found. I then attempt to build the solution again and it works perfectly. No big deal, sure, but I'm just wondering if anyone has an inkling as to why this happens.

      Is it something to do with incremental building? I can't figure out why this would happen just in the release builds (both Win32 and x64).

      Thanks everyone!
    • Hey buuck,

      Just a random guess: Under TeapotWars -> Project Dependencies, is GameCode checked? That sets the order that the projects build in, so I would guess that when you do a Clean/Rebuild, it might try building TeapotWars before GameCode has been built, resulting in the library not being found. Then if you do another build, the library already exists, and can be included by TeapotWars.

      James
    • When I notice this it tends to be because there is some kind of compiler error in the gamecode4 source files - but your problem sounds more like the dependency issue...
      Mr.Mike
      Author, Programmer, Brewer, Patriot