Libtool因路径包含空格而抛出错误。

huangapple go评论63阅读模式
英文:

Libtool throws error because of path with space

问题

我正在尝试在我的Windows PC上为C++安装gmp,但到目前为止遇到了许多困难。我使用msys2来安装gmp,我已经下载了它。在运行"./configure"和"make"之后,我尝试运行"make check",但出现了以下错误:

$ make check
make check-recursive
make[1]: 进入目录'/c/Users/Martin Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1'
在tests目录中进行检查
make[2]: 进入目录'/c/Users/Martin Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1/tests'
在当前目录中进行检查
make[3]: 进入目录'/c/Users/Martin Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1/tests'
生成 libtests.la t-bswap.exe t-constants.exe t-count_zeros.exe t-hightomask.exe t-modlinv.exe t-popc.exe t-parity.exe t-sub.exe
make[4]: 进入目录'/c/Users/Martin Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1/tests'
make[4]: 'libtests.la' 已经是最新的。
/bin/sh ../libtool --tag=CC --mode=link gcc -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -no-install -o t-bswap.exe t-bswap.o libtests.la ../libgmp.la
libtool: 警告: '-no-install' 在 x86_64-w64-mingw32 中被忽略
libtool: 警告: 假定 '-no-fast-install' 代替
libtool: 错误: 无法找到库 'Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1/libgmp.la' 或未处理的参数 'Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1/libgmp.la'
make[4]: *** [Makefile:765: t-bswap.exe] 错误 1
make[4]: 离开目录'/c/Users/Martin Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1/tests'
make[3]: *** [Makefile:1183: check-am] 错误 2
make[3]: 离开目录'/c/Users/Martin Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1/tests'
make[2]: *** [Makefile:823: check-recursive] 错误 1
make[2]: 离开目录'/c/Users/Martin Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1/tests'
make[1]: *** [Makefile:997: check-recursive] 错误 1
make[1]: 离开目录'/c/Users/Martin Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1'
make: *** [Makefile:1289: check] 错误 2

请注意,错误中的路径是'Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1/libgmp.la'。因此,我的理论是由于路径中包含空格,所以存在问题。这可能是错误的起源吗?是否有修复方法或更好的方法来实现我正在尝试的目标?

英文:

I'm trying to install gmp for c++ on my windows pc, but I encountered many hardships so far. I use msys2 to install gmp, which I downloaded. After "./configure" and "make", I tried to run "make check", but got

$ make check
make  check-recursive
make[1]: Entering directory '/c/Users/Martin Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1'
Making check in tests
make[2]: Entering directory '/c/Users/Martin Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1/tests'
Making check in .
make[3]: Entering directory '/c/Users/Martin Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1/tests'
make  libtests.la t-bswap.exe t-constants.exe t-count_zeros.exe t-hightomask.exe t-modlinv.exe t-popc.exe t-parity.exe t-sub.exe
make[4]: Entering directory '/c/Users/Martin Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1/tests'
make[4]: 'libtests.la' is up to date.
/bin/sh ../libtool  --tag=CC   --mode=link gcc  -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -no-install  -o t-bswap.exe t-bswap.o libtests.la ../libgmp.la
libtool: warning: '-no-install' is ignored for x86_64-w64-mingw32
libtool: warning: assuming '-no-fast-install' instead
libtool:   error: cannot find the library 'Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1/libgmp.la' or unhandled argument 'Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1/libgmp.la'
make[4]: *** [Makefile:765: t-bswap.exe] Error 1
make[4]: Leaving directory '/c/Users/Martin Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1/tests'
make[3]: *** [Makefile:1183: check-am] Error 2
make[3]: Leaving directory '/c/Users/Martin Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1/tests'
make[2]: *** [Makefile:823: check-recursive] Error 1
make[2]: Leaving directory '/c/Users/Martin Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1/tests'
make[1]: *** [Makefile:997: check-recursive] Error 1
make[1]: Leaving directory '/c/Users/Martin Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1'
make: *** [Makefile:1289: check] Error 2

Notice, that the path in the error is 'Clever/Desktop/Daten/C++/Privat/RecSolver/gmp-6.2.1/libgmp.la'. So my theory is that there is a problem because the path has a space. Could this be the origin of the error? Is there a fix or a better way for achieving what I am trying to do?

答案1

得分: 0

有一种更简单/更不容易出错的方法:
只需在msys2 MINGW64中运行"pacman -S mingw-w64-x86_64-gmp",无需下载gmp库。

英文:

There is an easier/less error-prone way:
Just run "pacman -S mingw-w64-x86_64-gmp" with msys2 MINGW64 - No need to download the gmp library.

huangapple
  • 本文由 发表于 2023年5月28日 19:51:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/76351340.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定