#下载源码
git clone "https://github.com/lagadic/visp.git"
#work目录
mkdir work
#build目录
mkdir build
#cmake配置
cd work

ccmake ../visp    # 关闭动态库,设置为debug模式, output目录为上面的build目录
cmake ../visp
cd ../visp
make -j

#写了一个简单的test.so, 用于python上测试
g++ -o test.o -c test.cpp -I"/data/ahfuzhang/visp/build/include" -std=c++11 -fPIC
#链接
g++ -shared -o libtest.so test.o /data/ahfuzhang/visp/build/lib64/*.a
python中执行报错:
Cannot find reference 'xxx'  in libtest.so

#执行ldd检查链接情况:
ldd -r libtest.so

ldd -r libtest1.so
linux-vdso.so.1 => (0x00007ffe5e1f7000)
/$LIB/libonion.so => /lib64/libonion.so (0x00007fae7bf1a000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fae7b846000)
libm.so.6 => /lib64/libm.so.6 (0x00007fae7b544000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fae7b32e000)
libc.so.6 => /lib64/libc.so.6 (0x00007fae7af6c000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fae7ad68000)
/lib64/ld-linux-x86-64.so.2 (0x00007fae7be03000)
undefined symbol: _ZN9vpDisplay20setDownScalingFactorEj (./libtest1.so)
undefined symbol: _ZN9vpDisplay20setDownScalingFactorENS_11vpScaleTypeE (./libtest1.so)
undefined symbol: _ZTI9vpDisplay (./libtest1.so)
undefined symbol: _ZTVN2cv11_InputArrayE (./libtest1.so)
undefined symbol: _ZTVN2cv12_OutputArrayE (./libtest1.so)
undefined symbol: XDrawString (./libtest1.so)
undefined symbol: XLoadFont (./libtest1.so)
undefined symbol: _ZN2cv3Mat10deallocateEv (./libtest1.so)
undefined symbol: XMoveWindow (./libtest1.so)
undefined symbol: _ZN16vpRotationMatrixC1ERK14vpThetaUVector (./libtest1.so)
undefined symbol: _ZN19vpHomogeneousMatrix6insertERK19vpTranslationVector (./libtest1.so)
undefined symbol: cvPutText (./libtest1.so)
undefined symbol: XClearWindow (./libtest1.so)
undefined symbol: cvRectangle (./libtest1.so)
undefined symbol: cvGetTextSize (./libtest1.so)
undefined symbol: XStoreName (./libtest1.so)
undefined symbol: XLookupString (./libtest1.so)
undefined symbol: _ZN13vpImageFilter15getGradXGauss2DERK7vpImageIhERS0_IdEPKdS7_j (./libtest1.so)
undefined symbol: XCreateImage (./libtest1.so)
undefined symbol: _ZNK18vpCameraParameters13get_K_inverseEv (./libtest1.so)
undefined symbol: _ZN2cv8Subdiv2D6insertENS_6Point_IfEE (./libtest1.so)
undefined symbol: _ZN7vpPlaneaSERKS_ (./libtest1.so)
undefined symbol: XSetFont (./libtest1.so)
undefined symbol: _ZN13vpImageFilter6filterERK7vpImageIhERS0_IdEPKdj (./libtest1.so)
undefined symbol: _ZN6vpTime4waitEd (./libtest1.so)
undefined symbol: _ZN9vpDisplayD2Ev (./libtest1.so)
undefined symbol: cvCircle (./libtest1.so)
undefined symbol: cvSetMouseCallback (./libtest1.so)
undefined symbol: XCreateSimpleWindow (./libtest1.so)
undefined symbol: XCreateColormap (./libtest1.so)
undefined symbol: dgesdd_ (./libtest1.so)
undefined symbol: XOpenDisplay (./libtest1.so)
undefined symbol: _ZNK2cv3Mat3invEi (./libtest1.so)
undefined symbol: XDrawPoint (./libtest1.so)
undefined symbol: XImageByteOrder (./libtest1.so)
undefined symbol: XCopyArea (./libtest1.so)
undefined symbol: XDrawLine (./libtest1.so)
undefined symbol: XDestroyWindow (./libtest1.so)
undefined symbol: cvReleaseImage (./libtest1.so)
undefined symbol: XCloseDisplay (./libtest1.so)
undefined symbol: XFillArc (./libtest1.so)
undefined symbol: _ZN2cv13projectPointsERKNS_11_InputArrayES2_S2_S2_S2_RKNS_12_OutputArrayES5_d (./libtest1.so)
undefined symbol: XSetForeground (./libtest1.so)
undefined symbol: XFillRectangle (./libtest1.so)
undefined symbol: _ZN13vpImageFilter17getGaussianKernelEPdjdb (./libtest1.so)
undefined symbol: _ZN8vpRobustC1Ej (./libtest1.so)
undefined symbol: XFreeGC (./libtest1.so)
undefined symbol: _ZN7vpPlaneC1Ev (./libtest1.so)
undefined symbol: cvNamedWindow (./libtest1.so)
undefined symbol: XDisplayName (./libtest1.so)
undefined symbol: XDrawRectangle (./libtest1.so)
undefined symbol: _ZN19vpHomogeneousMatrix9buildFromEdddddd (./libtest1.so)
undefined symbol: XBitmapPad (./libtest1.so)
undefined symbol: XSetLineAttributes (./libtest1.so)
undefined symbol: XClearArea (./libtest1.so)
undefined symbol: _ZNK2cv8Subdiv2D15getTriangleListERSt6vectorINS_3VecIfLi6EEESaIS3_EE (./libtest1.so)
undefined symbol: _ZN13vpImageFilter27getGaussianDerivativeKernelEPdjdb (./libtest1.so)
undefined symbol: cvMoveWindow (./libtest1.so)
undefined symbol: XCheckMaskEvent (./libtest1.so)
undefined symbol: dgetrf_ (./libtest1.so)
undefined symbol: XMapWindow (./libtest1.so)
undefined symbol: cvDestroyWindow (./libtest1.so)
undefined symbol: cvLine (./libtest1.so)
undefined symbol: _ZN2cv3Mat8copySizeERKS0_ (./libtest1.so)
undefined symbol: cvCreateImage (./libtest1.so)
undefined symbol: _ZN2cv11determinantERKNS_11_InputArrayE (./libtest1.so)
undefined symbol: cvWaitKey (./libtest1.so)
undefined symbol: XSetWindowBackground (./libtest1.so)
undefined symbol: XCreateGC (./libtest1.so)
undefined symbol: XSelectInput (./libtest1.so)
undefined symbol: _ZNK7vpPlane9getNormalER11vpColVector (./libtest1.so)
undefined symbol: XFlush (./libtest1.so)
undefined symbol: _ZN2cv3Mat3eyeEiii (./libtest1.so)
undefined symbol: _ZN13vpImageFilter17getGaussPyramidalERK7vpImageIhERS1_ (./libtest1.so)
undefined symbol: XSync (./libtest1.so)
undefined symbol: XMaskEvent (./libtest1.so)
undefined symbol: _ZN2cv8Subdiv2DC1ENS_5Rect_IiEE (./libtest1.so)
undefined symbol: _ZN2cv3SVDclERKNS_11_InputArrayEi (./libtest1.so)
undefined symbol: XPutImage (./libtest1.so)
undefined symbol: _ZN2cv11_InputArrayC1ERKNS_7MatExprE (./libtest1.so)
undefined symbol: _ZN8vpRobust10MEstimatorENS_21vpRobustEstimatorTypeERK11vpColVectorRS1_ (./libtest1.so)
undefined symbol: _ZN2cv11_InputArrayC1ERKNS_3MatE (./libtest1.so)
undefined symbol: _ZN19vpHomogeneousMatrix6insertERK16vpRotationMatrix (./libtest1.so)
undefined symbol: cvShowImage (./libtest1.so)
undefined symbol: XInstallColormap (./libtest1.so)
undefined symbol: _ZN2cv7noArrayEv (./libtest1.so)
undefined symbol: XGetImage (./libtest1.so)
undefined symbol: XDrawArc (./libtest1.so)
undefined symbol: XSetWindowBackgroundPixmap (./libtest1.so)
undefined symbol: XAllocColor (./libtest1.so)
undefined symbol: XQueryPointer (./libtest1.so)
undefined symbol: _ZN9vpDisplayC2Ev (./libtest1.so)
undefined symbol: XSetStandardProperties (./libtest1.so)
undefined symbol: _ZN19vpHomogeneousMatrixC1Ev (./libtest1.so)
undefined symbol: XFreePixmap (./libtest1.so)
undefined symbol: _ZN13vpImageFilter15getGradYGauss2DERK7vpImageIhERS0_IdEPKdS7_j (./libtest1.so)
undefined symbol: _ZN19vpHomogeneousMatrixaSERKS_ (./libtest1.so)
undefined symbol: cvInitFont (./libtest1.so)
undefined symbol: _ZN2cv8fastFreeEPv (./libtest1.so)
undefined symbol: XCreatePixmap (./libtest1.so)
undefined symbol: _ZN2cv3Mat5zerosEiii (./libtest1.so)
undefined symbol: XStoreColor (./libtest1.so)
undefined symbol: _ZN14vpImageConvert7convertEPK9_IplImageR7vpImageI6vpRGBaEb (./libtest1.so)
undefined symbol: _ZN6vpRGBaaSERKS_ (./libtest1.so)
undefined symbol: XSetWindowColormap (./libtest1.so)
undefined symbol: _ZNK18vpCameraParameters5get_KEv (./libtest1.so)
undefined symbol: dgetri_ (./libtest1.so)
undefined symbol: _ZN9vpDisplay8setScaleENS_11vpScaleTypeEjj (./libtest1.so)

 

#最后逐个搜索库,然后用下面的参数解决:
g++ -shared -o libtest.so test.o -L"/data/ahfuzhang/visp/build/lib64" /data/ahfuzhang/visp/build/lib64/*.a -lstdc++ -lX11 -lopencv_core -lopencv_imgproc -lopencv_highgui -lvisp_core -lvisp_gui -lopencv_calib3d -L/usr/lib64/ "/usr/lib64/liblapack.so.3.4.2" 

linux下编译visp库的更多相关文章

  1. Linux下编译boost库和qt和ImageMagick

    需要把整个PCIE的工程移植到Linux下,当初就是用cmake来管理的工程的.但是命令行之类的还是需要改动.改动还不少,cmake里面很多东西都依赖于windows.包括我用cmake重新管理的工程 ...

  2. Linux下编译第三方库的问题

    因为各个Linux发行版之间的差异还是挺大的,有一些预安装在系统上的基本库是不一样的(不仅仅是版本,有一些是有和无的区别). 那么问题来了: 编译第三方库./configure的时候一般我们不会定制那 ...

  3. Linux下 编译lib3ds库

    从网上下载的一个QT程序链接需要用到lib3ds.a静态库. lib3ds is an overall software library for managing 3D-Studio Release ...

  4. linux下编译Boost库

    下载源码 boost_1_66_0.tar.gz 生成编译工具 # tar axf boost_1_66_0.tar.gz # cd boost_1_66_0 # yum install gcc gc ...

  5. linux下编译 静态库、动态库,动态库依赖静态库

    xx.o : xx.h xx.cpp -lstdc++ -o xx.o -c xx.cpp -I ./ libxx.a : xx.o ar -crv libxx.a xx.o libTest.so : ...

  6. linux下编译lua库

    编辑MakeFile INSTALL_TOP= /usr/local修改为目标install位置 执行 make linux make install 如果提示依赖libreadline  可以直接a ...

  7. linux下编译静态库openssl

    先编译zlib cmake . -DCMAKE_INSTALL_PREFIX=/depends make make install 然后编译openssl ./config zlib no-rc5 n ...

  8. linux下编译qt5.6.0静态库——configure配置

    linux下编译qt5.6.0静态库 linux下编译qt5.6.0静态库 configure生成makefile 安装选项 Configure选项 第三方库: 附加选项: QNX/Blackberr ...

  9. linux下编译安装boost库

    linux下编译安装boost库 linux下编译安装boost库 1.下载并解压boost 1.58 源代码 下载 解压 2.运行bootstrap.sh 3.使用b2进行构建 构建成功的提示 4. ...

随机推荐

  1. Webpack 4教程:为什么要优化代码

    转载请注明出处:葡萄城官网,葡萄城为开发者提供专业的开发工具.解决方案和服务,赋能开发者.原文出处:https://wanago.io/2018/07/30/webpack-4-course-part ...

  2. Your project path contains non-ASCII characters

    Android studio导入project时报错 non-ASCII characters意味着中文字符报错,解决方法简单有效: 检查项目路径中是否出现中文名,将中文字符修改成英文就可以解决辽~

  3. Linux下载_Linux系统各种版本ISO镜像下载(redhat,centos,oracle,ubuntu,openSUSE)

    以下是风哥收集的Linux系统各种版本ISO镜像下载,包括redhat,centos,oracle,ubuntu等linux操作系统. Linux下载1:红帽RedHat Linux(RHEL5.RH ...

  4. android 6.0 Intent 安装apk闪退

    需求描述: 利用android系统自带的DownloadManager下载apk文件,并且打开安装界面. 问题描述: 关于DownloadManager的使用网上有很多例子,在此不啰嗦.下载完成之后在 ...

  5. 安装composer时,提示 /usr/bin/env: php: 没有那个文件或目录

    今晚在Ubuntu环境上安装composer后,想查看下是否安装成功,使用composer -v,结果提示:/usr/bin/env: php: 没有那个文件或目录 现说说我的解决办法: 它提示的原因 ...

  6. 野指针与'关键字'NULL

    野指针与'关键字'NULL 一.NULL是什么? 在C/C++中的标准定义: #ifdef __cplusplus //条件编译,判断是c++还是c环境 #define NULL 0 //c++环境 ...

  7. 【spring源码分析】IOC容器初始化(十一)

    前言:前面分析了doCreateBean中的createBeanInstance函数,接下来分析其剩余流程. 首先贴上doCreateBean函数: // AbstractAutowireCapabl ...

  8. windows 和linux 路径解析的区别

    windows下使用的是“\”作为分隔符,而linux则反其道而行之使用"/"作为分隔符.所以在windows 环境中获取路径常见 C:\windows\system 的形式,而l ...

  9. python 中 try catch finally语句中含有return语句的执行情况

    无论是在try还是在except中,遇到return时,只要设定了finally语句,就会中断当前的return语句,跳转到finally中执行,如果finally中遇到return语句,就直接返回, ...

  10. 基于令牌桶算法实现的SpringBoot分布式无锁限流插件

    本文档不会是最新的,最新的请看Github! 1.简介 基于令牌桶算法和漏桶算法实现的纳秒级分布式无锁限流插件,完美嵌入SpringBoot.SpringCloud应用,支持接口限流.方法限流.系统限 ...