简体   繁体   English

cygwin1.dll丢失-无法运行程序

[英]cygwin1.dll is missing - Cannot run program

I wrote a program in C/C++ and compiled it using Cygwin. 我用C / C ++编写了一个程序,并使用Cygwin对其进行了编译。 When I ran the compiled file, I receive an error about a missing library. 运行编译的文件时,收到有关缺少库的错误。

Cygwin is like a simple framework: With every program you build you have to include the library cygwin1.dll . Cygwin就像一个简单的框架:在构建的每个程序中,您都必须包含cygwin1.dll库。

Important note : Downloading the library online might be risky as it can be a virus. 重要说明 :在线下载该库可能有风险,因为它可能是病毒。


To fix the issue: 要解决此问题:
1. Go to your cygwin directory. 1. 转到您的cygwin目录。 Usually that is C:\\cygwin or C:\\cygwin64 . 通常是C:\\cygwinC:\\cygwin64 If you don't know where cygwin is, download the setup file and run it. 如果您不知道cygwin在哪里,请下载安装文件并运行它。 The installation path the installer suggests is the Cygwin installation location. 安装程序建议的安装路径是Cygwin的安装位置。

Tip: Don't use a directory to put cygwin in that includes spaces (" ") as it will be easier to run programs with command-line parameters. 提示:不要使用包含空格(“”)的目录将cygwin放入其中,因为使用命令行参数运行程序会更容易。

2. Copy the file. 2. 复制文件。 It should be in <Drive>:\\cygwin\\bin\\cygwin1.dll . 它应该在<Drive>:\\cygwin\\bin\\cygwin1.dll

3. Copy the file to your program folder , the same directory as your exe file. 3. 将文件复制到您的exe文件夹所在的程序文件夹中

Your program should run without throwing an exception. 您的程序应运行而不会引发异常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM