undefined reference checkto `txt_lib'

我的菜园我做主
FreeBSD下编译Fontconfig时提示src/.libs/libfontconfig.so: undefined reference to `xmlCreatePushParserCtxt' 的解决办法
在Freebsd下编译Fontconfig时,最近遇到了个麻烦的问题,在网上搜索了一下,也有不少人遇到过,但是都没有很好的解决办法。其实这个问题是编译参数设置不当导致的。使用下面的参数可以通过编译。
./configure --prefix=/usr/local/fontconfig2.4 --with-freetype-config=/usr/local/freetype2.4/bin/freetype-config LIBXML2_CFLAGS='-I/usr/local/libxml2.7/include/libxml2' LIBXML2_LIBS='-L/usr/local/libxml2.7/lib -lxml2 -lz' --enable-libxml2
其实主要是需要一个-lxml2,只添加一个-L/usr/local/libxml2.7/lib是不能够找到libxml2.so的。这个是在编译fc-cache时特殊的,估计是Makefile里这么设定了。
没有更多推荐了,cascade rcnn 训练自己的数据——(一)转换数据
cascade rcnn 训练不是用普通的xml那些,还是有自己的读入数据的方式。默认给的是matlab的转换代码。以下提供的是python代码。voc_window_file.py#!/usr/bin/env python
# @File : voc_window_file.py
import os, sys
import xml.etree.ElementTree as ET
reload(sys)
sys.setdefaultencoding('utf-8')
def parse_rec(filename):
""" Parse a PASCAL VOC xml file """
tree = ET.parse(filename)
objects = []
for pic in tree.findall('size'):
pic_struct = {}
pic_struct['width'] = int(pic.find('width').text)
pic_struct['height'] = int(pic.find('height').text)
pic_struct['depth'] = int(pic.find('depth').text)
objects.append(pic_struct)
for obj in tree.findall('object'):
obj_struct = {}
obj_struct['name'] = obj.find('name').text
# obj_struct['difficult'] = int(obj.find('difficult').text)
bbox = obj.find('bndbox')
obj_struct['bbox'] = [int(float(bbox.find('xmin').text)),
int(float(bbox.find('ymin').text)),
int(float(bbox.find('xmax').text)),
int(float(bbox.find('ymax').text))]
objects.append(obj_struct)
return objects
def main():
vocdevkit = '/media/DT_Moyan/Data/VOC/VOCdevkit'
VOCopts_classes=['aeroplane', 'bicycle', 'bird', 'boat', 'bottle',
'bus', 'car', 'cat', 'chair', 'cow', 'diningtable',
'dog', 'horse', 'motorbike', 'person', 'pottedplant',
'sheep', 'sofa', 'train', 'tvmonitor']
years = ['2007', '2012']
split = ['trainval', 'test']
fileName = 'window_file_voc2007_trainval.txt'
fid = open(fileName, 'wt')
# just running
print ("VOC years: %s" %(years[0]))
txt_ = os.path.join(vocdevkit, 'VOC' + years[0], 'ImageSets', 'Main' , split[0] + '.txt')
f = open(txt_); idList = f.readlines() ; f.close()
print len(idList)
idCount = 0
for u in range(len(idList)):
nm = idList[u].strip() + '.jpg'
xm = idList[u].strip() + '.xml'
imgFullName = os.path.join('VOC' + years[0], 'JPEGImages', nm)
# imgPath = os.path.join(vocdevkit, 'VOC' + years[0], 'JPEGImages', nm)
xmlPath = os.path.join(vocdevkit, 'VOC' + years[0], 'Annotations', xm)
nObjs = parse_rec(xmlPath)
chw1 = nObjs[0]['depth']
chw2 = nObjs[0]['height']
chw3 = nObjs[0]['width']
fid.write('# %d\n' % u)
fid.write('%s\n' % imgFullName)
fid.write('%d\n%d\n%d\n' % (chw1, chw2, chw3))
fid.write('%d\n' % (len(nObjs) - 1))
for j in range(1, len(nObjs)):
clsIds = nObjs[j]['name']
xmin = nObjs[j]['bbox'][0]
ymin = nObjs[j]['bbox'][1]
xmax = nObjs[j]['bbox'][2]
ymax = nObjs[j]['bbox'][3]
if (xmax &= xmin) | (ymax &= ymin):
clsId = VOCopts_classes.index(clsIds) + 1
t_lines = str(clsId) + ' 0' + ' 0' + ' ' + str(xmin) + ' ' + str(ymin) + ' ' + str(xmax) + ' ' + str(ymax)
fid.write('%s\n' % t_lines)
# print t_lines
fid.write('%d\n' % 0)
idCount += 1
fid.close()
if __name__ == "__main__":
没有更多推荐了,caffe安装过程中碰到的一些问题以及解决方案
最近一直在使用caffe,把自己安装以及使用过程中碰到的问题做个记录:
convert_imageset.cpp:(.text.startup+0x5e1):对‘caffe::db::GetDB(std::string const&)’未定义的引用
convert_imageset.cpp:(.text.startup+0x719):对‘caffe::ReadImageToDatum(std::string const&, int, int, int, bool, std::string const&, caffe::Datum*)’未定义的引用
collect2: 错误: ld 返回 1
make: * [.build_release/tools/convert_imageset.bin] 错误 1
make: * 正在等待未完成的任务….
.build_release/tools/compute_image_mean.o:在函数‘main’中:
compute_image_mean.cpp:(.text.startup+0x152):对‘caffe::db::GetDB(std::string const&)’未定义的引用
compute_image_mean.cpp:(.text.startup+0x1f1):对‘caffe::DecodeDatumNative(caffe::Datum*)’未定义的引用
compute_image_mean.cpp:(.text.startup+0x3cf):对‘caffe::DecodeDatumNative(caffe::Datum*)’未定义的引用
collect2: 错误: ld 返回 1
make: * [.build_release/tools/compute_image_mean.bin] 错误 1
.build_release/tools/extract_features.o:在函数‘int feature_extraction_pipeline(int, char**)’中:
extract_features.cpp:(.text._Z27feature_extraction_pipelineIfEiiPPc[_Z27feature_extraction_pipelineIfEiiPPc]+0x117):对‘caffe::Net::Net(std::string const&, caffe::Phase)’未定义的引用
extract_features.cpp:(.text._Z27feature_extraction_pipelineIfEiiPPc[_Z27feature_extraction_pipelineIfEiiPPc]+0x60d):对‘caffe::Net::has_blob(std::string const&) const’未定义的引用
extract_features.cpp:(.text._Z27feature_extraction_pipelineIfEiiPPc[_Z27feature_extraction_pipelineIfEiiPPc]+0x8c1):对‘caffe::db::GetDB(std::string const&)’未定义的引用
extract_features.cpp:(.text._Z27feature_extraction_pipelineIfEiiPPc[_Z27feature_extraction_pipelineIfEiiPPc]+0xae3):对‘caffe::Net::blob_by_name(std::string const&) const’未定义的引用
collect2: 错误: ld 返回 1
make: * [.build_release/tools/extract_features.bin] 错误 1
.build_release/tools/caffe.o:在函数‘test()’中:
caffe.cpp:(.text+0xa93):对‘caffe::Net::Net(std::string const&, caffe::Phase)’未定义的引用
.build_release/tools/caffe.o:在函数‘time()’中:
caffe.cpp:(.text+0x2823):对‘caffe::Net::Net(std::string const&, caffe::Phase)’未定义的引用
caffe.cpp:(.text+0x2d49):对‘caffe::Timer::MicroSeconds()’未定义的引用
caffe.cpp:(.text+0x3121):对‘caffe::Timer::MicroSeconds()’未定义的引用
caffe.cpp:(.text+0x3201):对‘caffe::Timer::MicroSeconds()’未定义的引用
caffe.cpp:(.text+0x3c59):对‘caffe::Timer::MicroSeconds()’未定义的引用
.build_release/tools/caffe.o:(.data.rel.ro._ZTVN5caffe9SGDSolverIfEE[_ZTVN5caffe9SGDSolverIfEE]+0x40):对‘caffe::SGDSolver::ClipGradients()’未定义的引用
.build_release/tools/caffe.o:(.data.rel.ro._ZTVN5caffe14NesterovSolverIfEE[_ZTVN5caffe14NesterovSolverIfEE]+0x40):对‘caffe::SGDSolver::ClipGradients()’未定义的引用
.build_release/tools/caffe.o:(.data.rel.ro._ZTVN5caffe13AdaGradSolverIfEE[_ZTVN5caffe13AdaGradSolverIfEE]+0x40):对‘caffe::SGDSolver::ClipGradients()’未定义的引用
collect2: 错误: ld 返回 1
make: * [.build_release/tools/caffe.bin] 错误 1
.build_release/examples/cifar10/convert_cifar_data.o:在函数‘convert_dataset(std::string const&, std::string const&, std::string const&)’中:
convert_cifar_data.cpp:(.text+0xb7):对‘caffe::db::GetDB(std::string const&)’未定义的引用
convert_cifar_data.cpp:(.text+0x6a2):对‘caffe::db::GetDB(std::string const&)’未定义的引用
collect2: 错误: ld 返回 1
make: * [.build_release/examples/cifar10/convert_cifar_data.bin] 错误
解决方法:,清除/usr/lib/libcaffe.so(之前安装过caffe可能会处这个问题)
没有更多推荐了,opencv移植到tq2440
一、编译环境及库文件linux环境:ubuntu-10.10交叉编译:4.3.3arm板子:tq2440libz:
zlib-1.2.7libjpeg:
jpegsrc.v7libpng:
libpng-1.5.10libyasm:
yasm-1.2.0opencv:
opencv-1.0.0libx264:
x264-snapshot-5libxvid:
xvidcore-1.3.2lffmpeg:
ffmpeg-0.10.3二、opencv-2.4.1的移植过程1、libz的交叉编译:#CC=arm-linux-gcc ./configure --prefix=/opt/EmbedSky/4.3.3/arm-none-linux-gnueabi --shared#make #make install2、libjpeg的交叉编译:#./configure --host=arm-linux --prefix=/opt/EmbedSky/4.3.3/arm-none-linux-gnueabi --enable-shared --enable-static#make install3、libpng的交叉编译#./configure --host=arm-linux --prefix=/opt/EmbedSky/4.3.3/arm-none-linux-gnueabi --enable-shared --enable-static #make#make install4、yasm的交叉编译:#./configure --host=arm-linux --prefix=/opt/EmbedSky/4.3.3/arm-none-linux-gnueabi --enable-shared --enable-static #make#make install5、libx264的交叉编译:#CC=arm-linux-gcc ./configure --enable-shared --host=arm-linux --disable-asm --prefix=/opt/EmbedSky/4.3.3/arm-none-linux-gnueabi#make#make install6、libxvid的交叉编译:#cd build/generic#./configure --prefix=/opt/EmbedSky/4.3.3/arm-none-linux-gnueabi --host=arm-linux
--disable-assembly#make#make install7、ffmpeg的交叉编译:#./configure --prefix=/opt/EmbedSky/4.3.3/arm-none-linux-gnueabi --enable-shared --disable-static --enable-gpl --enable-cross-compile --arch=arm --disable-stripping
--target-os=linux --enable-libx264 --enable-libxvid --cc=arm-linux-gcc --enable-swscale#make#make install8、opencv2.4.1的交叉编译:用到的主要目录说明:交叉编译工具链所在目录
/opt/EmbedSky/4.3.3/安装opencv的目录
/opt/EmbedSky/4.3.3/arm-none-linux-gnueabi/opencv源码所在目录
/srv/sdk_tq2440/lib/OpenCV-2.4.1/编译好的opencv库所在目录
/srv/sdk_tq2440/lib/OpenCV-2.4.1/build#mkdir build#cd build#cmake-gui选择源代码目录:/srv/sdk_tq2440/lib/OpenCV-2.4.1/选择Build目录:/srv/sdk_tq2440/lib/OpenCV-2.4.1/build点击Configure,保持generator为Unix Makefiles,选择Specify options for cross-compiling,点击Next,Operating System填写arm-linuxC Compilers填写/opt/EmbedSky/4.3.3/bin/arm-linux-gccC++ Compilers填写/opt/EmbedSky/4.3.3/bin/arm-linux-g++程序库的Target Root填写/opt/EmbedSky/4.3.3/然后点击Finish。修改默认配置,默认安装目录为/usr/local,为便于查找生成的库文件,把CMAKE_INSTALL_PREFIX变量改为/opt/EmbedSky/4.3.3/arm-none-linux-gnueabi/,点击Generate生成Makefile。#make错误一:Linking CXX executable ../../bin/opencv_createsamples../../lib/libopencv_core.so: undefined reference to `clock_gettime'../../lib/libopencv_highgui.so: undefined reference to `_TIFFerrorHandler'../../lib/libopencv_highgui.so: undefined reference to `_TIFFrealloc'../../lib/libopencv_core.so: undefined reference to `pthread_key_create解决方法:修改CMakeCache.txt,CMAKE_EXE_LINKER_FLAGS原来为空,加上-lpthread -lrt,重新编译,错误消除错误二:Linking CXX executable ../../bin/opencv_createsamples../../lib/libopencv_highgui.so: undefined reference to `_TIFFerrorHandler'../../lib/libopencv_highgui.so: undefined reference to `_TIFFrealloc'../../lib/libopencv_highgui.so: undefined reference to `_TIFFmalloc'../../lib/libopencv_highgui.so: undefined reference to `_TIFFmemcpy'../../lib/libopencv_highgui.so: undefined reference to `TIFFOpen'../../lib/libopencv_highgui.so: undefined reference to `_TIFFfree'../../lib/libopencv_highgui.so: undefined reference to `_TIFFwarningHandler'../../lib/libopencv_highgui.so: undefined reference to `_TIFFmemcmp'../../lib/libopencv_highgui.so: undefined reference to `_TIFFmemset'
解决方法:修改CMakeCache.txt,WITH_TIFF:BOOL=ON,改成OFF,重新编译,错误消除。#make install三、测试测试程序:#include &cv.h&
#include &cxcore.h&
#include &highgui.h&
int main(int argc,char **argv)
CvCapture* capture = NULL;
IplImage* frame = NULL;
if(!(capture = cvCaptureFromCAM(-1)))
fprintf(stderr, "Can not open camera./n");
return -1;
cvNamedWindow("video", 1);
while(frame = cvQueryFrame( capture ) )
cvShowImage("video", frame);
cvDestroyWindow("video");
cvReleaseCapture(&capture);
编译:#arm-linux-g++ -o opencv_test opencv_test.cpp -I /opt/EmbedSky/4.3.3/arm-none-linux-gnueabi/include/opencv -L /opt/EmbedSky/4.3.3/arm-none-linux-gnueabi/lib -lopencv_core
-lopencv_highgui -lpthread -lrtopencv库编译参考了http://blog.csdn.net/sun_x_t/article/details/7261944 。
扫码向博主提问
非学,无以致疑;非问,无以广识
擅长领域:
嵌入式软件
没有更多推荐了,关于cmake找不到库文件的问题
[问题点数:40分,结帖人u]
本版专家分:0
结帖率 66.67%
CSDN今日推荐
本版专家分:0
本版专家分:368798
2017年 总版技术专家分年内排行榜第一
2014年 总版技术专家分年内排行榜第二
2013年 总版技术专家分年内排行榜第三
2012年 总版技术专家分年内排行榜第七
本版专家分:368798
2017年 总版技术专家分年内排行榜第一
2014年 总版技术专家分年内排行榜第二
2013年 总版技术专家分年内排行榜第三
2012年 总版技术专家分年内排行榜第七
本版专家分:0
本版专家分:368798
2017年 总版技术专家分年内排行榜第一
2014年 总版技术专家分年内排行榜第二
2013年 总版技术专家分年内排行榜第三
2012年 总版技术专家分年内排行榜第七
本版专家分:0
匿名用户不能发表回复!|
其他相关推荐
用cmake编译时出现如下错误提示:CMake Error at CMakeLists.txt:313 (FIND_PACKAGE):
By not providing &FindQt5WebKit.cmake& in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file prov...
CMake如何查找库路径(一)cmake module
1, 添加环境变量
export PATH=/home/relaybot/cmake-3.2.2/bin:$PATH
2,创建软连接
ln -s /home/relaybot/cmake-3.2.2/bin/cmake /usr/bin/cmake
原文链接:http://blog.atime.me/note/cmake.html
CMake使用总结
总结CMake的常用命令,并介绍有用的CMake资源。
CMake意为cross-platform make,可用于管理c/c++工程。CMake解析配置文件CMakeLists.txt生成Makefile,相比直接用Makefile管理工程,CMake更灵
http://my.oschina.net/xu01/blog/17330 不错的文章,MARK点击打开链接
1. target_link_libraries
设置要连接库文件的名称
TARGET_LINK_LIBRARIES(main hello),连接libhello.so库
TARGET_LINK_LIBRARIES(main libhello.a
libboost_filesystem.so libboost_system.so)
TARGET_LINK_LIBRAR
可能会有朋友遇到cmake无法下载的问题,studio报错:unable to get the cmake version located at .....
就是因为ndk编译,android studio会默认使用cmake来编译,淘汰了android.mk的使用。不要问我为什么,我也不知道。。。
遇到这个问题,当然第一时间就是去sdk manager下载cmake,但是sdk manage
最近需要使用cmake 2.8以上的版本,记录下安装流程:
下载地址:www.cmake.org,当前最新版本2.8.12.1。文件夹名:cmake-2.8.12.1
推荐安装到/usr中,
复制cmake-2.8.12.1到/usr中。
// 1、解压
tar zxvf cmake-2.8.12.1.tar.gz
// 2、进入cmake-2.8.12.1文件夹中安装
LINK_LIBRARY似乎是一个需要避免的命令, 取而代之的是FIND_LIBRARY, 其基本用法是
#在指定目录下搜索一个库, 保存在变量MY_LIB中
FIND_LIBRARY(MY_LIB libmylib.a ./)
#链接这个库
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${MY_LIB})

我要回帖

更多关于 rpgxp出现undefined 的文章

 

随机推荐