OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

CMake can't find libraries


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General [forum]
View previous topic :: View next topic  
Author Message
Rodrigo
User


Joined: 01 Mar 2017
Posts: 24

PostPosted: Wed Jan 02, 2019 12:25 am    Post subject:
CMake can't find libraries
Reply with quote

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
View user's profile Send private message
LuisIzquierdo
Newbie


Joined: 05 Jan 2019
Posts: 1

PostPosted: Sat Jan 05, 2019 10:06 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Nathan Mielcarek
Guest





PostPosted: Tue Jan 08, 2019 5:40 am    Post subject:
CMake can't find libraries
Reply with quote

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

PostPosted: Tue Jan 08, 2019 11:41 am    Post subject:
Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General [forum] All times are GMT
Page 1 of 1

 
Jump to:  
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

Similar Topics
Topic Author Forum Replies Posted
No new posts OSG static v 3.6.3 CMake 3.12.4 + Vis... Serathin Build system [build] 0 Fri Feb 01, 2019 8:19 am View latest post
No new posts OSG static v 3.6.3 CMake 3.12.4 + Vis... Serathin Build system [build] 0 Sun Nov 25, 2018 8:52 pm View latest post
No new posts Unable to run example (QTCreator, CMa... Nirodha General [forum] 1 Wed Oct 31, 2018 11:04 pm View latest post
No new posts Could not find plugin to load objects sdef General [3rdparty] 1 Sat Oct 27, 2018 6:10 am View latest post
No new posts Enable Qt5Widgets_DIR into cmake (GUI) Andrea74 General 2 Wed Sep 05, 2018 7:40 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP