在 MinGW/MSYS 上进行 make install 不喜欢 --prefix=/mingw
我已经开始使用 MinGW/MSYS 尝试在 Windows 上使用一些 Linux 库。 使用
./configure --prefix=/mingw
make
make install
到目前为止, 效果很好,但我有两个不同的库在“make install”和“ln -s”调用上失败。它是这样的:
rm -f /mingw/lib/libvamp-sdk.so.2
ln -s libvamp-sdk.so.2.0.0 /mingw/lib/libvamp-sdk.so.2
ln: creating symbolic link `/mingw/lib/libvamp-sdk.so.2' to `libvamp-sdk.so.2.0.0': No such file or directory
make: *** [install] Error 1
首先,makefile 的目的是什么? /mingw/lib/libvamp-sdk.so.2.0.0 存在, 因此,将上面的 'ln -s' 调用替换为
ln -s /mingw/lib/libvamp-sdk.so.2.0.0 /mingw/lib/libvamp-sdk.so.2
将会起作用,但我不确定这是否是作者的意图。
更重要的是,为什么会发生这种情况(我猜它在本机 Linux 系统上工作得很好)以及解决它的最简单方法是什么?我可以手动编辑 makefile,但我想知道是否有更好的解决方案。
非常感谢您的投入!
I've begun using MinGW/MSYS in an attempt to use some Linux libraries on Windows. Using
./configure --prefix=/mingw
make
make install
has worked well so far, but I've had two different libraries fail on 'make install', on an 'ln -s' call. It goes something like this:
rm -f /mingw/lib/libvamp-sdk.so.2
ln -s libvamp-sdk.so.2.0.0 /mingw/lib/libvamp-sdk.so.2
ln: creating symbolic link `/mingw/lib/libvamp-sdk.so.2' to `libvamp-sdk.so.2.0.0': No such file or directory
make: *** [install] Error 1
First of all, what is the intention of the makefile? /mingw/lib/libvamp-sdk.so.2.0.0 exists,
so replacing the above 'ln -s' call with
ln -s /mingw/lib/libvamp-sdk.so.2.0.0 /mingw/lib/libvamp-sdk.so.2
will work, but I'm not sure if this is what the author had intended.
More importantly, why does this occur (I'm guessing it works fine on native Linux systems) and what's the easiest way to get around it? I could manually edit the makefile but I'm wondering if there's a better solution to this.
Many thanks for your input!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的构建配置错误:
*.so
文件适用于 Linux,不适用于 Windows。您很可能需要在配置调用中添加像--host=i686-pc-mingw32
这样的选项。You misconfigured your build:
*.so
files are for Linux, not Windows. You'll most likely need to add an option like--host=i686-pc-mingw32
to your configure invocation.在 Linux 系统上,未修改的
ln -s libvamp-sdk.so.2.0.0 /mingw/lib/libvamp-sdk.so.2
创建一个相对符号链接,以使 libvamp-sdk.so.2.0.0 可用于以下程序:链接到该库的早期或后期实例。然而,这仅在构建基于 .so 的系统时才有意义。
对于 mingw 构建,这些行根本没有必要,因为您构建 DLL 而不是共享库,并且机制不同。这两行可以安全地从 Makefile 中删除,只需确保 DLL 和库(libfoo.a 和 libfoo.dll.a)已安装,前者位于/mingw/bin 和 /mingw/lib 中的后者。您可能需要为此修改 Makefile。
On linux systems, the unmodified
ln -s libvamp-sdk.so.2.0.0 /mingw/lib/libvamp-sdk.so.2
creates a relative symlink to make libvamp-sdk.so.2.0.0 available for programs which were linked to earlier or later instances of the library. However, this only makes sense when buildingfor .so-based systems.
For mingw builds, these lines are simply unnecessary because you build DLLs instead of shared libraries and the mechanism is different. These two lines can safely be deleted from the Makefile, just make sure the DLL and the libraries (libfoo.a and libfoo.dll.a) are installed, the former in /mingw/bin and the latter in /mingw/lib. You probably need to modify the Makefile for that.