Dev C++编译错误,权限被拒绝

you*_*ali 6 c++ compilation dev-c++

我想使用dev c ++编译器编译代码程序,但我的编译器没有编译我的代码.程序包含两个文件,一个是头文件,另一个是实现.cpp文件.我想编译的代码是正确和有效的,但它没有在我的电脑上编译(Windows 7)请帮忙

我得到的错误是

  Permission denied 
  ld returned 1 exit status 
  C:\Makefile.win [Build Error]  [Project1.exe] Error 1 
Run Code Online (Sandbox Code Playgroud)

这是我的编译日志

Compiler: Default compiler
Building Makefile: "C:\Makefile.win"
Executing  make...
make.exe -f "C:\Makefile.win" all
g++.exe -c testProgDoublyLinkedList.cpp -o testProgDoublyLinkedList.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"C:/Dev-Cpp/include/c++/3.4.2/backward"  -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"C:/Dev-Cpp/include/c++/3.4.2"  -I"C:/Dev-Cpp/include"   

g++.exe testProgDoublyLinkedList.o  -o "Project1.exe" -L"C:/Dev-Cpp/lib" -mwindows  

C:\Dev-Cpp\Bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot open output file Project1.exe: Permission denied
collect2: ld returned 1 exit status

make.exe: *** [Project1.exe] Error 1

Execution terminated
Run Code Online (Sandbox Code Playgroud)

小智 5

尝试运行任务管理器以确定程序是否仍在运行。

如果它终止了,那是因为这就是您的编译器给您一个错误的原因。


Jon*_*Jon 4

Windows 7 不允许您直接写入根目录c:\(以及其他位置),除非从以管理员权限运行的进程内进行写入。

对您来说最简单的解决方法是将项目从c:\另一个目录移动 - 例如,c:\projects将起作用。