所以之后我跑的libtool,并得到了libfoo.lo和foo.o从我的库源文件,我怎么转换libfoo.lo文件转换成一个正常的Linux共享库,就像libfoo.so.1.0.0这样我可以在我的目标系统上安装并链接到它?
我目前正在构建一个应用,并在链接时出错,这是一条命令,
CCLD Programs/GtkBonker
Run Code Online (Sandbox Code Playgroud)
现在,我想查看“ 完整的链接命令”,感谢您的帮助。
PS。
我正在使用带有c ++编程语言和Ubuntu 10.04的GNU Build System。
我正在接管一个项目,我在subversion存储库中看到一些属于libtool和automake分发的文件,例如config.guess,depcomp或ltmain.sh.我认为这是完全错误的,因为当我检查时,我应该在我的机器上安装autotools并执行autoreconf.
你怎么看 ?我错过了在存储库中存储这些文件的意义吗?
当一些项目拥有所有"ltmain","aclocal.m4"和其他"autogen.sh"时,会带来不适:
./autogen.sh是慢的../configure是慢的../configure失败抱怨错过了一些东西.我解决了它,它抱怨接下来的事情.慢.configure.ac通常都很大而且难以理解..deps或者.libs或者其他什么.它的每个问题都会给{auto,lib}工具增加越来越多的仇恨点.
如何与这些东西相处得好?是否有一个简短的教程(不是很长的"GNU Build System简介"或者它是如何调用的)以及如何创建,修复和调试这些东西的全面参考?
我正在调用lt_dlopen并收到一个通用文件未找到错误(翻译的 errno 文本)。我如何获得有关实际失败的更多信息,因为该文件肯定存在。
这是一个加载 C++ 库的 C++ 程序。在同一个程序的其他地方,我使用相同的命令打开其他库没有问题,因此我担心它可能是这个库特有的。我已经使用过ldd并且满足了库的所有依赖项。
我已经下载了一些旧项目的源代码。我现在正在尝试构建它:
./bootstrap && ./configure
Run Code Online (Sandbox Code Playgroud)
它工作正常,但是:
make
/bin/sh ../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -W -g -O2 -DDEBUG -MT rcclexer.lo -MD -MP -MF .deps/rcclexer.Tpo -c -o rcclexer.lo rcclexer.cpp
../libtool: line 415: CDPATH: command not found
libtool: Version mismatch error. This is libtool 2.4.2, but the
libtool: definition of this LT_INIT comes from an older release.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4.2
libtool: and run autoconf again.
Run Code Online (Sandbox Code Playgroud)
ps那个小项目页面:http : //sourceforge.net/projects/rccparser/
有什么帮助吗?
错误信息如下:
./libtool: line 1129: X-I.: command not found
./libtool: line 1129: X-DLT_CONFIG_H=<config.h>: command not found
./libtool: line 1129: X-DLTDL: command not found
./libtool: line 1129: X-I.: command not found
./libtool: line 1129: X-I.: command not found
./libtool: line 1129: X-Ilibltdl: command not found
./libtool: line 1129: X-I./libltdl: No such file or directory
./libtool: line 1129: X-I./libltdl: No such file or directory
./libtool: line 1129: X-g: command not found
./libtool: line 1129: X-O2: command not found
./libtool: line 1129: X-MT: command …Run Code Online (Sandbox Code Playgroud) libtool不会通过Homebrew 和 MacPorts(RVM需要)安装在我的Mac上.
这是详细的输出,它永远挂起,运行OS X 10.9和Xcode 4.3
libtool: link: ( cd "libltdl/.libs" && rm -f "dlopen.la" && ln -s "../dlopen.la" "dlopen.la" )
/bin/sh ./libtool --tag=CC --mode=link cc -g -O2 -no-undefined -version-info 10:0:3 -dlpreopen libltdl/dlopen.la -o libltdl/libltdl.la -rpath /usr/local/Cellar/libtool/2.4.2/lib libltdl/loaders/libltdl_libltdl_la-preopen.lo libltdl/libltdl_libltdl_la-lt__alloc.lo libltdl/libltdl_libltdl_la-lt_dlloader.lo libltdl/libltdl_libltdl_la-lt_error.lo libltdl/libltdl_libltdl_la-ltdl.lo libltdl/libltdl_libltdl_la-slist.lo libltdl/argz.lo
libtool: link: rm -f libltdl/.libs/libltdl.nm libltdl/.libs/libltdl.nmS libltdl/.libs/libltdl.nmT
libtool: link: (cd libltdl/.libs && cc -g -O2 -c -fno-builtin -fno-rtti -fno-exceptions -fno-common -DPIC "libltdlS.c")
brew: superenv removed: -g -O2
libtool: link: rm -f "libltdl/.libs/libltdlS.c" "libltdl/.libs/libltdl.nm" "libltdl/.libs/libltdl.nmS" …Run Code Online (Sandbox Code Playgroud) 我正在转换一个C++程序,该程序使用autotools构建系统来使用共享库,引入了libtool的使用.大多数程序功能都放在由主程序加载的共享库中,以便将来可以访问其他程序的公共代码.
在整个程序和库源中,生成的autoheader config.h与通常的宏一起使用:
#if HAVE_CONFIG_H
# include <config.h>
#endif
Run Code Online (Sandbox Code Playgroud)
在configure.ac中我使用宏来生成它:
AC_CONFIG_HEADERS([config.h])
Run Code Online (Sandbox Code Playgroud)
我的问题是,我是否需要安装config.h其他人以便能够使用我的库,如果是,那么适当的方法是什么,是否应该重命名以避免冲突等?
我在这里找到的最多信息是:
http://www.openismus.com/documents/linux/building_libraries/building_libraries#installingheaders
但这不是官方消息来源.
我在C++项目中使用来自ffmpeg的libavcodec和libavformat库.链接-lavcodec -lavformat与g ++编译器工作正常,但是当我尝试使用在automake项目中编译的相同代码时,我不确定出了什么问题.
工作正常:
g++ -o test -D__STDC_CONSTANT_MACROS -lavcodec -lavformat test.cpp
Run Code Online (Sandbox Code Playgroud)
不工作Makefile.am:
binaryname_LDFLAGS= -lavcodec -lavformat
Run Code Online (Sandbox Code Playgroud)
错误:
....
/usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/libavformat.a(nut.o):function
ff_nut_add_sp: error: undefined reference to 'av_tree_node_size'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/libavformat.a(nut.o):function
ff_nut_add_sp: error: undefined reference to 'av_tree_insert'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/libavformat.a(nut.o):function
ff_nut_free_sp: error: undefined reference to 'av_tree_enumerate'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/libavformat.a(nut.o):function
ff_nut_free_sp: error: undefined reference to 'av_tree_destroy'
/usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/libavformat.a(rtp.o):function
ff_rtp_get_payload_type: error: undefined reference to 'av_opt_get_int'
...
Run Code Online (Sandbox Code Playgroud)
也没工作:
LDFLAGS=...-lavcodec -lavformat
Run Code Online (Sandbox Code Playgroud)
错误:
src/dsp/audioDecoder.cpp:99: error: undefined reference to 'av_register_all'
src/dsp/audioDecoder.cpp:101: error: undefined reference to 'avcodec_find_decoder'
src/dsp/audioDecoder.cpp:109: error: undefined reference to 'avcodec_alloc_context'
src/dsp/audioDecoder.cpp:120: error: undefined reference to …Run Code Online (Sandbox Code Playgroud)