View previous topic :: View next topic |
|
Author |
Message |
Rodrigo User
Joined: 01 Mar 2017 Posts: 24
|
Posted: Wed Jan 02, 2019 12:25 am Post subject: CMake can't find libraries |
|
|
Hi,
I'm following OpenSceneGraph 3.0: Beginner's Guide, and right at page 44 there is a CMakeLists.txt that won't work. CMake is giving the following error message:
Quote:
|
Could NOT find OpenThreads (missing: OPENTHREADS_LIBRARY)
Could NOT find osg (missing: OSG_LIBRARY)
Could NOT find osgDB (missing: OSGDB_LIBRARY)
Could NOT find osgUtil (missing: OSGUTIL_LIBRARY)
Could NOT find osgViewer (missing: OSGVIEWER_LIBRARY)
Configuring done
|
The book says "make sure you have the OSG_ROOT environment variable set. Otherwise, the find_package() macro may not be able to find OSG installations correctly."
This variable is set to the directory of the build, the one which includes applications, bin, data, include, lib, packaging and src. However, the "include" directory only contains OpenThreads and osg, while /usr/local/include contains 18 directories (from a previous installation, I guess). Also, the OpenThreads in the build directory only contains two files: Config and Version, while the one in /usr/local/include contains 13 files. What have I done wrong?
Thank you!
Cheers,
Rodrigo |
|
Back to top |
|
 |
LuisIzquierdo Newbie
Joined: 05 Jan 2019 Posts: 1
|
Posted: Sat Jan 05, 2019 10:06 pm Post subject: |
|
|
Hi Rodrigo. I have exactly the same problem, with the same book in this page. I am using Ubuntu 18.04. I am able to compile osg but not to run the exmple in page 44.
...
Thank you!
Cheers,
Luis |
|
Back to top |
|
 |
Nathan Mielcarek Guest
|
Posted: Tue Jan 08, 2019 5:40 am Post subject: CMake can't find libraries |
|
|
Hi Rodrigo,
If you run make install from the build directory, all of the includes and libraries will go to the /usr/local/ directories and then you can set OSG_ROOT to /usr/local (although I believe it's already on the search path). It's good practice to not have multiple OSG versions on the search path as that can lead to potential issues.
-Nathan
On Tue, Jan 1, 2019 at 5:41 PM Rodrigo Dias < ( Only registered users can see emails on this board! Get registred or enter the forums! |
)> wrote:
Quote:
|
Hi,
I'm following OpenSceneGraph 3.0: Beginner's Guide (https://www.packtpub.com/game-development/openscenegraph-30-beginners-guide), and right at page 44 there is a CMakeLists.txt that won't work. CMake is giving the following error message:
Quote:
|
Could NOT find OpenThreads (missing: OPENTHREADS_LIBRARY)
Could NOT find osg (missing: OSG_LIBRARY)
Could NOT find osgDB (missing: OSGDB_LIBRARY)
Could NOT find osgUtil (missing: OSGUTIL_LIBRARY)
Could NOT find osgViewer (missing: OSGVIEWER_LIBRARY)
Configuring done
|
The book says "make sure you have the OSG_ROOT environment variable set. Otherwise, the find_package() macro may not be able to find OSG installations correctly."
This variable is set to the directory of the build, the one which includes applications, bin, data, include, lib, packaging and src. However, the "include" directory only contains OpenThreads and osg, while /usr/local/include contains 18 directories (from a previous installation, I guess). Also, the OpenThreads in the build directory only contains two files: Config and Version, while the one in /usr/local/include contains 13 files. What have I done wrong?
Thank you!
Cheers,
Rodrigo[/url]
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75371#75371
_______________________________________________
osg-users mailing list
(Only registered users can see emails on this board! Get registred or enter the forums! | )
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
|
------------------
Post generated by Mail2Forum |
|
Back to top |
|
 |
Rodrigo User
Joined: 01 Mar 2017 Posts: 24
|
Posted: Tue Jan 08, 2019 11:41 am Post subject: |
|
|
Hi,
Well, I formatted my computer and installed a new Debian version (9.6). Installed a fresh copy of OSG, but still got the same error. Probably there's some variable missing, but since nobody tells us which variable it is, I said "f*** cmake" and compiled from command line. I've tried adding an OSG_ROOT variable, pointing to /usr/local, /usr/local/lib and /usr/local/lib64. None worked.
This command line works:
Code:
|
g++ main.cpp -lOpenThreads -losg -losgDB -losgUtil -losgViewer -o main
|
Even this works:
Code:
|
g++ main.cpp -losg -losgDB -losgViewer -o main
|
Thank you!
Cheers,
Rodrigo |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
Powered by phpBB © 2001, 2005 phpBB Group
|