我已经在我的电脑上使用了Eclipse for Java了几年,并决定安装CDT并学习C.我安装了两个MinGW Cygwin和CDT在我制作新项目时会检测并尝试使用它们。我选择File> New C++ Project并选择Hello World C++ Project和CygwinGCC工具链。我将该项目命名为“asdf”,并在工具栏中点击“Build Debug”。编译器完成而没有错误。我打了Run,没有任何反应。手动浏览到项目目录并运行asdf.exe会给我一个错误:“程序无法启动,因为cygwin1.dll从您的计算机中丢失,请尝试重新安装程序以解决此问题。”使用MinGW发生同样的事情,只有一个不同的dll丢失。我需要做些什么才能拥有可用的.exe?我正在运行Windows 7 x64以及最新版本的Eclipse和CDT。该程序无法启动,因为cygwin1.dll丢失......在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
它的工作!它也需要更多的dll。所以我假设唯一的方法是使用VisualStudio,然后呢? –
我应该补充的是,您可以将DLL复制到与exe相同的目录中。通常由VisualStudio构建的exes也具有相关性,例如,到MSVCR71.DLL – phlogratos
好吧,有道理,谢谢! –