CMake-Configure: Permission Denied

回眸只為那壹抹淺笑 提交于 2021-02-10 20:17:17

问题


I am trying to compile my Project with CMake, on one of my Computers it works perfectly (a Linux box), but the other one (Windows 7 Ultimate 64) has really problems.

I have tried multpiple generators:

MinGW (standalone and from CodeBlocks): Error message:

(Just the part that should lead to a solution)

  f:/tools/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe:
  cannot open output file cmTryCompileExec.exe: Permission denied

  collect2: ld returned 1 exit status

Visual Studio 10 Professional Error Message:

(Again only the Part that may be interesting, i have translated it from german)

CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "cl" is not able to compile a simple test program.
[...]
  1>ClCompile:

  1> testCCompiler.c

  1>LINK : fatal error LNK1104: Datei
  "H:\yps_2\VISUAL\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec.exe" could not be opened.

I have Searched google and SO fpr days now and i think no one had some similar Problem like me...

I would be so glad if you could help me guys!

PS: There is another Issue on SO like mine, but it is unanswered: https://stackoverflow.com/questions/7294011/permission-denied-errors-when-using-cmake


回答1:


First make sure you're computer is not infected with viruses: If any viruses modifying EXE files exist, they can be the main cause you can't write to your own EXE files. Scan your computer with an up-to-date antivirus.

Another problem can be your anti-virus trying to block EXE hijacks. If you're sure your computer is clean, try fully disabling your antivirus.

Another solutions that come to my mind are:

  • Try right-clicking on Code Blocks or Visual Studio and choosing Run as Administrator.

  • If you are executing from Command Prompt, make sure you do it in an administrative Command Prompt.

  • Try putting the CMake and other related tools and also the output folder in your C:\ drive. Maybe you don't have quota or rights to access other drives?

  • Try disabling all services you see are useless. Maybe some service has just locked the file without using it for no good reason.

  • Try to dismount your H: volume and mount it again. (Either use diskmgmt.msc or use fsutil volume dismount H: and explore to mount it again)




回答2:


Create the directory

H:\yps_2\VISUAL\CMakeFiles\CMakeTmp\Debug\

and make sure that you have write access.



来源:https://stackoverflow.com/questions/8643069/cmake-configure-permission-denied

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!