Command line builds and file changes

Hello,

we are using VS2005. This question pertains to VC++ and command like builds. I am trying to use vcbuild (or msbuild) to build from scripts a solution with about 40 projects. What I find is that after doing a full build (win32 and debug, for instance) if I change a header file for instance and run the vcbuild command again passing the solution file, it says that everything is up to date. If I do the same thing from the IDE, right click on the solution and do Build Solution it rebuilds exactly what it needs. Am I doing something wrong with the command line I would like it just to build what it needs, I don't want to use /rebuild to rebuild everything.

Thanks,

JuanMi



Answer this question

Command line builds and file changes

  • Sarah Cameron

    Ayman,

    "C:\Program Files\Microsoft Visual Studio 8\VC\vcpac
    kages\"vcbuild /Platform:Win32 GEMBASE.sln "Debug|Win32"

    I have found that if I run the same in a session where I have run vcvarsall x86, then it seems to work ok, both vcbuild and msbuild seem to find when I have changed a file and build what is needed.... and I don't have to use the path for vcbuild, of course ;-)

    However, now the problem that I have is that if I use the command:

    vcbuild GEMBASE.sln "Debug|Win32"

    After about 19 projects vcbuilds begins to fail, I get errors like this:

    Build started: Project: gem_dmc_decoder, Configuration: Debug|Win32
    Compiling...
    gem_dmc_decoder.c
    Compiling manifest to resources...
    Linking...
    LINK : fatal error LNK1104: cannot open file '.obj'
    gem_dmc_decoder - 1 error(s), 0 warning(s)

    Did you notice the '.obj' without the file name After the first one fails all of the following ones fail.

    But if I build a bat script where I call vcbuild for every single .vcproj, instead of calling the solution then it works just fine and everything builds.

    What can be the cause of this Thanks for your time.

    JuanMi


  • Ron Wilson

    I have sent to the VC IDE folks to take a look at the thread.

    Thanks for your patience!

    Thanks,
    Ayman Shoukry
    VC++ Team


  • jbattat

    What is the command line that you are using

    Thanks,
    Ayman Shoukry
    VC++ Team


  • honouroll

    it's really hard to say without a test case to look at. best guess is that the problem lies in your use of the /platform switch when building an .sln. since you are passing in the configuration name anyway, this doesn't get you anything, and could cause trouble in the mapping from the solution configuration name to the project configuration names.

    I don't know why running vcvars would affect the outcome, but running vcvars (or setting the environment in other ways) isn't necessary when running vcbuild, as it doesn't use the PATH, LIB, LIBPATH or INCLUDE variables anyway (unless you run with the /useenv switch, but you should only do that if you know exactly what you are doing and have a good reason for doing so).

    if you can provide a test project that shows this behavior (or at least the html buildlog files) I can take a look and make more specific suggestions.

    thnx,

    josh

    vc++ project system developer



  • Command line builds and file changes