-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linking in cmake #35
Comments
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. |
I'm not sure if LD_LIBRARY_PATH is necessary, the 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 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 |
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. |
Just made that PR which saves the user from manually setting the For the linking problem I think it could be line 87 in list(APPEND @PROJECT_NAME_UPPER@_LIBRARIES @PROJECT_LIBRARIES@) |
Thank you for this library.
Installed v2.5.14 with the following flags
Been trying to link it in CMakeLists after installing into /opt/rc_genicam
CMakeLists.txt
on cmake.. i get
but make fails with
The text was updated successfully, but these errors were encountered: