gpt4 book ai didi

linux - 如何引导编译器使用某个库?

转载 作者:太空宇宙 更新时间:2023-11-04 11:11:02 26 4
gpt4 key购买 nike

我正在尝试根据本指南编译 skeltrack http://tayyabnaseer.blogspot.com.tr/2012/05/installing-skeltrack-on-ubuntu.html

我成功编译并安装了前两个库。然而,当涉及到 skeltrack 时,我得到以下编译错误:

CCLD     test-skeleton
/usr/bin/ld: test-skeleton.o: undefined reference to symbol 'g_file_read'
/usr/lib/i386-linux-gnu/libgio-2.0.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

我在 Ubuntu 13.10 32 位平台上。我在网上搜索错误,得出的结论是我的 glib 2.32 不包含该函数。我成功编译并安装了 glib 2.38。但是链接器正在寻找旧的 glib 2.32 库。这是我电脑中的 libgio 库:

 locate libgio-2.0.so.0
/home/****/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
/home/****/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.3200.3
/home/****/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libgio-2.0.so.0
/home/****/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libgio-2.0.so.0.3200.3
/home/****/Downloads/ubuntu-core-13.04-core-i386/usr/lib/i386-linux-gnu/libgio-2.0.so.0
/home/****/Downloads/ubuntu-core-13.04-core-i386/usr/lib/i386-linux-gnu/libgio-2.0.so.0.3600.0
/home/****/install/lib/libgio-2.0.so.0
/home/****/install/lib/libgio-2.0.so.0.3800.2
/usr/lib/i386-linux-gnu/libgio-2.0.so.0
/usr/lib/i386-linux-gnu/libgio-2.0.so.0.3800.1
/usr/local/lib/libgio-2.0.so.0
/usr/local/lib/libgio-2.0.so.0.3600.0
/usr/local/lib/libgio-2.0.so.0.3800.2

我如何告诉链接器使用它正在寻找的正确 libgio?

最佳答案

在查看以下网络链接后,我想出了如何链接特定库的方法:

具体来说,将 LDFLAGS 设置为,

LDFLAGS='-l:/usr/local/lib/libgio-2.0.so.0.3800.2 -l:/usr/local/lib/libgobject-2.0.so.0.3800.2 -l:/usr/local/lib/libglib-2.0.so.0.3800.2' ./configure

成功了。

关于linux - 如何引导编译器使用某个库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23174207/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com