本文介绍了libcvd-对"x ..."的未定义引用在编译C ++时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建libCVD以便与ROS一起使用(来自www.ros.org).我的问题是出现以下错误:

I am trying to build libCVD in order to use with ROS (from www.ros.org).My Problem is that I am getting the following errors:

make[3]: Entering directory `/opt/ros/groovy/stacks/tum_ardrone/thirdparty/libcvd/build'
/usr/bin/g++-4.6 -o progs/cvd_display_image progs/cvd_display_image.o -L. -lcvd  -ltiff -ljpeg -lpng -lpng -llapack -lGLU -lGL -lrt  -L -lX11 -lXext -pthread

./libcvd.so: undefined reference to `XMoveWindow'
./libcvd.so: undefined reference to `XCreateGlyphCursor'
./libcvd.so: undefined reference to `XStoreName'
./libcvd.so: undefined reference to `XLookupString'
./libcvd.so: undefined reference to `XFreeFont'
./libcvd.so: undefined reference to `XSetClassHint'
./libcvd.so: undefined reference to `XCreateWindow'
./libcvd.so: undefined reference to `XCreateColormap'
./libcvd.so: undefined reference to `XOpenDisplay'
./libcvd.so: undefined reference to `XDestroyWindow'
./libcvd.so: undefined reference to `XCloseDisplay'
./libcvd.so: undefined reference to `XUnmapWindow'
./libcvd.so: undefined reference to `XNextEvent'
./libcvd.so: undefined reference to `XSetWMProtocols'
./libcvd.so: undefined reference to `XResizeWindow'
./libcvd.so: undefined reference to `XMapWindow'
./libcvd.so: undefined reference to `XSelectInput'
./libcvd.so: undefined reference to `XFlush'
./libcvd.so: undefined reference to `XWarpPointer'
./libcvd.so: undefined reference to `XLoadQueryFont'
./libcvd.so: undefined reference to `XDefineCursor'
./libcvd.so: undefined reference to `XInternAtom'
./libcvd.so: undefined reference to `XQueryPointer'
./libcvd.so: undefined reference to `XUndefineCursor'
./libcvd.so: undefined reference to `XGetWindowAttributes'
./libcvd.so: undefined reference to `XPending'
collect2: ld returned 1 exit status
make[3]: *** [progs/cvd_display_image] Error 1
make[3]: Leaving directory `/opt/ros/groovy/stacks/tum_ardrone/thirdparty/libcvd/build'
make[2]: *** [libcvd_built] Error 2

还有另一个stackoverflow问题,其错误几乎相似(未定义参考编译libcvd时出错).

There is an other stackoverflow question with nearly similar errors (undefined reference error while compiling libcvd).

我试图像建议的那样找出为什么第二个-L选项没有给出路径.因此,我最终进入了项目configure.in文件,在该文件中我认为该错误发生了.但是我没有这个构建系统的经验,所以帮助会很棒.

I tried like it is suggested there to find out why there is no path given with the second -L option. So I ended up in the projects configure.in file, where I believe the error happens.But I have no experience with this build system, so help would be great.

configure.in文件位于 https://dl.dropboxusercontent.com /u/16804463/configure.in

The configure.in file is available under https://dl.dropboxusercontent.com/u/16804463/configure.in

谢谢.

推荐答案

我有类似的错误.我意识到libcvd似乎依赖于以下3个库.

I had similar errors. I realised that the libcvd seems to be dependent on the following 3 libraries.

  • lapack
  • blas
  • 卡通

这些都是数学库.从Ubuntu软件中心安装Synaptic软件包管理器. (假设您使用的是ubuntu-如果您不使用ubuntu,则可以使用apt-get或其他方式安装软件包)

These are all mathematical libraries. Install Synaptic Package Manager from Ubuntu Software Center. (assuming u are using ubuntu - if you are not you can use apt-get or some other way of installing the packages)

从Synaptic软件包管理器中,搜索以下软件包:

From Synaptic Package Manager, search for the following packages :

  • liblapack-dev
  • libblas-dev

并安装.

安装TooN:git clone git clone git://github.com/edrosten/TooN.git无论您将其克隆到哪个目录,都将创建一个TooN目录.导航到TooN目录,然后输入:

Install TooN : git clone git clone git://github.com/edrosten/TooN.gitThis will create a TooN directory wherever you cloned it to. Navigate to the TooN directory and type :

./configure

./configure

制作

进行安装

希望这会有所帮助.

这篇关于libcvd-对"x ..."的未定义引用在编译C ++时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 15:38