错误使GMP - 未定义参考

时间:2017-02-13 11:16:45

标签: mingw undefined-reference gmp

我正在使用C ++开发一个项目,我需要使用GMP。我安装了MinGW 6.1.0。从MSYS,我试过:

./ configure --prefix = C:\ gmp --enable-cxx

进行检查

然后我收到以下错误:

make[5]: Leaving directory `/C/Users/Admin/Downloads/gmp-6.1.2.tar/gmp-6.1.2/tests/misc'

make [4]:离开目录/C/Users/Admin/Downloads/gmp-6.1.2.tar/gmp-6.1.2/tests/misc' make[3]: Leaving directory / C / Users / Admin / Downloads / gmp-6.1.2.tar / gmp-6.1.2 / tests / misc' 在cxx办理登机手续 make [3]:进入目录/C/Users/Admin/Downloads/gmp-6.1.2.tar/gmp-6.1.2/tests/cxx' make t-binary.exe t-cast.exe t-cxx11.exe t-headers.exe t-iostream.exe t-istream.exe t-locale.exe t-misc.exe t-mix.exe t-ops.exe t-ops2.exe t-ops3.exe t-ostream.exe t-prec.exe t-ternary.exe t-unary.exe t-do-exceptions-work-at-all-with-this-compiler.exe t-assign.exe t-constr.exe t-rand.exe make[4]: Entering directory / C / Users / Admin / Downloads / gmp-6.1.2.tar / gmp-6.1.2 / tests / cxx' make [4]:t-binary.exe' is up to date. make[4]: t-cast.exe'是最新的。 make [4]:t-cxx11.exe' is up to date. make[4]: t-headers.exe'是最新的。 make [4]:t-iostream.exe' is up to date. make[4]: t-istream.exe'是最新的。 make [4]:t-locale.exe' is up to date. make[4]: t-misc.exe'是最新的。 make [4]:t-mix.exe' is up to date. make[4]: t-ops.exe'是最新的。 / bin / sh ../../libtool --tag = CXX --mode = link /mingw/bin/g++.exe -DWINVER = 0x0501 -D_WIN32_WINNT = 0x0501 -D_WIN32_IE = 0x0501 -O2 -pipe -mms-bitfields - fno-builtin -march = i686 -mtune = i686 -L / mingw / lib -Wl, - no-undefined -Wl, - export-all-symbols -o t-ops2.exe t-ops2.o -L。 ./../.libs ../../tests/libtests.la ../../libgmpxx.la ../../libgmp.la -lm libtool:link:/mingw/bin/g++.exe -DWINVER = 0x0501 -D_WIN32_WINNT = 0x0501 -D_WIN32_IE = 0x0501 -O2 -pipe -mms-bitfields -fno-builtin -march = i686 -mtune = i686 -Wl, - no -undefined -Wl, - export-all-symbols -o t-ops2.exe t-ops2.o -L / mingw / lib -L ​​../../。libs ../../tests/.libs /libtests.a ../../.libs/libgmpxx.a /c/Users/Admin/Downloads/gmp-6.1.2.tar/gmp-6.1.2/.libs/libgmp.a ../ .. /.libs/libgmp.a ../../tests/.libs/libtests.a(misc.o):misc.c:(.text+0x93):对_impure_ptr' ../../tests/.libs/libtests.a(misc.o):misc.c:(.text+0x140): undefined reference to _ impure_ptr'的未定义引用 ../../tests/.libs/libtests.a(misc.o):misc.c:(.text+0x158):对_impure_ptr' ../../tests/.libs/libtests.a(misc.o):misc.c:(.text+0x180): undefined reference to _ impure_ptr'的未定义引用 ../../tests/.libs/libtests.a(misc.o):misc.c:(.text+0x1a8):对_impure_ptr' ../../tests/.libs/libtests.a(misc.o):misc.c:(.text+0x1c4): more undefined references to _ impure_ptr'的未定义引用关注 ../../tests/.libs/libtests.a(misc.o):misc.c :(。text + 0x316):对_imp___ctype_' ../../tests/.libs/libtests.a(misc.o):misc.c:(.text+0x4e8): undefined reference to _ impure_ptr'的未定义引用 ../../tests/.libs/libtests.a(misc.o):misc.c :(。text + 0x510):对_impure_ptr' ../../tests/.libs/libtests.a(misc.o):misc.c:(.text+0x52c): undefined reference to _ impure_ptr'的未定义引用 ../../tests/.libs/libtests.a(misc.o):misc.c :(。text + 0x588):对_impure_ptr' ../../tests/.libs/libtests.a(misc.o):misc.c:(.text+0x5b0): undefined reference to _ impure_ptr'的未定义引用 ../../tests/.libs/libtests.a(misc.o):misc.c:(.text+0x5cc):对_impure_ptr' follow c:/Users/Admin/Downloads/gmp-6.1.2.tar/gmp-6.1.2/.libs/libgmp.a(set_str.o):set_str.c:(.text+0x2c): undefined reference to _ imp___ctype_'的更多未定义引用 c:/Users/Admin/Downloads/gmp-6.1.2.tar/gmp-6.1.2/.libs/libgmp.a(set_str.o):set_str.c :(。text + 0x164):对{的未定义引用{1}} _ impure_ptr” c:/Users/Admin/Downloads/gmp-6.1.2.tar/gmp-6.1.2/.libs/libgmp.a(lt43-set_str.o):set_str.c :(。text + 0x31):undefined reference到_imp___ctype_' c:/Users/Admin/Downloads/gmp-6.1.2.tar/gmp-6.1.2/.libs/libgmp.a(realloc.o):realloc.c:(.text+0x68): undefined reference to _ imp___ctype_' collect2.exe:错误:ld返回1退出状态 make [4]: * [t-ops2.exe]错误1 make [4]:离开目录_imp___ctype_' c:/Users/Admin/Downloads/gmp-6.1.2.tar/gmp-6.1.2/.libs/libgmp.a(lt43-set_str.o):set_str.c:(.text+0x153): undefined reference to / C / Users / Admin / Downloads / gmp-6.1.2.tar / gmp-6.1.2 / tests / cxx' make [2]:* [check-recursive]错误1 make [2]:离开目录/C/Users/Admin/Downloads/gmp-6.1.2.tar/gmp-6.1.2/tests/cxx' make[3]: *** [check-am] Error 2 make[3]: Leaving directory / C / Users / Admin / Downloads / gmp-6.1.2.tar / gmp-6.1.2' make:*** [check]错误2

关于如何解决这个问题的任何想法?

编辑:我下载的GMP版本是GMP 6.1.2

0 个答案:

没有答案