如何编译c++ Windows 7 上使用 cygwin 的文件
我已经安装了cygwin。但是,当我尝试编译 C++ 文件时,出现以下错误:
/usr/lib/gcc/i686-pc-cygwin/4.3.4/cc1plus.exe: error while loading shared libraries: cygmpfr-1.dll: cannot open shared object file: No such file or directory
我检查了 lib 文件夹,没有名为 cygmpfr-1.dll 的库。所以我必须把那个dll放在lib文件夹中吗?我尝试搜索该 dll,但找不到该 dll,因此无法下载。我只是 C++ 的初学者。我也尝试在 netbeans 中设置 cygwin 支持,但是如果我尝试运行给定的示例文件,它也会抛出上述错误。
有人可以给我线索吗?
I have installed cygwin. But when I try to compile a c++ file it gives the following error:
/usr/lib/gcc/i686-pc-cygwin/4.3.4/cc1plus.exe: error while loading shared libraries: cygmpfr-1.dll: cannot open shared object file: No such file or directory
I checked in the lib folder there is no library with the name cygmpfr-1.dll
. So is it that I have to put that dll in the lib folder. I have tried to search for the dll but could not find this dll so that i can download. I am just a beginner in C++. I have tried to setup cygwin support in netbeans as well, but there also if I try to run the sample files given, it throws the above error.
Can anybody give me a clue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要通过 http://cygwin.com/setup 安装 gcc4-g++ 软件包。执行程序
您只安装了 gcc4。
这也将安装您缺少的依赖项。
You need to install the gcc4-g++ package via http://cygwin.com/setup.exe
You only have gcc4 installed.
This will also install your missing dependencies.
如果您是 C/C++ 初学者,并且运行的是 Windows,那么为什么不采用简单的方法并获取 Visual-C++ Express,Microsoft 用于 Windows 的免费 IDE。
它提供了一个 GUI IDE(集成开发环境),但如果您更喜欢文本编辑器和命令行工具(编译器、调试器等),如果您安装了 Visual-C++ Express,也可以使用这些工具。
还有教程和课程帮助您入门。
另一方面,如果您真的想专注于 Linux 上的 C++,那么您可能应该立即卸载 Windows 7。
If you're a beginner in C/C++, and you're running Windows, then why not take the simple route and get Visual-C++ Express, a free IDE from Microsoft for Windows.
It provides a GUI IDE (Integrated Development Environment), but if you prefer a text editor and command-line tools (compilers, debuggers, etc) those are available to you also, if you install Visual-C++ Express.
There are also tutorials and lessons to get you started.
On the other hand, if you really wanna focus on C++ on Linux, then you should probably uninstall Windows 7 right now.
我也遇到过类似的问题,而且我不是初学者。尝试使用 cygwin 安装程序,并在其中搜索所有版本的 gmp。一般有32位和64位版本。检查您看到的所有内容并更新您的安装。希望这有帮助。您可以在 Internet 上找到其中一些 dll,但找不到您要查找的那个。
I have had similar problems and I am no beginner. Try using the cygwin installer, and searching it for all versions of gmp. There generally are 32bit and 64 bit versions. Check everything you see and update your installation. Hope this helps. Some of these dll's you can find on the internet, but not the one you are looking for.