The following issue has been SUBMITTED. ====================================================================== https://public.kitware.com/Bug/view.php?id=16007 ====================================================================== Reported By: Anatoly Shirokov Assigned To: ====================================================================== Project: CMake Issue ID: 16007 Category: CCMake Reproducibility: always Severity: block Priority: normal Status: new ====================================================================== Date Submitted: 2016-03-04 13:47 MSK Last Modified: 2016-03-04 13:47 MSK ====================================================================== Summary: Visual Studio 2015 + v110_xp toolset + MFC: rerun cmake 3.5.0-rc3 inside Visual Studio breaks compilation Description: 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
Steps to Reproduce: 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 Additional Information: 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? ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2016-03-04 13:47 Anatoly ShirokovNew Issue ====================================================================== -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake-developers