为什么g++不起作用
Why is g++ not working?
我正在使用MinGW,每当我试图从命令行运行g++时,我都会收到以下弹出错误:
由于找不到libgmp-10.dll,此应用程序无法启动。重新安装应用程序可能会解决此问题。
我检查了一下,发现MinGW/bin
中实际上有一个名为libgmp-10.dll的文件。起初没有,但我下载了文件并放在那里。MinGW/bin
一定不是放置它的正确位置,因为它仍然表示找不到文件。
那么我该把libgmp-10.dll
放在哪里呢?
更新:这是我的PATH
环境变量:
C:MinGWbin:
/c/Program Files/Vim/vim74:
/c/Program Files/Haskell/bin:
/c/Program Files/Haskell Platform/2013.2.0.0/lib/extralibs/bin:
/c/Program Files/Haskell Platform/2013.2.0.0/bin:
/c/WINDOWS/system32:
/c/WINDOWS:
/c/WINDOWS/System32/Wbem:
/c/Program Files/QuickTime/QTSystem/:
/c/Program Files/TortoiseHg/:
/c/Program Files/Haskell Platform/2013.2.0.0/mingw/bin:
/c/Program Files/nodejs/:
/c/sbcl:
/c/emacs/bin:
/c/Documents and Settings/[my name]/Application Data/cabal/bin:
/c/Documents and Settings/[my name]/Application Data/npm:
.f
这是MinGW
:的内容
/MinGW
/bin
/include
/libexec
/msys
/var
/doc
/lib
/mingw32
/share
这在MinGW/bin
:内部
aclocal autoreconf-2.68 ld.exe msgcat.exe
aclocal-1.10 autoscan libcharset-1.dll msgcmp.exe
aclocal-1.11 autoscan-2.13 libexpat-1.dll msgcomm.exe
aclocal-1.4 autoscan-2.68 libgcc_s_dw2-1.dll msgconv.exe
aclocal-1.5 autoupdate libgettextlib-0-18-3.dll msgen.exe
aclocal-1.6 autoupdate-2.13 libgettextpo-0.dll msgexec.exe
aclocal-1.7 autoupdate-2.68 libgettextsrc-0-18-3.dll msgfilter.exe
aclocal-1.8 c++.exe libgmp-10.dll msgfmt.exe
aclocal-1.9 c++filt.exe libgmpxx-4.dll msggrep.exe
addr2line.exe cc.exe libgomp-1.dll msginit.exe
ar.exe cpp.exe libiconv-2.dll msgmerge.exe
as.exe dlltool.exe libintl-8.dll msgunfmt.exe
autoconf dllwrap.exe libltdl-7.dll msguniq.exe
autoconf-2.13 elfedit.exe libmpc-3.dll ngettext.exe
autoconf-2.68 envsubst.exe libmpfr-4.dll nm.exe
autoheader g++.exe libquadmath-0.dll objcopy.exe
autoheader-2.13 gcc-ar.exe libssp-0.dll objdump.exe
autoheader-2.68 gcc-nm.exe libstdc++-6.dll pthreadGC2.dll
autom4te gcc-ranlib.exe libtool pthreadGCE2.dll
autom4te-2.68 gcc.exe libtoolize ranlib.exe
automake gcov.exe mingw-get.exe readelf.exe
automake-1.10 gdb.exe mingw32-c++.exe recode-sr-latin.exe
automake-1.11 gdbserver.exe mingw32-cc.exe size.exe
automake-1.4 gettext.exe mingw32-g++.exe strings.exe
automake-1.5 gettext.sh mingw32-gcc-4.8.1.exe strip.exe
automake-1.6 gettextize mingw32-gcc-ar.exe windmc.exe
automake-1.7 gprof.exe mingw32-gcc-nm.exe windres.exe
automake-1.8 iconv.exe mingw32-gcc-ranlib.exe xgettext.exe
automake-1.9 ifnames mingw32-gcc.exe zlib1.dll
autopoint ifnames-2.13 mingw32-make.exe
autoreconf ifnames-2.68 mingwm10.dll
autoreconf-2.13 ld.bfd.exe msgattrib.exe
您需要将它放在PATH
环境变量中的某个位置。尝试将它(或它的快捷方式)粘贴到与编译的可执行文件相同的目录中。
注意:libgmp由g++使用,而不是编译后的可执行文件。g++需要在PATH
或当前工作目录中的某个位置找到libgmp。将它放在这两个位置中的一个位置,编译器就会工作。
更新:您缺少几个DLL,这被称为"DLL地狱"。唯一真正的方法是按照说明进行彻底的重新安装。
相关文章:
- 我的神经网络不起作用 [XOR 问题]
- 在C++程序中输入的文本文件将不起作用,除非文本被复制和粘贴
- C++映射:具有自定义类的运算符[]不起作用(总是返回0)
- C++为什么尽管我调用了void函数,它却不起作用
- 为什么在保护模式下继承升级不起作用
- 循环在计数器中不起作用
- 在其他文件中创建类时在 c++ 项目中不起作用
- Visual studio代码重构似乎不起作用(例如,重命名符号-f2)
- 为什么二进制搜索在我的测试中不起作用
- 我的代码中有错误吗?使用BGI图形的C++代码对我不起作用
- 为什么 const std::p air<K,V>& 在 std::map 上基于范围的 for 循环不起作用?
- 带有指定长度字符* 参数的 std::regex_search 在 VS2017 中不起作用?
- Bjarne Stroustrup Book - std_lib_facilities.h - 不起作用(未知类型名称)
- 为什么简单的算术减法在"if"条件下不起作用?
- 为什么Stroustup书中的has_f不起作用
- 你能检查一下为什么在这个代码中从链接列表中删除项目不起作用吗
- 嵌套While循环不起作用(C++问题)
- C++Matching Brackets 2解决方案不起作用
- 为什么这段代码不起作用,我该如何解决?
- 我正在开发服务器,ip作为参数传递不起作用