Re: [CMake] Unable to create project files with Visual Studio 2010 on Windows 7
> Indeed I have tried several ways to create and build projects without > using CMake at all, and so far no luck--I still get "requires > elevation" errors. I don't have a solution for my problem yet but it > appears that whatever it is that is stopping me from building projects, > CMake does not cause the problem. > > Thanks to everyone for the helpful advice, which significantly narrowed > down the possible sources of error. Although this is not really a CMake problem, this thread now comes up in the Google search results for symptoms similar to mine, so it seems useful to post a resolution in case someone else comes upon this thread for that reason. Running the IDE as administrator (not as simple as just "opening" an .sln file, unfortunately), I found another underlying error for which an answer is given at http://stackoverflow.com/a/10890428 . In summary, after I did a web-based installation of Visual Studio 2010 Service Pack 1, I was able to build a project created in the IDE, I was able use CMake to generate projects, and I was able to build the projects generated by CMake. Incidentally, when I first got CMake and the compilers to run correctly, I was only able to do it by running CMake or DEVENV as administrator. Not so coincidentally, somehow during all the installing/uninstalling/attempted fixes I had applied, CL.EXE had been set to run as Administrator for all users. It turns out that when I UNDID this setting (so CL.EXE does not always run as Administrator), CMake and the compilers succeeded without my having to take any special steps to run anything as administrator. Go figure. David -- 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
Re: [CMake] Unable to create project files with Visual Studio 2010 on Windows 7
> On 1/6/2015 7:10 PM, david.k...@engilitycorp.com wrote: > > I have just started using a new Windows 7 host with Visual Studio > 2010 > > Professional. When I call CMake to generate my project files, I get > > the following output in CMakeError.log: > Does your visual studio work without CMake? Can you create a simple > project with the IDE and build it? Can you then build that project > from the command line like CMake does: > > C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe > yourproject.vcxproj /p:Configuration=Debug Indeed I have tried several ways to create and build projects without using CMake at all, and so far no luck--I still get "requires elevation" errors. I don't have a solution for my problem yet but it appears that whatever it is that is stopping me from building projects, CMake does not cause the problem. Thanks to everyone for the helpful advice, which significantly narrowed down the possible sources of error. David -- 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
Re: [CMake] Unable to create project files with Visual Studio 2010 on Windows 7
On 1/6/2015 7:10 PM, david.k...@engilitycorp.com wrote: I have just started using a new Windows 7 host with Visual Studio 2010 Professional. When I call CMake to generate my project files, I get the following output in CMakeError.log: Does your visual studio work without CMake? Can you create a simple project with the IDE and build it? Can you then build that project from the command line like CMake does: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe yourproject.vcxproj /p:Configuration=Debug -Bill -- 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
Re: [CMake] Unable to create project files with Visual Studio 2010 on Windows 7
> What do you mean when you say "I set CMAKE_ROOT to a directory" ?? > > That should not be necessary, no matter how you're running cmake... > > Is that an ENV var or a CMake variable you're setting somewhere? CMAKE_ROOT was an ENV variable used by a script outside of CMake that (in the more complicated build that I was originally describing) would invoke the actual CMake executable. I've been using that script for so long I had forgotten where the requirement for CMAKE_ROOT came from. As it turns out, in at least one of the command windows where I tried the "hello world" test case, I did not actually set CMAKE_ROOT after all. That symbol (or lack of it) does not seem to have any bearing on the problem I'm experiencing. David -- 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
Re: [CMake] Unable to create project files with Visual Studio 2010 on Windows 7
What do you mean when you say "I set CMAKE_ROOT to a directory" ?? That should not be necessary, no matter how you're running cmake... Is that an ENV var or a CMake variable you're setting somewhere? D On Wed, Jan 7, 2015 at 1:18 PM, wrote: > A small correction: the problem with "The C compiler identification is > unknown" seems to have been due to the fact that I forgot to open that > particular command window as administrator. In a new command window, run as > administrator, both -G "Visual Studio 10" and -G "Visual Studio 10 Win64" > produce the "required elevation" error, same as before. Go figure. > > David > >> -Original Message- >> From: Karr, David A. @ EngilityCorp >> Sent: Wednesday, January 07, 2015 12:47 PM >> To: 'David Cole' >> Cc: cmake@cmake.org >> Subject: RE: [CMake] Unable to create project files with Visual Studio >> 2010 on Windows 7 >> >> I tried this with a CMakeLists file that contains only a PROJECT and >> ADD_EXECUTABLE (with a single C++ source file). The only things present >> in the directory before running CMake were the C++ file, >> CMakeLists.txt, and a batch file that I used to run CMake. I still get >> the "requires elevation" error even when I run cmake.exe from a command >> line as administrator. It also doesn't seem to matter whether I select >> Visual Studio 10 or Visual Studio 10 Win64 as my generator. >> >> I thought maybe the problem was that I didn't "install" CMake, rather >> (as I've been doing for years, due to the way this project is version- >> controlled) I set CMAKE_ROOT to a directory that happens to contain the >> CMake files and then ran a copy of cmake.exe. I just tried the exercise >> again after doing a regular installation of CMake 3.1.0 (using default >> choices only) and came up with the same result. (Actually not quite: >> now -G "Visual Studio 10" says "The C compiler identification is >> unknown", and only -G "Visual Studio 10 Win64" produces the "elevation" >> error, whereas with my previous uninstalled version both generators >> resulted in "elevation".) >> >> David > > -- 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
Re: [CMake] Unable to create project files with Visual Studio 2010 on Windows 7
A small correction: the problem with "The C compiler identification is unknown" seems to have been due to the fact that I forgot to open that particular command window as administrator. In a new command window, run as administrator, both -G "Visual Studio 10" and -G "Visual Studio 10 Win64" produce the "required elevation" error, same as before. Go figure. David > -Original Message- > From: Karr, David A. @ EngilityCorp > Sent: Wednesday, January 07, 2015 12:47 PM > To: 'David Cole' > Cc: cmake@cmake.org > Subject: RE: [CMake] Unable to create project files with Visual Studio > 2010 on Windows 7 > > I tried this with a CMakeLists file that contains only a PROJECT and > ADD_EXECUTABLE (with a single C++ source file). The only things present > in the directory before running CMake were the C++ file, > CMakeLists.txt, and a batch file that I used to run CMake. I still get > the "requires elevation" error even when I run cmake.exe from a command > line as administrator. It also doesn't seem to matter whether I select > Visual Studio 10 or Visual Studio 10 Win64 as my generator. > > I thought maybe the problem was that I didn't "install" CMake, rather > (as I've been doing for years, due to the way this project is version- > controlled) I set CMAKE_ROOT to a directory that happens to contain the > CMake files and then ran a copy of cmake.exe. I just tried the exercise > again after doing a regular installation of CMake 3.1.0 (using default > choices only) and came up with the same result. (Actually not quite: > now -G "Visual Studio 10" says "The C compiler identification is > unknown", and only -G "Visual Studio 10 Win64" produces the "elevation" > error, whereas with my previous uninstalled version both generators > resulted in "elevation".) > > David -- 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
Re: [CMake] Unable to create project files with Visual Studio 2010 on Windows 7
I tried this with a CMakeLists file that contains only a PROJECT and ADD_EXECUTABLE (with a single C++ source file). The only things present in the directory before running CMake were the C++ file, CMakeLists.txt, and a batch file that I used to run CMake. I still get the "requires elevation" error even when I run cmake.exe from a command line as administrator. It also doesn't seem to matter whether I select Visual Studio 10 or Visual Studio 10 Win64 as my generator. I thought maybe the problem was that I didn't "install" CMake, rather (as I've been doing for years, due to the way this project is version-controlled) I set CMAKE_ROOT to a directory that happens to contain the CMake files and then ran a copy of cmake.exe. I just tried the exercise again after doing a regular installation of CMake 3.1.0 (using default choices only) and came up with the same result. (Actually not quite: now -G "Visual Studio 10" says "The C compiler identification is unknown", and only -G "Visual Studio 10 Win64" produces the "elevation" error, whereas with my previous uninstalled version both generators resulted in "elevation".) David > -Original Message- > From: David Cole [mailto:dlrd...@aol.com] > Sent: Wednesday, January 07, 2015 10:58 AM > To: Karr, David A. @ EngilityCorp > Cc: cmake@cmake.org > Subject: Re: [CMake] Unable to create project files with Visual Studio > 2010 on Windows 7 > > The "The requested operation requires elevation." message indicates > some sort of permissions problem (admin privileges...) > > Did you run VS and/or CMake as an admin one time, and then not as an > admin a second time...? > > It should work with either all-non-admin runs or all-admin runs, but > you probably can't mix-n-match from run to run. > > Can you start with a very simple hello world app, in a brand new "empty > to start with" directory, and run CMake and VS without admin > privileges? > > Or do you get exactly the same thing if you do that? > > > D > > > > On Tue, Jan 6, 2015 at 7:10 PM, wrote: > > I have just started using a new Windows 7 host with Visual Studio > 2010 > > Professional. When I call CMake to generate my project files, I get > > the following output in CMakeError.log: > > > > == > > Determining if the C compiler works failed with the following output: > > Change Dir: > C://__/CMakeFiles/CMakeTmp > > > > Run Build > > Command:C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe > > cmTryCompileExec.vcxproj /p:Configuration=Debug Microsoft (R) Build > > Engine version 4.0.30319.17929 [Microsoft .NET Framework, version > > 4.0.30319.18034] Copyright (C) Microsoft Corporation. All rights > > reserved. > > > > Build started 1/6/2015 6:15:19 PM. > > Project > > > "C:\\__\CMakeFiles\CMakeTmp\cmTryCompil > eExec.vcxproj" > > on node 1 (default targets). > > InitializeBuildStatus: > > Creating > "cmTryCompileExec.dir\Debug\cmTryCompileExec.unsuccessfulbuild" > > because "AlwaysCreate" was specified. > > ClCompile: > > C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe > /c > > /Zi /nologo /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D > > "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise > > /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec.dir\Debug\\" > > > /Fd"C://__/CMakeFiles/CMakeTmp/Debug/cm > TryCompileExec.pdb" > > /Gd /TC /analyze- /errorReport:queue testCCompiler.c /Zm1000 TRACKER > > : error TRK0002: Failed to execute command: ""C:\Program Files > > (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe" > > > @C:\Users\\AppData\Local\Temp\tmp9db9bf329c554cb8be447cdb72 > 535c4e.rsp". > > The requested operation requires elevation. > > > [C:\\__\CMakeFiles\CMakeTmp\cmTryCompi > > leExec.vcxproj] > > > > > > Done Building Project > > > "C:\\__\CMakeFiles\CMakeTmp\cmTryCompil > eExec.vcxproj" > > (default targets) -- FAILED. > > > > Build FAILED. > > > > > "C:\\__\CMakeFiles\CMakeTmp\cmTryCompil > eExec.vcxproj" > > (default target) (1) -> > > (ClCompile target) -> > > TRACKER : error TRK0002: Failed to execute command: ""C:\Program > > Files (x86)\Microsoft Visu
Re: [CMake] Unable to create project files with Visual Studio 2010 on Windows 7
The "The requested operation requires elevation." message indicates some sort of permissions problem (admin privileges...) Did you run VS and/or CMake as an admin one time, and then not as an admin a second time...? It should work with either all-non-admin runs or all-admin runs, but you probably can't mix-n-match from run to run. Can you start with a very simple hello world app, in a brand new "empty to start with" directory, and run CMake and VS without admin privileges? Or do you get exactly the same thing if you do that? D On Tue, Jan 6, 2015 at 7:10 PM, wrote: > I have just started using a new Windows 7 host with Visual Studio 2010 > Professional. When I call CMake to generate my project files, I get the > following output in CMakeError.log: > > == > Determining if the C compiler works failed with the following output: > Change Dir: C://__/CMakeFiles/CMakeTmp > > Run Build Command:C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe > cmTryCompileExec.vcxproj /p:Configuration=Debug > Microsoft (R) Build Engine version 4.0.30319.17929 > [Microsoft .NET Framework, version 4.0.30319.18034] > Copyright (C) Microsoft Corporation. All rights reserved. > > Build started 1/6/2015 6:15:19 PM. > Project > "C:\\__\CMakeFiles\CMakeTmp\cmTryCompileExec.vcxproj" > on node 1 (default targets). > InitializeBuildStatus: > Creating "cmTryCompileExec.dir\Debug\cmTryCompileExec.unsuccessfulbuild" > because "AlwaysCreate" was specified. > ClCompile: > C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /Zi > /nologo /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D > "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise > /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec.dir\Debug\\" > /Fd"C://__/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec.pdb" > /Gd /TC /analyze- /errorReport:queue testCCompiler.c /Zm1000 > TRACKER : error TRK0002: Failed to execute command: ""C:\Program Files > (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe" > @C:\Users\\AppData\Local\Temp\tmp9db9bf329c554cb8be447cdb72535c4e.rsp". > The requested operation requires elevation. > [C:\\__\CMakeFiles\CMakeTmp\cmTryCompileExec.vcxproj] > > > Done Building Project > "C:\\__\CMakeFiles\CMakeTmp\cmTryCompileExec.vcxproj" > (default targets) -- FAILED. > > Build FAILED. > > "C:\\__\CMakeFiles\CMakeTmp\cmTryCompileExec.vcxproj" > (default target) (1) -> > (ClCompile target) -> > TRACKER : error TRK0002: Failed to execute command: ""C:\Program Files > (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe" > @C:\Users\\AppData\Local\Temp\tmp9db9bf329c554cb8be447cdb72535c4e.rsp". > The requested operation requires elevation. > [C:\\__\CMakeFiles\CMakeTmp\cmTryCompileExec.vcxproj] > > 0 Warning(s) > 1 Error(s) > > Time Elapsed 00:00:00.10 > == > > The only thing I've changed in the output text is I replaced some > user-specific directory names with underscores or "". > > This project previously built just fine on Windows XP. Moreover, my > coworker, who as far as we can tell set up his Windows 7 host the same way I > did (modulo some things that shouldn't matter, such as I have a copy of > Emacs and he doesn't), is able to build the same project files without > error. > > It may be noteworthy that after this failure, the file > CMakeFiles\CMakeTmp\cmTryCompileExec.vcxproj does not exist, and there are > no files whatsoever in CMakeFiles\CMakeTmp\cmTryCompileExec.dir\Debug. > > I have been trying all kinds of suggestions I have found by looking up the > message "The requested operation requires elevation." I have tried setting > ownership of the directories (it turns out I owned them all along), I have > tried setting access rights (already set to full access), I tried turning > off UAC, and I even tried repairing the installation of Visual Studio 2010. > None of it made any difference. > > I've found some Web sites where some people have complained of problems when > they had installed Visual Studio 2012 and tried to use Visual Studio 2010. > But Visual Studio 2010 is the only version that has been installed on this > host. > > This has had me dead in the water for at least a day, unable to make any > progress on my actual project. Does anyone have any ideas about where to > even begin to look for solutions I haven't already tried? > > David > > > > > -- > > 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/he
[CMake] Unable to create project files with Visual Studio 2010 on Windows 7
I have just started using a new Windows 7 host with Visual Studio 2010 Professional. When I call CMake to generate my project files, I get the following output in CMakeError.log: == Determining if the C compiler works failed with the following output: Change Dir: C://__/CMakeFiles/CMakeTmp Run Build Command:C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe cmTryCompileExec.vcxproj /p:Configuration=Debug Microsoft (R) Build Engine version 4.0.30319.17929 [Microsoft .NET Framework, version 4.0.30319.18034] Copyright (C) Microsoft Corporation. All rights reserved. Build started 1/6/2015 6:15:19 PM. Project "C:\\__\CMakeFiles\CMakeTmp\cmTryCompileExec.vcxproj" on node 1 (default targets). InitializeBuildStatus: Creating "cmTryCompileExec.dir\Debug\cmTryCompileExec.unsuccessfulbuild" because "AlwaysCreate" was specified. ClCompile: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /Zi /nologo /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec.dir\Debug\\" /Fd"C://__/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec.pdb" /Gd /TC /analyze- /errorReport:queue testCCompiler.c /Zm1000 TRACKER : error TRK0002: Failed to execute command: ""C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe" @C:\Users\\AppData\Local\Temp\tmp9db9bf329c554cb8be447cdb72535c4e.rsp". The requested operation requires elevation. [C:\\__\CMakeFiles\CMakeTmp\cmTryCompileExec.vcxproj] Done Building Project "C:\\__\CMakeFiles\CMakeTmp\cmTryCompileExec.vcxproj" (default targets) -- FAILED. Build FAILED. "C:\\__\CMakeFiles\CMakeTmp\cmTryCompileExec.vcxproj" (default target) (1) -> (ClCompile target) -> TRACKER : error TRK0002: Failed to execute command: ""C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe" @C:\Users\\AppData\Local\Temp\tmp9db9bf329c554cb8be447cdb72535c4e.rsp". The requested operation requires elevation. [C:\\__\CMakeFiles\CMakeTmp\cmTryCompileExec.vcxproj] 0 Warning(s) 1 Error(s) Time Elapsed 00:00:00.10 == The only thing I've changed in the output text is I replaced some user-specific directory names with underscores or "". This project previously built just fine on Windows XP. Moreover, my coworker, who as far as we can tell set up his Windows 7 host the same way I did (modulo some things that shouldn't matter, such as I have a copy of Emacs and he doesn't), is able to build the same project files without error. It may be noteworthy that after this failure, the file CMakeFiles\CMakeTmp\cmTryCompileExec.vcxproj does not exist, and there are no files whatsoever in CMakeFiles\CMakeTmp\cmTryCompileExec.dir\Debug. I have been trying all kinds of suggestions I have found by looking up the message "The requested operation requires elevation." I have tried setting ownership of the directories (it turns out I owned them all along), I have tried setting access rights (already set to full access), I tried turning off UAC, and I even tried repairing the installation of Visual Studio 2010. None of it made any difference. I've found some Web sites where some people have complained of problems when they had installed Visual Studio 2012 and tried to use Visual Studio 2010. But Visual Studio 2010 is the only version that has been installed on this host. This has had me dead in the water for at least a day, unable to make any progress on my actual project. Does anyone have any ideas about where to even begin to look for solutions I haven't already tried? David -- 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