当前位置: 技术问答>linux和unix
请教--有关 LINUX 下链接动态库的问题!
来源: 互联网 发布时间:2015-11-24
本文导语: 我在LINUX 下安装了INTEL @IPP(试用版)的库,安装完之后只有.so动态库文件,没有.a文件。我调试了一个安装目录下的例子,它调用的是.a库文件,在它的Makefile里面我把它改成链接相应的动态库文件。例子里的源文件有 ...
我在LINUX 下安装了INTEL @IPP(试用版)的库,安装完之后只有.so动态库文件,没有.a文件。我调试了一个安装目录下的例子,它调用的是.a库文件,在它的Makefile里面我把它改成链接相应的动态库文件。例子里的源文件有 : Filtering.c和filter.c(.h文件已经包含在源文件里面);链接的动态库文件是:libFiltering.so(原名是 l_ipp_WMMX50LNX_r.so,我把名字改了),并把这个文件拷到了源文件所在的目录,之后我用下面的命令对文件进行编译:
arm-linux-gcc Filtering.c filter.c -L. -lFiltering -o FILT
编译结果如下:
root:/opt/intel/ipp/5.0/pca_wmmx/include/Filtering # arm-linux-gcc Filtering.c filter.c -L. -lFiltering -o FILT
/tmp/cc1h8jsp.o(.text+0x77c): In function `UserInterface':
: warning: the `gets' function is dangerous and should not be used.
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: type and size of dynamic symbol `ippsAdd_16s_I' are not defined
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: type and size of dynamic symbol `ippsToneQ15_16s' are not defined
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: type and size of dynamic symbol `ippsNorm_L2_16s32s' are not defined
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: type and size of dynamic symbol `ippsRandGauss_16s' are not defined
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: type and size of dynamic symbol `ippsZero_16s' are not defined
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: type and size of dynamic symbol `ippsCopy_16s' are not defined
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: type and size of dynamic symbol `ippsFIR_Direct_16s' are not defined
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: type and size of dynamic symbol `ippsIIR_BiQuadDirect_16s' are not defined
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: type and size of dynamic symbol `ippsLn_16s_ISfs' are not defined
./libFiltering.so: undefined reference to `ippsMalloc'
./libFiltering.so: undefined reference to `ippsFree'
collect2: ld returned 1 exit status
请问各位高手这是不是因为库没有链接上?还有从最后两行的错误
./libFiltering.so: undefined reference to `ippsMalloc'
./libFiltering.so: undefined reference to `ippsFree'
来看,库是不是也有问题?
arm-linux-gcc Filtering.c filter.c -L. -lFiltering -o FILT
编译结果如下:
root:/opt/intel/ipp/5.0/pca_wmmx/include/Filtering # arm-linux-gcc Filtering.c filter.c -L. -lFiltering -o FILT
/tmp/cc1h8jsp.o(.text+0x77c): In function `UserInterface':
: warning: the `gets' function is dangerous and should not be used.
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: type and size of dynamic symbol `ippsAdd_16s_I' are not defined
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: type and size of dynamic symbol `ippsToneQ15_16s' are not defined
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: type and size of dynamic symbol `ippsNorm_L2_16s32s' are not defined
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: type and size of dynamic symbol `ippsRandGauss_16s' are not defined
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: type and size of dynamic symbol `ippsZero_16s' are not defined
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: type and size of dynamic symbol `ippsCopy_16s' are not defined
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: type and size of dynamic symbol `ippsFIR_Direct_16s' are not defined
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: type and size of dynamic symbol `ippsIIR_BiQuadDirect_16s' are not defined
/usr/local/arm-linux/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld: warning: type and size of dynamic symbol `ippsLn_16s_ISfs' are not defined
./libFiltering.so: undefined reference to `ippsMalloc'
./libFiltering.so: undefined reference to `ippsFree'
collect2: ld returned 1 exit status
请问各位高手这是不是因为库没有链接上?还有从最后两行的错误
./libFiltering.so: undefined reference to `ippsMalloc'
./libFiltering.so: undefined reference to `ippsFree'
来看,库是不是也有问题?
|
如果库没链接上,应该会提示-lFiltering出错的吧,应该是你在调用库的时候出的错,查查你调用库的代码吧。