程序无法启动,因为cygwin1.dll在Eclipse CDT中缺少... [英] The program can't start because cygwin1.dll is missing... in Eclipse CDT
问题描述
编辑:
编译器输出如下:
****构建配置项目调试asdf ****
使所有
构建文件:../src/asdf.cpp
调用:Cygwin C ++编译器
g ++ -O0 -g3 -Wall -c -fmessage-length = 0 -MMD -MP -MFsrc / asdf.d -MTsrc / asdf.d-osrc / asdf.o../src/asdf.cpp
cygwin警告:
检测到MS-DOS样式路径:C:\ Users \Shawn\Dropbox\eclipse\asdf\Debug
首选的POSIX等价物是:/ cygdrive / c / Users / Shawn / Dropbox / eclipse / asdf / Debug
CYGWIN环境变量选项 nodosfilewarning关闭此警告。
有关POSIX路径的详细信息,请参阅用户指南:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
完成建筑:../ src / asdf.cpp
构建目标:asdf.exe
调用:Cygwin C ++链接器
g ++ -oasdf.exe./src/asdf.o
完成建筑目标:asdf.exe
此错误消息意味着Windows无法找到cygwin1.dll。 Cygwin gcc创建的程序取决于此DLL。该文件是cygwin的一部分,所以很可能它位于C:\cygwin\bin。要解决这个问题,你需要做的是将C:\cygwin\bin(或者可以找到cygwin1.dll的位置)添加到你的系统路径。或者,您可以将cygwin1.dll复制到Windows目录中。
有一个很好的工具叫做依赖性Walker ,您可以从 http://www.dependencywalker.com 。您可以使用它来检查可执行文件的依赖性,因此,如果您检查生成的程序,它会告诉您哪些依赖关系丢失,哪些被解决。
I've had Eclipse for Java on my computer for a few years, and decided to install the CDT and learn C. I installed both MinGW and Cygwin and the CDT detects and tries to use them when I make a new project. I choose File>New C++ Project and choose Hello World C++ Project and the CygwinGCC toolchain. I name the project "asdf" and hit "Build Debug" in the toolbar. The compiler completes without error. I hit Run and nothing happens. Browsing to the project directory manually and running asdf.exe gives me an error saying "The program can't start because cygwin1.dll is missing from your computer. Try reinstalling the program to fix this problem." The same thing happens using MinGW, only a different dll is missing. What do I need to do to have a usable .exe? I'm running Windows 7 x64 and the newest version of Eclipse and the CDT.
EDIT: The compiler output is as follows:
**** 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
This error message means that Windows isn't able to find "cygwin1.dll". The Programs that the Cygwin gcc create depend on this DLL. The file is part of cygwin , so most likely it's located in C:\cygwin\bin. To fix the problem all you have to do is add C:\cygwin\bin (or the location where cygwin1.dll can be found) to your system path. Alternatively you can copy cygwin1.dll into your Windows directory.
There is a nice tool called DependencyWalker that you can download from http://www.dependencywalker.com . You can use it to check dependencies of executables, so if you inspect your generated program it tells you which dependencies are missing and which are resolved.
这篇关于程序无法启动,因为cygwin1.dll在Eclipse CDT中缺少...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!