c++visual-studio-2010projects-and-solutionsvisual-studio-6

Aligning VS2010 and VS6 compiler and linker switches for a legacy build


For a legacy project, I have a solution in Visual Studio 2010 that compiles using the Visual Studio 6 compiler using the Daffodil extension for Visual Studio 2010.

I am trying to get the compiler (and linker) input equal (as much as possible) to that of the input I would have had when using Visual Studio 6. So I am comparing the build log file of the VS2010 project to the build log file of the same project in VS6.

I noticed when building in VS2010, the compiler switches passed on the generated command line are different. Some of these differences I can fix in the project file settings in VS2010 but others I can't seem to find: for example the /FD and /TP switches are present when building with VS6 but absent when building with VS2010 and I cannot seem to find these switches anywhere in the project settings in the IDE either. and yet other differences I cannot seem to resolve because I cannot find what the default switches are for VS6 (yes I tried Google): for example the /EHsc switch is present when building with VS2010 but absent when building with VS6, is this a difference or is this the default for the VS6 compiler?

So my question is:

PS:
* the compiler switches that I noticed present in VS6 but absent in VS2010: /FD
* the compiler switches that I noticed absent in VS6 but present in VS2010: /EHsc /Gd /TP /WX- /O2 /Oy-
I know most of this is probably fixable in the project settings but I decided to add the full list for this project anyway, hoping that someone could shed some more light on the specifically troublesome compiler switches to align.

UPDATE: OK, here's what I found and solved:

And then the linker switches... I managed to align most of them except:


Solution

  • The /TP switch is added by the IDE.

    The /stack switch accepts values in decimal or C-language notation. I did a quick test and the VC6 linker appears to correctly interpret the values in quotes as well, so I don't think you need to specify those separately.

    The /machine values can be specified on the Linker\Advanced property page, although it looks like the list of selectable values does not quite match the VC6 documentation. That may be a Daffodil bug, or it may be that the documentation is inaccurate.

    The /mapinfo switch must be added to 'Additional Options' as you mentioned.

    If you have not disabled logging, you can check your linker command log file (link.command.1.log) to see the exact switches passed on the command line. I tested this with the /mapinfo switch, and it is appended to the end of the command line as expected.