views:

64

answers:

1

Hi there,

I am currently working on a platform indepedent project and we have frenquently come across the following problem: When the Windows guys work on code that is not called by any other part of the code base it will not be compiled and will therefore not trigger compile errors. Once this code is uploaded to a svn server and Linux programmers pull and compile this code they will get build errors. It seems their compiler compiles everything that is included in the code base whereas Visual Studio will only compile used code.

Is there any way to force Visual Studio to compile even unused code as long as it belongs to the project I am currently working on? Or just every code file belonging to the solution would be helpful as well.

EDIT:

Forgot to mention, in case it is relevant:

  • We are using: Visual Studio 2008 prof. ed.
  • C++
  • cmake to create the solution
  • Windows 7 x64

Thanks for your time!

Regards, Jan

A: 

How about working with preprocessor definitions? I do also work on a cross-plattform project. There are some UNIX methods I cannot use and there are some Win API calls UNIX cannot use. So we have something like that:

void DoSomething()
{
    #ifdef WIN
    // do Windows specific code
    #else
    // do UNIX specific code
    #endif
}
Simon Linder
Thanks for your answer, but this problem is not about code not being cross platform compatible. It's about code that would compile on neither of the platforms, but will not be caught in Visual Studio, because Visual Studio doesnt try to compile it. As a result we end up uploading code to the SVN that will not compile for the Linux programmers, since their compiler seems to try to compile code that Visual Studio just ignores.-Jan-
Jan