catkin/catkin_simple

linking a non-catkin package

HyHuang1995 opened this issue · 3 comments

Hello,

I have an issue about linking a non-catkin package pangolin using catkin_simple. Since pangolin provides package.xml, intuitively I think it should work with catkin_simple. My catkin layout is set as merged. How I include pangolin in my package.xml is like:

<build_depend>pangolin</build_depend>

And the compiling error with catkin build my_pkg -j10 is like:

CMakeFiles/xodom_node.dir/node/xodom.cpp.o: In function `pangolin::GlBufferData::~GlBufferData()':
xodom.cpp:(.text._ZN8pangolin12GlBufferDataD2Ev[_ZN8pangolin12GlBufferDataD5Ev]+0x18): undefined reference to `__glewDeleteBuffers'
CMakeFiles/xodom_node.dir/node/xodom.cpp.o: In function `pangolin::GlBufferData::~GlBufferData()':
xodom.cpp:(.text._ZN8pangolin12GlBufferDataD0Ev[_ZN8pangolin12GlBufferDataD5Ev]+0x1c): undefined reference to `__glewDeleteBuffers'
CMakeFiles/xodom_node.dir/node/xodom.cpp.o: In function `pangolin::GlTexture::Reinitialise(int, int, int, bool, int, unsigned int, unsigned int, void*)':

It seems the headers are properly found, yet the libpangolin.so is not able to be linked.

I had made it with another non-catkin package sophus, yet it can be used in a header-only manner. I guess there might be some subtlties.

I know it would work if I write a catkin wrapper for it, but I just wonder is there any generic way to include a non-catkin package?

Many thanks!

And did you solve it?

@Gian-Alessio No. It seems not solvable.

@HyHuang1995 I solved it for my case! I had an external library consisting of headers and a static library foo.a And it seems to work now