红联Linux门户
Linux帮助

undefined reference to

发布时间:2010-07-05 14:59:57来源:红联作者:jiajunpp
undefined reference to error解决方法
陈运文

Linux下编译程序时,经常会遇到“undefined reference error” 报错,

这里总结一些可能的原因和解决方案,给需要的朋友:

说道undefined reference error,先提一下Linux gcc链接规则:

链接的时候查找顺序是:

-L 指定的路径, 从左到右依次查找
由 环境变量 LIBRARY_PATH 指定的路径,使用":"分割从左到右依次查找
/etc/ld.so.conf 指定的路径顺序
/lib 和 /usr/lib (64位下是/lib64和/usr/lib64)
动态库调用的查找顺序:

ld的-rpath参数指定的路径, 这是写死在代码中的
ld脚本指定的路径
LD_LIBRARY_PATH 指定的路径
/etc/ld.so.conf 指定的路径
/lib和/usr/lib(64位下是/lib64和/usr/lib64)
一般情况链接的时候我们采用-L的方式指定查找路径, 调用动态链接库的时候采用LD_LIBRARY_PATH的方式指定链接路径.

另外注意一个问题,就是只要查找到第一个就会返回,后面的不会再查找. 比如-L./A -L./B -lx 在A中有libx.a B中有libx.a和libx.so, 这个时候会使用在./A的libx.a 而不会遵循动态库优先的原则,因为./A是先找到的,并且没有同名动态库存在

对于动态链接库,实际的符号定位是在运行期进行的.在编译.so的时候,如果没有把它需要的库和他一起进行联编,比如libx.so 需要使用uldict, 但是忘记在编译libx.so的时候加上-luldict的话,在编译libx.so的时候不会报错,因为这个时候libx.so被认为是一个库,它里面存在一些不知道具体实现的符号是合法的,是可以在运行期指定或者编译另外的二进制程序的时候指定.

如果是采用 g++ -Lpath -lx 的方式进行编译,链接器会发现所需要的uldict的符号表找不到从而报错,但是如果是程序采用dlopen的方式载入,由于是运行期,这个程序在这个地方就直接运行报错了.另外还有一种情况就是一个对外的接口在动态库中已经声明定义了,但是忘记实现了,这个时候也会产生类似的错误.

如果在运行期报出这样的错误,就要注意是否是由于某些库没有链接进来或者某些接口没有实现的原因产生

有了上述基础,不难总结出,undefined reference error错误的原因可能来自以下几方面:

1 没有指定对应的库(.o/.a/.so)
使用了库中定义的实体,但没有指定库(-lXXX)或者没有指定库路径(-LYYY),会导致该错误,

2 连接库参数的顺序不对
在默认情况下,对于-l 使用库的要求是越是基础的库越要写在后面,无论是静态还动态

3 gcc/ld 版本不匹配
gcc/ld的版本的兼容性问题,由于gcc2 到 gcc3大版本的兼容性存在问题(其实gcc3.2到3.4也一定程度上存在这样的问题) 当在高版本机器上使用低版本的机器就会导致这样的错误, 这个问题比较常见在32位的环境上, 另外就在32位环境不小心使用了64位的库或者反过来64位环境使用了32位的库.

4 C/C++相互依赖和链接
gcc和g++编译结果的混用需要保证能够extern "C" 两边都可以使用的接口,在我们的64位环境中gcc链接g++的库还需要加上 -lstdc++,具体见前文对于混合编译的说明

5 运行期报错
这个问题基本上是由于程序使用了dlopen方式载入.so, 但.so没有把所有需要的库都链接上,具体参加上文中对于静态库和动态库混合使用的说明

(陈运文)
本文来自CSDN博客
文章评论

共有 7 条评论

  1. 569911213 于 2012-08-06 19:54:13发表:

    您好!我刚装上linux ubuntu12.04系统,在装软件时出现如下错误:


    hjl@hjl-HP-ProBook-4411s:~$ tar xzvf frida2libs-120509.tgz
    tmp/frida2libs-120509/aclocal.m4
    tmp/frida2libs-120509/build-aux/
    tmp/frida2libs-120509/build-aux/ltmain.sh
    tmp/frida2libs-120509/build-aux/missing
    tmp/frida2libs-120509/build-aux/install-sh
    tmp/frida2libs-120509/build-aux/config.guess
    tmp/frida2libs-120509/build-aux/config.sub
    tmp/frida2libs-120509/configure
    tmp/frida2libs-120509/configure.ac
    tmp/frida2libs-120509/COPYING
    tmp/frida2libs-120509/INSTALL
    tmp/frida2libs-120509/kww/
    tmp/frida2libs-120509/kww/Makefile.am
    tmp/frida2libs-120509/kww/COPYING
    tmp/frida2libs-120509/kww/test/
    tmp/frida2libs-120509/kww/test/kww.h
    tmp/frida2libs-120509/kww/test/kwwlimits.rb
    tmp/frida2libs-120509/kww/test/Makefile.am
    tmp/frida2libs-120509/kww/test/kwwtest1.c
    tmp/frida2libs-120509/kww/test/kwwdiscont.rb
    tmp/frida2libs-120509/kww/test/Makefile.in
    tmp/frida2libs-120509/kww/test/runkww.c
    tmp/frida2libs-120509/kww/lib/
    tmp/frida2libs-120509/kww/lib/kww.h
    tmp/frida2libs-120509/kww/lib/Makefile.am
    tmp/frida2libs-120509/kww/lib/kww.c
    tmp/frida2libs-120509/kww/lib/Makefile.in
    tmp/frida2libs-120509/kww/INSTALL
    tmp/frida2libs-120509/kww/TODO
    tmp/frida2libs-120509/kww/doc/
    tmp/frida2libs-120509/kww/doc/kww.pod
    tmp/frida2libs-120509/kww/doc/redirect-src.html
    tmp/frida2libs-120509/kww/doc/Makefile.am
    tmp/frida2libs-120509/kww/doc/podstyle.css
    tmp/frida2libs-120509/kww/doc/pod2htmi.tmp
    tmp/frida2libs-120509/kww/doc/pod2htmd.tmp
    tmp/frida2libs-120509/kww/doc/kww.3
    tmp/frida2libs-120509/kww/doc/Makefile.in
    tmp/frida2libs-120509/kww/doc/redirect-kww.html
    tmp/frida2libs-120509/kww/doc/.htaccess
    tmp/frida2libs-120509/kww/doc/kww.html
    tmp/frida2libs-120509/kww/Makefile.in
    tmp/frida2libs-120509/kww/CHANGE_LOG
    tmp/frida2libs-120509/kww/configure
    tmp/frida2libs-120509/kww/build-aux/
    tmp/frida2libs-120509/kww/build-aux/depcomp
    tmp/frida2libs-120509/kww/build-aux/ltmain.sh
    tmp/frida2libs-120509/kww/build-aux/missing
    tmp/frida2libs-120509/kww/build-aux/install-sh
    tmp/frida2libs-120509/kww/build-aux/config.guess
    tmp/frida2libs-120509/kww/build-aux/config.sub
    tmp/frida2libs-120509/kww/aclocal.m4
    tmp/frida2libs-120509/kww/m4/
    tmp/frida2libs-120509/kww/m4/libtool.m4
    tmp/frida2libs-120509/kww/m4/ltversion.m4
    tmp/frida2libs-120509/kww/m4/ltoptions.m4
    tmp/frida2libs-120509/kww/m4/lt~obsolete.m4
    tmp/frida2libs-120509/kww/m4/ltsugar.m4
    tmp/frida2libs-120509/kww/configure.ac
    tmp/frida2libs-120509/lmfit/
    tmp/frida2libs-120509/lmfit/Makefile.am
    tmp/frida2libs-120509/lmfit/COPYING
    tmp/frida2libs-120509/lmfit/ruby/
    tmp/frida2libs-120509/lmfit/ruby/README
    tmp/frida2libs-120509/lmfit/ruby/lmfit-ruby.i
    tmp/frida2libs-120509/lmfit/ruby/extconf.rb
    tmp/frida2libs-120509/lmfit/lib/
    tmp/frida2libs-120509/lmfit/lib/Makefile.am
    tmp/frida2libs-120509/lmfit/lib/lmmin.c
    tmp/frida2libs-120509/lmfit/lib/lmcurve.c
    tmp/frida2libs-120509/lmfit/lib/lmmin.h
    tmp/frida2libs-120509/lmfit/lib/Makefile.in
    tmp/frida2libs-120509/lmfit/lib/lmcurve.h
    tmp/frida2libs-120509/lmfit/INSTALL
    tmp/frida2libs-120509/lmfit/TODO
    tmp/frida2libs-120509/lmfit/doc/
    tmp/frida2libs-120509/lmfit/doc/lmcurve_fit.3
    tmp/frida2libs-120509/lmfit/doc/Makefile.am
    tmp/frida2libs-120509/lmfit/doc/podstyle.css
    tmp/frida2libs-120509/lmfit/doc/lmfit.html
    tmp/frida2libs-120509/lmfit/doc/pod2htmi.tmp
    tmp/frida2libs-120509/lmfit/doc/lmmin.3
    tmp/frida2libs-120509/lmfit/doc/pod2htmd.tmp
    tmp/frida2libs-120509/lmfit/doc/Makefile.in
    tmp/frida2libs-120509/lmfit/doc/lmfit.pod
    tmp/frida2libs-120509/lmfit/doc/lmfit.3
    tmp/frida2libs-120509/lmfit/Makefile.in
    tmp/frida2libs-120509/lmfit/CHANGE_LOG
    tmp/frida2libs-120509/lmfit/configure
    tmp/frida2libs-120509/lmfit/build-aux/
    tmp/frida2libs-120509/lmfit/build-aux/depcomp
    tmp/frida2libs-120509/lmfit/build-aux/ltmain.sh
    tmp/frida2libs-120509/lmfit/build-aux/missing
    tmp/frida2libs-120509/lmfit/build-aux/install-sh
    tmp/frida2libs-120509/lmfit/build-aux/config.guess
    tmp/frida2libs-120509/lmfit/build-aux/config.sub
    tmp/frida2libs-120509/lmfit/aclocal.m4
    tmp/frida2libs-120509/lmfit/config.h.in
    tmp/frida2libs-120509/lmfit/m4/
    tmp/frida2libs-120509/lmfit/m4/libtool.m4
    tmp/frida2libs-120509/lmfit/m4/ltversion.m4
    tmp/frida2libs-120509/lmfit/m4/ltoptions.m4
    tmp/frida2libs-120509/lmfit/m4/lt~obsolete.m4
    tmp/frida2libs-120509/lmfit/m4/ltsugar.m4
    tmp/frida2libs-120509/lmfit/demo/
    tmp/frida2libs-120509/lmfit/demo/Makefile.am
    tmp/frida2libs-120509/lmfit/demo/surface1.c
    tmp/frida2libs-120509/lmfit/demo/powell.c
    tmp/frida2libs-120509/lmfit/demo/morobropro.c
    tmp/frida2libs-120509/lmfit/demo/Makefile.in
    tmp/frida2libs-120509/lmfit/demo/fourexp.c
    tmp/frida2libs-120509/lmfit/demo/hat.c
    tmp/frida2libs-120509/lmfit/demo/curve1.c
    tmp/frida2libs-120509/lmfit/configure.ac
    tmp/frida2libs-120509/Makefile.am
    tmp/frida2libs-120509/Makefile.in
    tmp/frida2libs-120509/read-plus/
    tmp/frida2libs-120509/read-plus/Makefile.am
    tmp/frida2libs-120509/read-plus/COPYING
    tmp/frida2libs-120509/read-plus/lib/
    tmp/frida2libs-120509/read-plus/lib/Makefile.am
    tmp/frida2libs-120509/read-plus/lib/ask_simple_value.cpp
    tmp/frida2libs-120509/read-plus/lib/readln.h
    tmp/frida2libs-120509/read-plus/lib/readln.cpp
    tmp/frida2libs-120509/read-plus/lib/Makefile.in
    tmp/frida2libs-120509/read-plus/lib/ask_simple_value.h
    tmp/frida2libs-120509/read-plus/INSTALL
    tmp/frida2libs-120509/read-plus/CHANGELOG
    tmp/frida2libs-120509/read-plus/Makefile.in
    tmp/frida2libs-120509/read-plus/configure
    tmp/frida2libs-120509/read-plus/build-aux/
    tmp/frida2libs-120509/read-plus/build-aux/depcomp
    tmp/frida2libs-120509/read-plus/build-aux/ltmain.sh
    tmp/frida2libs-120509/read-plus/build-aux/missing
    tmp/frida2libs-120509/read-plus/build-aux/install-sh
    tmp/frida2libs-120509/read-plus/build-aux/config.guess
    tmp/frida2libs-120509/read-plus/build-aux/config.sub
    tmp/frida2libs-120509/read-plus/aclocal.m4
    tmp/frida2libs-120509/read-plus/config.h.in
    tmp/frida2libs-120509/read-plus/m4/
    tmp/frida2libs-120509/read-plus/m4/libtool.m4
    tmp/frida2libs-120509/read-plus/m4/ltversion.m4
    tmp/frida2libs-120509/read-plus/m4/ltoptions.m4
    tmp/frida2libs-120509/read-plus/m4/lt~obsolete.m4
    tmp/frida2libs-120509/read-plus/m4/ltsugar.m4
    tmp/frida2libs-120509/read-plus/configure.ac
    tmp/frida2libs-120509/read-plus/history
    tmp/frida2libs-120509/yaml-cpp-at/
    tmp/frida2libs-120509/yaml-cpp-at/Makefile.am
    tmp/frida2libs-120509/yaml-cpp-at/COPYING
    tmp/frida2libs-120509/yaml-cpp-at/lib/
    tmp/frida2libs-120509/yaml-cpp-at/lib/scantoken.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/tag.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/contrib/
    tmp/frida2libs-120509/yaml-cpp-at/lib/contrib/graphbuilderadapter.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/contrib/graphbuilderadapter.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/contrib/graphbuilder.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/simplekey.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/scanner.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/nodebuilder.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/scanner.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/scanscalar.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/emitterstate.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/token.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/ABOUT
    tmp/frida2libs-120509/yaml-cpp-at/lib/emitter.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/scantag.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/Makefile.am
    tmp/frida2libs-120509/yaml-cpp-at/lib/setting.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/exp.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/null.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/node.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/regex.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/iterpriv.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/emitterutils.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/nodeownership.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/stringsource.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/stream.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/emitterstate.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/conversion.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/parser.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/aliasmanager.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/singledocparser.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/exceptions.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/conversion.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/stlnode.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/emittermanip.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/traits.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/parser.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/noncopyable.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/dll.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/emitfromevents.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/node.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/iterator.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/emitter.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/nodereadimpl.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/ltnode.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/nodeutil.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/anchor.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/null.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/stlemitter.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/yaml.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/aliasmanager.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/nodeimpl.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/mark.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/eventhandler.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/yaml-cpp/ostream.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/directives.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/iterator.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/ptr_stack.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/emitterutils.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/tag.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/ostream.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/Makefile.in
    tmp/frida2libs-120509/yaml-cpp-at/lib/exp.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/directives.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/scantag.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/collectionstack.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/regex.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/nodebuilder.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/streamcharsource.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/scanscalar.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/indentation.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/stream.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/regeximpl.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/emitfromevents.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/ptr_vector.h
    tmp/frida2libs-120509/yaml-cpp-at/lib/singledocparser.cpp
    tmp/frida2libs-120509/yaml-cpp-at/lib/nodeownership.h
    tmp/frida2libs-120509/yaml-cpp-at/CHANGELOG
    tmp/frida2libs-120509/yaml-cpp-at/Makefile.in
    tmp/frida2libs-120509/yaml-cpp-at/configure
    tmp/frida2libs-120509/yaml-cpp-at/build-aux/
    tmp/frida2libs-120509/yaml-cpp-at/build-aux/depcomp
    tmp/frida2libs-120509/yaml-cpp-at/build-aux/ltmain.sh
    tmp/frida2libs-120509/yaml-cpp-at/build-aux/missing
    tmp/frida2libs-120509/yaml-cpp-at/build-aux/install-sh
    tmp/frida2libs-120509/yaml-cpp-at/build-aux/config.guess
    tmp/frida2libs-120509/yaml-cpp-at/build-aux/config.sub
    tmp/frida2libs-120509/yaml-cpp-at/aclocal.m4
    tmp/frida2libs-120509/yaml-cpp-at/m4/
    tmp/frida2libs-120509/yaml-cpp-at/m4/libtool.m4
    tmp/frida2libs-120509/yaml-cpp-at/m4/ltversion.m4
    tmp/frida2libs-120509/yaml-cpp-at/m4/ltoptions.m4
    tmp/frida2libs-120509/yaml-cpp-at/m4/lt~obsolete.m4
    tmp/frida2libs-120509/yaml-cpp-at/m4/ltsugar.m4
    tmp/frida2libs-120509/yaml-cpp-at/demo/
    tmp/frida2libs-120509/yaml-cpp-at/demo/Makefile.am
    tmp/frida2libs-120509/yaml-cpp-at/demo/yaml-cpp-parser-demo.cpp
    tmp/frida2libs-120509/yaml-cpp-at/demo/Makefile.in
    tmp/frida2libs-120509/yaml-cpp-at/demo/monsters.yaml
    tmp/frida2libs-120509/yaml-cpp-at/configure.ac
    hjl@hjl-HP-ProBook-4411s:~$


    hjl@hjl-HP-ProBook-4411s:~$ cd tmp/frida2libs-120509
    hjl@hjl-HP-ProBook-4411s:~/tmp/frida2libs-120509$ ./configure
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    configure: creating ./config.status
    config.status: creating Makefile
    === configuring in kww (/home/hjl/tmp/frida2libs-120509/kww)
    configure: running /bin/bash ./configure --disable-option-checking '--prefix=/usr/local' --cache-file=/dev/null --srcdir=.
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking build system type... i686-pc-linux-gnu
    checking host system type... i686-pc-linux-gnu
    checking how to print strings... printf
    checking for style of include used by make... GNU
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking dependency style of gcc... gcc3
    checking for a sed that does not truncate output... /bin/sed
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for fgrep... /bin/grep -F
    checking for ld used by gcc... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
    checking the name lister (/usr/bin/nm -B) interface... BSD nm
    checking whether ln -s works... yes
    checking the maximum length of command line arguments... 1572864
    checking whether the shell understands some XSI constructs... yes
    checking whether the shell understands "+="... yes
    checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop
    checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
    checking for /usr/bin/ld option to reload object files... -r
    checking for objdump... objdump
    checking how to recognize dependent libraries... pass_all
    checking for dlltool... no
    checking how to associate runtime and link libraries... printf %s\n
    checking for ar... ar
    checking for archiver @FILE support... @
    checking for strip... strip
    checking for ranlib... ranlib
    checking command to parse /usr/bin/nm -B output from gcc object... ok
    checking for sysroot... no
    checking for mt... mt
    checking if mt is a manifest tool... no
    checking how to run the C preprocessor... gcc -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for dlfcn.h... yes
    checking for objdir... .libs
    checking if gcc supports -fno-rtti -fno-exceptions... no
    checking for gcc option to produce PIC... -fPIC -DPIC
    checking if gcc PIC flag -fPIC -DPIC works... yes
    checking if gcc static flag -static works... yes
    checking if gcc supports -c -o file.o... yes
    checking if gcc supports -c -o file.o... (cached) yes
    checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
    checking whether -lc should be explicitly linked in... no
    checking dynamic linker characteristics... GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... yes
    checking for gcc... (cached) gcc
    checking whether we are using the GNU C compiler... (cached) yes
    checking whether gcc accepts -g... (cached) yes
    checking for gcc option to accept ISO C89... (cached) none needed
    checking dependency style of gcc... (cached) gcc3
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating lib/Makefile
    config.status: creating doc/Makefile
    config.status: creating test/Makefile
    config.status: executing depfiles commands
    config.status: executing libtool commands
    === configuring in lmfit (/home/hjl/tmp/frida2libs-120509/lmfit)
    configure: running /bin/bash ./configure --disable-option-checking '--prefix=/usr/local' --cache-file=/dev/null --srcdir=.
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking build system type... i686-pc-linux-gnu
    checking host system type... i686-pc-linux-gnu
    checking how to print strings... printf
    checking for style of include used by make... GNU
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking dependency style of gcc... gcc3
    checking for a sed that does not truncate output... /bin/sed
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for fgrep... /bin/grep -F
    checking for ld used by gcc... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
    checking the name lister (/usr/bin/nm -B) interface... BSD nm
    checking whether ln -s works... yes
    checking the maximum length of command line arguments... 1572864
    checking whether the shell understands some XSI constructs... yes
    checking whether the shell understands "+="... yes
    checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop
    checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
    checking for /usr/bin/ld option to reload object files... -r
    checking for objdump... objdump
    checking how to recognize dependent libraries... pass_all
    checking for dlltool... no
    checking how to associate runtime and link libraries... printf %s\n
    checking for ar... ar
    checking for archiver @FILE support... @
    checking for strip... strip
    checking for ranlib... ranlib
    checking command to parse /usr/bin/nm -B output from gcc object... ok
    checking for sysroot... no
    checking for mt... mt
    checking if mt is a manifest tool... no
    checking how to run the C preprocessor... gcc -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for dlfcn.h... yes
    checking for objdir... .libs
    checking if gcc supports -fno-rtti -fno-exceptions... no
    checking for gcc option to produce PIC... -fPIC -DPIC
    checking if gcc PIC flag -fPIC -DPIC works... yes
    checking if gcc static flag -static works... yes
    checking if gcc supports -c -o file.o... yes
    checking if gcc supports -c -o file.o... (cached) yes
    checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
    checking whether -lc should be explicitly linked in... no
    checking dynamic linker characteristics... GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... yes
    checking for gcc... (cached) gcc
    checking whether we are using the GNU C compiler... (cached) yes
    checking whether gcc accepts -g... (cached) yes
    checking for gcc option to accept ISO C89... (cached) none needed
    checking dependency style of gcc... (cached) gcc3
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating lib/Makefile
    config.status: creating demo/Makefile
    config.status: creating doc/Makefile
    config.status: creating config.h
    config.status: config.h is unchanged
    config.status: executing depfiles commands
    config.status: executing libtool commands
    === configuring in read-plus (/home/hjl/tmp/frida2libs-120509/read-plus)
    configure: running /bin/bash ./configure --disable-option-checking '--prefix=/usr/local' --cache-file=/dev/null --srcdir=.
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking build system type... i686-pc-linux-gnu
    checking host system type... i686-pc-linux-gnu
    checking how to print strings... printf
    checking for style of include used by make... GNU
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking dependency style of gcc... gcc3
    checking for a sed that does not truncate output... /bin/sed
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for fgrep... /bin/grep -F
    checking for ld used by gcc... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
    checking the name lister (/usr/bin/nm -B) interface... BSD nm
    checking whether ln -s works... yes
    checking the maximum length of command line arguments... 1572864
    checking whether the shell understands some XSI constructs... yes
    checking whether the shell understands "+="... yes
    checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop
    checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
    checking for /usr/bin/ld option to reload object files... -r
    checking for objdump... objdump
    checking how to recognize dependent libraries... pass_all
    checking for dlltool... no
    checking how to associate runtime and link libraries... printf %s\n
    checking for ar... ar
    checking for archiver @FILE support... @
    checking for strip... strip
    checking for ranlib... ranlib
    checking command to parse /usr/bin/nm -B output from gcc object... ok
    checking for sysroot... no
    checking for mt... mt
    checking if mt is a manifest tool... no
    checking how to run the C preprocessor... gcc -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for dlfcn.h... yes
    checking for objdir... .libs
    checking if gcc supports -fno-rtti -fno-exceptions... no
    checking for gcc option to produce PIC... -fPIC -DPIC
    checking if gcc PIC flag -fPIC -DPIC works... yes
    checking if gcc static flag -static works... yes
    checking if gcc supports -c -o file.o... yes
    checking if gcc supports -c -o file.o... (cached) yes
    checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
    checking whether -lc should be explicitly linked in... no
    checking dynamic linker characteristics... GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... yes
    checking for g++... g++
    checking whether we are using the GNU C++ compiler... yes
    checking whether g++ accepts -g... yes
    checking dependency style of g++... gcc3
    checking how to run the C++ preprocessor... g++ -E
    checking for ld used by g++... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
    checking for g++ option to produce PIC... -fPIC -DPIC
    checking if g++ PIC flag -fPIC -DPIC works... yes
    checking if g++ static flag -static works... yes
    checking if g++ supports -c -o file.o... yes
    checking if g++ supports -c -o file.o... (cached) yes
    checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
    checking dynamic linker characteristics... (cached) GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking for readline in -lreadline... yes
    checking for ANSI C header files... (cached) yes
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating lib/Makefile
    config.status: creating config.h
    config.status: config.h is unchanged
    config.status: executing depfiles commands
    config.status: executing libtool commands
    === configuring in yaml-cpp-at (/home/hjl/tmp/frida2libs-120509/yaml-cpp-at)
    configure: running /bin/bash ./configure --disable-option-checking '--prefix=/usr/local' --cache-file=/dev/null --srcdir=.
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking build system type... i686-pc-linux-gnu
    checking host system type... i686-pc-linux-gnu
    checking how to print strings... printf
    checking for style of include used by make... GNU
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking dependency style of gcc... gcc3
    checking for a sed that does not truncate output... /bin/sed
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for fgrep... /bin/grep -F
    checking for ld used by gcc... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
    checking the name lister (/usr/bin/nm -B) interface... BSD nm
    checking whether ln -s works... yes
    checking the maximum length of command line arguments... 1572864
    checking whether the shell understands some XSI constructs... yes
    checking whether the shell understands "+="... yes
    checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop
    checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
    checking for /usr/bin/ld option to reload object files... -r
    checking for objdump... objdump
    checking how to recognize dependent libraries... pass_all
    checking for dlltool... no
    checking how to associate runtime and link libraries... printf %s\n
    checking for ar... ar
    checking for archiver @FILE support... @
    checking for strip... strip
    checking for ranlib... ranlib
    checking command to parse /usr/bin/nm -B output from gcc object... ok
    checking for sysroot... no
    checking for mt... mt
    checking if mt is a manifest tool... no
    checking how to run the C preprocessor... gcc -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for dlfcn.h... yes
    checking for objdir... .libs
    checking if gcc supports -fno-rtti -fno-exceptions... no
    checking for gcc option to produce PIC... -fPIC -DPIC
    checking if gcc PIC flag -fPIC -DPIC works... yes
    checking if gcc static flag -static works... yes
    checking if gcc supports -c -o file.o... yes
    checking if gcc supports -c -o file.o... (cached) yes
    checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
    checking whether -lc should be explicitly linked in... no
    checking dynamic linker characteristics... GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... yes
    checking for g++... g++
    checking whether we are using the GNU C++ compiler... yes
    checking whether g++ accepts -g... yes
    checking dependency style of g++... gcc3
    checking how to run the C++ preprocessor... g++ -E
    checking for ld used by g++... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
    checking for g++ option to produce PIC... -fPIC -DPIC
    checking if g++ PIC flag -fPIC -DPIC works... yes
    checking if g++ static flag -static works... yes
    checking if g++ supports -c -o file.o... yes
    checking if g++ supports -c -o file.o... (cached) yes
    checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
    checking dynamic linker characteristics... (cached) GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating lib/Makefile
    config.status: creating demo/Makefile
    config.status: executing depfiles commands
    config.status: executing libtool commands
    hjl@hjl-HP-ProBook-4411s:~/tmp/frida2libs-120509$


    hjl@hjl-HP-ProBook-4411s:~/tmp/frida2libs-120509$ make
    Making all in kww
    make[1]: Entering directory `/home/hjl/tmp/frida2libs-120509/kww'
    Making all in lib
    make[2]: Entering directory `/home/hjl/tmp/frida2libs-120509/kww/lib'
    make[2]: Nothing to be done for `all'.
    make[2]: Leaving directory `/home/hjl/tmp/frida2libs-120509/kww/lib'
    Making all in doc
    make[2]: Entering directory `/home/hjl/tmp/frida2libs-120509/kww/doc'
    make[2]: Nothing to be done for `all'.
    make[2]: Leaving directory `/home/hjl/tmp/frida2libs-120509/kww/doc'
    Making all in test
    make[2]: Entering directory `/home/hjl/tmp/frida2libs-120509/kww/test'
    /bin/bash ../libtool --tag=CC --mode=link gcc -I./../lib -O0 -g -O2 -lm -L../lib -lkww -o runkww runkww.o
    libtool: link: gcc -I./../lib -O0 -g -O2 -o .libs/runkww runkww.o -lm -L../lib /home/hjl/tmp/frida2libs-120509/kww/lib/.libs/libkww.so
    /home/hjl/tmp/frida2libs-120509/kww/lib/.libs/libkww.so: undefined reference to `tgamma'
    /home/hjl/tmp/frida2libs-120509/kww/lib/.libs/libkww.so: undefined reference to `sinh'
    /home/hjl/tmp/frida2libs-120509/kww/lib/.libs/libkww.so: undefined reference to `cosh'
    /home/hjl/tmp/frida2libs-120509/kww/lib/.libs/libkww.so: undefined reference to `sin'
    /home/hjl/tmp/frida2libs-120509/kww/lib/.libs/libkww.so: undefined reference to `exp'
    /home/hjl/tmp/frida2libs-120509/kww/lib/.libs/libkww.so: undefined reference to `lgamma'
    /home/hjl/tmp/frida2libs-120509/kww/lib/.libs/libkww.so: undefined reference to `cos'
    /home/hjl/tmp/frida2libs-120509/kww/lib/.libs/libkww.so: undefined reference to `log'
    /home/hjl/tmp/frida2libs-120509/kww/lib/.libs/libkww.so: undefined reference to `pow'
    collect2: ld returned 1 exit status
    make[2]: *** [runkww] Error 1
    make[2]: Leaving directory `/home/hjl/tmp/frida2libs-120509/kww/test'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/hjl/tmp/frida2libs-120509/kww'
    make: *** [all-recursive] Error 1

    请问您知不知道问题出在哪?该怎么解决,谢谢您!

  2. stoning 于 2011-07-14 17:28:21发表:

    学习了,不错

  3. libin1201119 于 2011-03-28 19:02:36发表:

    很好

  4. 410076766 于 2010-08-27 17:53:54发表:

    学习了

  5. shenhao0129 于 2010-07-06 19:06:49发表:

    很强滴说!
    P.S LS奶茶的勋章真的很多耶

  6. 奶茶dsk 于 2010-07-05 19:30:12发表:

    {:3_115:} 8错,

  7. Storqc 于 2010-07-05 16:25:49发表:

    顺路学习