Search code examples
visual-c++scons

How to work around “scons: warning: Two different environments were specified for target” [[BUT do not change file ]]


I want to build one program using scons under windows 7 64 bits. I also have Microsoft Visual Studio c++ and mingw.

However, when I build the program (which include several files and sub directory) with scons, I see this error

two different environments were specified in target  C:\....... .obj but they appear to have the same action ${TEMPFILE($SHCC _MSVC _OUTPUT _FLAG /c $CHANGED $SHCFLAGS $SHCCFLAGS $_CCCOMCOM

Note: ..... is the path of the file which I want to install.

When I search in stackoverflow, I saw this problem mentioned and there were solutions for that but my problem is it that I should not change program's code because I'm sure the code is true.

If you give me any idea, I will truly appreciate your help


Solution

  • Firstly, this is not an error. It is a warning. Therefore it wont stop your build. If your build is failing, it is because of something else.

    What this warning means is that there are two or more libraries or programs in your build that require the same .o file. This isn't currently a problem but if you (say) change the compile switches for one instance, it'll mean you have 2 incompatible sets of requirements for the same object, and that will result in a build error.