我已经在电脑上安装了几年的Eclipse for Java,并决定安装CDT并学习C。我同时安装了MinGW和Cygwin,当我创建新项目时,CDT会检测它们并尝试使用它们。
我选择File > New C++ Project
并选择Hello World C++ Project
和CygwinGCC
工具链。我将项目命名为"asdf",然后点击工具栏中的"Build Debug"。编译器完成时没有错误。我点击运行,但没有任何反应。
手动浏览到项目目录并运行asdf.exe时,出现以下错误:
"The program can't start because cygwin1.dll is missing from your computer. Try reinstalling the program to fix this problem."
使用MinGW也出现相同的问题,只是缺少的dll不同。
我需要做些什么才能得到可用的.exe文件呢?
(我正在运行Windows 7 x64和最新版本的Eclipse和CDT。)
编辑: 编译器输出如下:
**** Build of configuration Debug for project asdf ****
make all
Building file: ../src/asdf.cpp
Invoking: Cygwin C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/asdf.d" -MT"src/asdf.d" -o"src/asdf.o" "../src/asdf.cpp"
cygwin warning:
MS-DOS style path detected: C:\Users\Shawn\Dropbox\eclipse\asdf\Debug
Preferred POSIX equivalent is: /cygdrive/c/Users/Shawn/Dropbox/eclipse/asdf/Debug
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Finished building: ../src/asdf.cpp
Building target: asdf.exe
Invoking: Cygwin C++ Linker
g++ -o"asdf.exe" ./src/asdf.o
Finished building target: asdf.exe
C:\cygwin64\bin
添加到系统路径中呢?我猜你的二进制文件是编译成了64位的。 - phlogratoscygwin1.dll
添加到C:\windows
目录中就可以了。 - ako