2014-09-24 58 views
-1

我使用MinGW的,每當我試圖運行G ++命令行我得到這個彈出錯誤:爲什麼g ++不起作用?

This application has failed to start because libgmp-10.dll was not found. Re-installing the application may fix this problem.

我檢查,我發現,其實也有一個文件中命名libgmp-10.dll內MinGW/bin。起初沒有,但我下載了文件並將它放在那裏。 MinGW/bin一定不是放置它的正確位置,因爲它仍然表示找不到該文件。

那麼我在哪裏放置libgmp-10.dll

更新:這是我PATH環境變量:

C:\MinGW\bin: 
/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 

回答

1

您需要至將它放置在您的環境變量PATH的某處。嘗試將它粘貼到(或其快捷方式)與編譯的可執行文件相同的目錄中。

注意:libgmp由g ++使用,而不是您的編譯可執行文件。 g ++需要在PATH或當前工作目錄中的某處找到libgmp。把它放在這兩個地方之一,編譯器將工作。

更新:您錯過了幾個DLL,這被稱爲「DLL地獄」。解決這個問題的唯一方法是遵循指示並完成重新安裝。

+0

我必須爲我製作的每個節目做到這一點嗎? – 2014-09-24 22:47:52

+0

_「我必須爲我製作的每個程序都這樣做嗎?」_不,您可以設置PATH來在系統範圍內查找特定的共享庫安裝。 – 2014-09-24 22:49:40

+0

@templateboy查看我的編輯進行澄清。 – randomusername 2014-09-24 22:51:44