Most Visual C++ project settings can be setup using the Project Properties dialog, but not all. In my recent project, I am trying to host Windows Form in MFC (VS2002), and the directive “/clr” must be used.
Once “/clr” is used, some other directives such “/GL” must be disabled to avoid incompatibilities. After searching MSDN, I have found that “/GL” is related to “Whole Program Optimization”, but even after disabling the whole program optimization in Visual Studio 2002, it is stated that the “/GL” switch is still turned on. I have tried every setting, but have no way to disable this, and this is clearly shown in the final command line.
To troubleshoot this, one of the approach is to manually edit such settings.
- Open *.vcproj use notepad.exe
- Search “WholeProgramOptimization”
- Change the value from “TRUE” to “FALSE”
That is it!
Note that such a setting can be interactively configured in Visual Studio 2010, as shown below.
Filed under: MFC Tagged: /clr /GL Visual Studio Project setting
