【发布时间】:2012-05-14 21:23:14
【问题描述】:
我想使用 dev c++ 编译器编译代码程序,但我的编译器没有编译我的代码。该程序由两个文件组成,一个是头文件,另一个是实现 .cpp 文件。 我要编译的代码是正确的并且可以工作,但它没有在我的电脑上编译(windows 7) 请帮忙
我得到的错误是
Permission denied
ld returned 1 exit status
C:\Makefile.win [Build Error] [Project1.exe] Error 1
这是我的编译日志
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
【问题讨论】:
-
你的操作系统是什么?您似乎有权限问题。
-
可能你上次打开的执行窗口还没有关闭,所以
ld.exe文件还在使用,所以不允许访问! -
不要使用 Dev-C++,它已经过时了。请改用 Code::Blocks。
-
不要使用 Dev-C++,它已经过时了。请改用 Visual Studio Express(如果您是学生,则使用更高版本)。
-
Griwes 所说的,除了我倾向于建议学生将 Linux 风格放在 USB 记忆棒上,然后学习使用 GCC 并编写自己的 makefile 来开始。在你走路之前学会爬行:)
标签: c++ compilation dev-c++