MantisBT - CMake
View Issue Details
0016007CMakeCCMakepublic2016-03-04 05:472016-06-10 14:31
Anatoly Shirokov 
Kitware Robot 
normalblockalways
closedmoved 
x86Windows 7 Prof 64 bit
CMake 3.4.3 
 
0016007: Visual Studio 2015 + v110_xp toolset + MFC: rerun cmake 3.5.0-rc3 inside Visual Studio breaks compilation
When I change CMakeLists.txt inside Visual Studio 2015 and try to rebuild my solution, I get complication errors:
Error C2039: 'SetDefaultDllDirectories' : is not a member of '`global namespace'' c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\atlcore.h 638 1
Error C2065: 'SetDefaultDllDirectories' : undeclared identifier c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\atlcore.h 638 1
Error C2065: 'LOAD_LIBRARY_SEARCH_SYSTEM32' : undeclared identifier c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\atlcore.h 640 1
1. generate mfc project

>call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC"\vcvarsall.bat x86

>set PATH=%VCINSTALLDIR%\bin;C:\Program Files (x86)\CMake 3.5\bin;%PATH%;

>cmake --version
cmake version 3.5.0-rc3

>cmake -G "Visual Studio 14 2015" -T v110_xp ..\src

2. open the solution in Visual Studio 2015

3. build the solution without any errors

4. change CMakeLists.txt

5. rebuild the solutions and get errors:
Error C2039: 'SetDefaultDllDirectories' : is not a member of '`global namespace'' c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\atlcore.h 638 1
Error C2065: 'SetDefaultDllDirectories' : undeclared identifier c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\atlcore.h 638 1
Error C2065: 'LOAD_LIBRARY_SEARCH_SYSTEM32' : undeclared identifier c:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\atlcore.h 640 1
I have found the feedback related to this problem: https://connect.microsoft.com/VisualStudio/feedback/details/773422/compiler-error-when-using-v110-xp-platform-toolset-visual-studio-2012 [^]

There is a workaround posted by Wouter_Demuynck on 17.12.2012 at 4:07:
I noticed that selecting the v110_xp toolset in the process properties did not automatically enable the _USING_V110_SDK71_ preprocessor flag.

After manually adding the following define at the top of my stdafx.h, the project compiled fine:

#define _USING_V110_SDK71_

I have added #define _USING_V110_SDK71_ to my CMakeFiles.txt, and it solved the problem, but may be there is more elegance solution?
No tags attached.
log CMakeError.log (2,990) 2016-03-04 06:22
https://public.kitware.com/Bug/file/5639/CMakeError.log
Issue History
2016-03-04 05:47Anatoly ShirokovNew Issue
2016-03-04 06:04Anatoly ShirokovNote Added: 0040596
2016-03-04 06:20Anatoly ShirokovNote Edited: 0040596bug_revision_view_page.php?bugnote_id=40596#r2051
2016-03-04 06:22Anatoly ShirokovFile Added: CMakeError.log
2016-03-04 06:22Anatoly ShirokovNote Edited: 0040596bug_revision_view_page.php?bugnote_id=40596#r2052
2016-03-07 11:38Brad KingNote Added: 0040641
2016-03-08 14:04Anatoly ShirokovNote Added: 0040649
2016-03-08 14:06Anatoly ShirokovNote Edited: 0040649bug_revision_view_page.php?bugnote_id=40649#r2054
2016-03-08 14:15Brad KingNote Added: 0040650
2016-03-09 02:20Anatoly ShirokovNote Added: 0040651
2016-03-09 03:03Anatoly ShirokovNote Deleted: 0040651
2016-06-10 14:29Kitware RobotNote Added: 0042958
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0040596)
Anatoly Shirokov   
2016-03-04 06:04   
(edited on: 2016-03-04 06:22)
Sorry, I use the following command:
>cmake -G "Visual Studio 14 2015" -t v110_xp ..\src

Because "cmake -G "Visual Studio 14 2015" -T v110_xp ..\src" does not generate project (see the attached CMakeError.log file):

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(644,9): error MSB4030: "Debug" - invalid parameter value "GenerateDebugInformation" task "Link". Parameter "GenerateDebugInformation" relates to "System.Boolean". [H:\src\CURRENT\vs151\CMakeFiles\CMakeTmp\cmTC_9e17b.vcxproj]

(0040641)
Brad King   
2016-03-07 11:38   
The problem observed in 0016007:0040596 is 0015986.
(0040649)
Anatoly Shirokov   
2016-03-08 14:04   
(edited on: 2016-03-08 14:06)
Thank you so much Brad! Is your patch included to the 3.5.0 release? I have tested 3.5.0-rc3 and the 3.5.0-rc3 does not works.

(0040650)
Brad King   
2016-03-08 14:15   
Re 0016007:0040649: Yes, that fix is in 3.5.0.
(0042958)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.