Coder Social home page Coder Social logo

Linking in cmake about rc_genicam_api HOT 4 OPEN

roboception avatar roboception commented on September 26, 2024
Linking in cmake

from rc_genicam_api.

Comments (4)

heikohimu avatar heikohimu commented on September 26, 2024

Looks like it fails, because you built and installed the package for a non-standard location. It cannot find the library there. I agree that it should work, I am just not sure how to fix it. But even if building would work, you would need to set the LD_LIBRARY_PATH to /opt/rc_genicam/lib to find the library at runtime of your program.

As workaround, you could run cmake with CMAKE_INSTALL_PREFIX=/usr which is the default. /usr/local may also work. If you are working on Ubuntu, you may also do 'make package' for building a package that you can nicely install and de-install.

from rc_genicam_api.

MyronRodrigues-StreetDrone avatar MyronRodrigues-StreetDrone commented on September 26, 2024

I'm not sure if LD_LIBRARY_PATH is necessary, the HINT pointed out find_package in the right place as you see the message() outputs below. The only part missing is the librc_genicam_api.so in the rc_genicam_api/lib directory which is appended as a whole in the ${RC_GENICAM_API_LIBRARIES}" instead of the shared object.
A fix in the cmakelists should do it i think, but my knowledge is limited there.

found RCG includes: /opt/rc_genicam/include;/opt/rc_genicam/include/rc_genicam_api/genicam
found RCG libs: /opt/rc_genicam/lib/libGCBase_gcc48_v3_3.so;/opt/rc_genicam/lib/libGenApi_gcc48_v3_3.so;/opt/rc_genicam/lib/liblog4cpp_gcc48_v3_3.so;/opt/rc_genicam/lib/libLog_gcc48_v3_3.so;/opt/rc_genicam/lib/libMathParser_gcc48_v3_3.so;/opt/rc_genicam/lib/libNodeMapData_gcc48_v3_3.so;/opt/rc_genicam/lib/libXmlParser_gcc48_v3_3.so;rc_genicam_api
-- Configuring done
-- Generating done
-- Build files have been written to: /home/myron/dev/cam-share/build

output of ls /opt/rc_genicam/lib

libGCBase_gcc48_v3_3.so      libNodeMapData_gcc48_v3_3.so
libGenApi_gcc48_v3_3.so      librc_genicam_api.so
liblog4cpp_gcc48_v3_3.so     librc_genicam_api.so.2.5
libLog_gcc48_v3_3.so         libXmlParser_gcc48_v3_3.so
libMathParser_gcc48_v3_3.so  rc_genicam_api

Also the install prefix was intentional, I prefer keeping non os libraries in /opt instead of /usr.

from rc_genicam_api.

heikohimu avatar heikohimu commented on September 26, 2024

Yes, for compiling, there is just "rc_genicam_api" as library given in the RC_GENICAM_API_LIBRARIES variable. This only works if the lib can be found, e.g. in a standard location. I agree that this should also work when installing the package to another location as you did.

However, for execution, your program needs to know where the shared libraries are. This is normally not compiled into your program (i.e. via rpath), but your program will look into the system locations (e.g. /usr/lib) and also check the LD_LIBRARY_PATH variable. If it cannot find the library there, then you program wont run. This runtime issue has nothing to do with cmake and the issue above. Thats why I would suggest putting the rc_genicam_api package into a standard location.

from rc_genicam_api.

MyronRodrigues-StreetDrone avatar MyronRodrigues-StreetDrone commented on September 26, 2024

Just made that PR which saves the user from manually setting the LD_LIBRARY_PATH. I avoid using it after reading this

For the linking problem I think it could be line 87 in cmake/PROJECTConfig.cmake.in. The @PROJECT_LIBRARIES@ translates to rc_genicam_api instead of the actual targets. I'm not sure how to solve it though, tried a few things but no results that work.

list(APPEND @PROJECT_NAME_UPPER@_LIBRARIES @PROJECT_LIBRARIES@)

from rc_genicam_api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.