Question on linking osgEarth library #2215
Unanswered
faculaganymede
asked this question in
Support Q&A
Replies: 1 comment
-
Hi. osgEarth uses the newer "Config" approach for CMake integration. Something like this should work. find_package(OpenSceneGraph REQUIRED COMPONENTS osg osgDB osgGA osgUtil osgViewer)
find_package(osgEarth CONFIG REQUIRED)
...
target_link_libraries(${PROJECT_NAME} PRIVATE osgEarth)
target_link_libraries(${PROJECT_NAME} PRIVATE ${OPENSCENEGRAPH_LIBRARIES}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
osgEarth Gurus,
I have osgEarth 3.3 installed via vcpkg on Red Hat Linux 7.9. I created a very simple program to test that all the libraries are linking correctly. Below are my main code and CMakeLists.txt. This code compiles, builds, and runs OK.
However,
target_link_libraries(${PROJECT_NAME} ... /home/facula/osgearth/build/lib/libosgEarth.so)
is the only way I can get the code to compile and build. Is that the correct way to link the osgEarth library?I tried these other approaches but they all resulted in linking errors:
main.cpp
CMakeLists.txt
Beta Was this translation helpful? Give feedback.
All reactions