1
votes

I'm developing some apps in ROS (Robot Operating System), and am running into a problem with the linking stage.

When building an app in ROS, it links with OpenCV 2.4.9. The problem is that I have a personal library of functions, which we shall call MyLibrary that links with OpenCV 3.1.

Is it possible to create a ROS app that links with OpenCV 2.4.9 and MyLibrary (which links against OpenCV 3.1)?

All of this build environment is under my control except the version of ROS we are using. I cannot upgrade ROS (at least now) to a version that utilizes OpenCV 3.1. Is there anything I can do here?

My only thought is to configure MyLibrary so that it supports OpenCV 2.4.9 and OpenCV 3.1? This way I would just build MyLibrary for the ROS apps with the same version ROS is using, and there should be no conflicts. This is kind of a pain in the ass though... Is there something else that can be done with the build structure to support this?

1
Is it possible/allowed in your environment to link statically to OpenCV? - Anedar
I'm not a true software engineer, so I only understand static/shared linking rather superficially. However, I should be able to setup static linking with MyLibrary, I'm a bit uncertain if this would be possible with the ROS portion though. - matt
Sorry, mean to say... how would this help? Assuming it was possible, would that solve the problem? - matt
Make MyLibrary work with OpenCV 2.4.9. Anything else will be a headache at the best, even more so if your knowledge is limited. - Dan MaĊĦek
Dan is right. There's a second option, however. If your code is a node, you could try to either remove/replace the dependency that pulls in OpenCV 2.4 (e.g. if you use cv_bridge, remove it) or rebuild it locally with OpenCV 3.1 (note that this may require patching and may start in a chain-reaction where you would have to migrate other packages ... may not be possible to take it to the end). - dseifert

1 Answers