Re: [osg-users] First recipe from cookbook won't compile with given source code

2019-01-18 Thread Rodrigo Dias
Thank you, Julien.

Though there are two different CMakeLists.txt files 
(https://github.com/xarray/osgRecipes/CMakeLists.txt and 
https://github.com/xarray/osgRecipes/tree/master/cookbook/CMakeLists.txt), I 
tried with the first one, because you said so. I had to give a value to the 
OPENSCENEGRAPH_LIB_DIR (/usr/local/lib64) in CMake, but it still gives me an 
error:


> Could NOT find OpenCV (missing:  OpenCV_ROOT_DIR OpenCV_LIBRARIES_RELEASE 
> OpenCV_LIBRARIES_DEBUG OpenCV_LIBRARIES) 
> Could NOT find ALVAR (missing:  ALVAR_ROOT_DIR ALVAR_INCLUDE_DIRS 
> ALVAR_LIBRARIES_RELEASE ALVAR_LIBRARIES_DEBUG ALVAR_LIBRARIES) 
> CMake Error: The following variables are used in this project, but they are 
> set to NOTFOUND.
> Please set them or make sure they are set and tested correctly in the CMake 
> files:
> GLEW_LIBRARY
> linked by target "osgnanovg" in directory 
> /home/rodrigo/Videos/osg/rodrigo/osgRecipes-master/integrations/osgnanovg
> 
> Configuring incomplete, errors occurred!
> See also 
> "/home/rodrigo/Videos/osg/rodrigo/osgRecipes-build/CMakeFiles/CMakeOutput.log".
> See also 
> "/home/rodrigo/Videos/osg/rodrigo/osgRecipes-build/CMakeFiles/CMakeError.log".
> 


And with this I cannot "make" or "make install" it. The readme gives an even 
more incomplete direction (say nothing about the OPENSCENEGRAPH_LIB_DIR 
variable, and why not use the default set by OSG?). Going the way I was going, 
I managed to compile and run most of the recipes in chapter 2. I wouldn't mind 
giving up one recipe or another just because I didn't install some obscure 
library. So, maybe using g++ is an easier option? (This includes me losing 
years with Borland Delphi, instead of learning and dominating C++ and CMake 
stuff. Shame on me!)

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75511#75511





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] First recipe from cookbook won't compile with given source code

2019-01-18 Thread Julien Valentin
Hi
use cmake with provided CMakelist.txt (https://github.com/xarray/osgRecipes)
Cheers

Rodrigo wrote:
> Hi,
> 
> I'm following the OpenSceneGraph 3 Cookbook 
> (http://ahux.narod.ru/olderfiles/1/OSG3_Cookbook.pdf) to learn more about 
> OSG. So I created a directory Cookbook following the directory structure from 
> the source code here 
> (https://github.com/xarray/osgRecipes/tree/master/cookbook).
> 
> Before compiling the first recipe 
> (https://github.com/xarray/osgRecipes/blob/master/cookbook/chapter2/ch02_01/observer_ptr.cpp),
>  I had copied the "Common Functions" from the textbook (pages 38-39), into a 
> file called "CommonFunctions". When compiling (with g++ on Linux) I got the 
> following error:
> 
> 
> > $ g++ observer_ptr.cpp -I../.. -losg -losgDB -losgGA -losgText -losgUtil 
> > -losgViewer -o observer_ptr
> > 
> > In file included from observer_ptr.cpp:11:0:
> > ../../CommonFunctions: In member function ‘virtual bool 
> > osgCookBook::PickHandler::handle(const osgGA::GUIEventAdapter&, 
> > osgGA::GUIActionAdapter&)’:
> > ../../CommonFunctions:47:62: error: binding ‘const 
> > osgUtil::LineSegmentIntersector::Intersection’ to reference of type 
> > ‘osgUtil::LineSegmentIntersector::Intersection&’ discards qualifiers
> >   osgUtil::LineSegmentIntersector::Intersection& result = 
> > *(intersector->getIntersections().begin());
> > 
> 
> 
> ../.. is the path to the CommonFunctions file. I tried a few const_cast 
> operations, but I don't have so much experience with C++ and couldn't solve 
> it. I commented out this two lines and the program compiled fine and ran, 
> though clicking on the objects wouldn't dismiss them (guess that's what these 
> lines do).
> 
> Then I noticed they have this "CommonFunctions" file together with the given 
> source code, so I replaced mine with theirs (CommonFunctions and 
> CommonFunctions.cpp). But when compiling, a new error:
> 
> 
> > $ g++ observer_ptr.cpp -I../.. -losg -losgDB -losgGA -losgText -losgUtil 
> > -losgViewer -o observer_ptr
> > 
> > /tmp/cca0xsAB.o: In function `main':
> > observer_ptr.cpp:(.text+0x79): undefined reference to 
> > `osgCookBook::createText(osg::Vec3f const&, 
> > std::__cxx11::basic_string, 
> > std::allocator > const&, float)'
> > observer_ptr.cpp:(.text+0x103): undefined reference to 
> > `osgCookBook::createHUDCamera(double, double, double, double)'
> > /tmp/cca0xsAB.o:(.data.rel.ro._ZTV18RemoveShapeHandler[_ZTV18RemoveShapeHandler]+0xb8):
> >  undefined reference to 
> > `osgCookBook::PickHandler::handle(osgGA::GUIEventAdapter const&, 
> > osgGA::GUIActionAdapter&)'
> > /tmp/cca0xsAB.o:(.data.rel.ro._ZTC18RemoveShapeHandler0_N11osgCookBook11PickHandlerE[_ZTV18RemoveShapeHandler]+0x18):
> >  undefined reference to `typeinfo for osgCookBook::PickHandler'
> > /tmp/cca0xsAB.o:(.data.rel.ro._ZTC18RemoveShapeHandler0_N11osgCookBook11PickHandlerE[_ZTV18RemoveShapeHandler]+0xb8):
> >  undefined reference to 
> > `osgCookBook::PickHandler::handle(osgGA::GUIEventAdapter const&, 
> > osgGA::GUIActionAdapter&)'
> > /tmp/cca0xsAB.o:(.data.rel.ro._ZTC18RemoveShapeHandler0_N11osgCookBook11PickHandlerE[_ZTV18RemoveShapeHandler]+0xe0):
> >  undefined reference to `typeinfo for osgCookBook::PickHandler'
> > /tmp/cca0xsAB.o:(.data.rel.ro._ZTC18RemoveShapeHandler0_N11osgCookBook11PickHandlerE[_ZTV18RemoveShapeHandler]+0x218):
> >  undefined reference to `typeinfo for osgCookBook::PickHandler'
> > /tmp/cca0xsAB.o:(.data.rel.ro._ZTC18RemoveShapeHandler0_N11osgCookBook11PickHandlerE[_ZTV18RemoveShapeHandler]+0x428):
> >  undefined reference to `typeinfo for osgCookBook::PickHandler'
> > /tmp/cca0xsAB.o:(.data.rel.ro._ZTI18RemoveShapeHandler[_ZTI18RemoveShapeHandler]+0x10):
> >  undefined reference to `typeinfo for osgCookBook::PickHandler'
> > collect2: error: ld returned 1 exit status
> > 
> 
> 
> Can anybody please tell me what am I doing wrong?
> 
> Thank you!
> 
> Cheers,
> Rodrigo



Twirling twirling twirling toward freedom

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75510#75510





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] First recipe from cookbook won't compile with given source code

2019-01-16 Thread Rodrigo Dias
Hi,

I'm following the OpenSceneGraph 3 Cookbook 
(http://ahux.narod.ru/olderfiles/1/OSG3_Cookbook.pdf) to learn more about OSG. 
So I created a directory Cookbook following the directory structure from the 
source code here (https://github.com/xarray/osgRecipes/tree/master/cookbook).

Before compiling the first recipe, I had copied the "Common Functions" from the 
textbook (pages 38-39), into a file called "CommonFunctions". When compiling 
(with g++ on Linux) I got the following error:


> $ g++ observer_ptr.cpp -I../.. -losg -losgDB -losgGA -losgText -losgUtil 
> -losgViewer -o observer_ptr
> 
> In file included from observer_ptr.cpp:11:0:
> ../../CommonFunctions: In member function ‘virtual bool 
> osgCookBook::PickHandler::handle(const osgGA::GUIEventAdapter&, 
> osgGA::GUIActionAdapter&)’:
> ../../CommonFunctions:47:62: error: binding ‘const 
> osgUtil::LineSegmentIntersector::Intersection’ to reference of type 
> ‘osgUtil::LineSegmentIntersector::Intersection&’ discards qualifiers
>   osgUtil::LineSegmentIntersector::Intersection& result = 
> *(intersector->getIntersections().begin());
> 


../.. is the path to the CommonFunctions file. I tried a few const_cast 
operations, but I don't have so much experience with C++ and couldn't solve it. 
I commented out this two lines and the program compiled fine and ran, though 
clicking on the objects wouldn't dismiss them (guess that's what these lines 
do).

Then I noticed they have this "CommonFunctions" file together with the given 
source code, so I replaced mine with theirs (CommonFunctions and 
CommonFunctions.cpp). But when compiling, a new error:


> $ g++ observer_ptr.cpp -I../.. -losg -losgDB -losgGA -losgText -losgUtil 
> -losgViewer -o observer_ptr
> 
> /tmp/cca0xsAB.o: In function `main':
> observer_ptr.cpp:(.text+0x79): undefined reference to 
> `osgCookBook::createText(osg::Vec3f const&, std::__cxx11::basic_string std::char_traits, std::allocator > const&, float)'
> observer_ptr.cpp:(.text+0x103): undefined reference to 
> `osgCookBook::createHUDCamera(double, double, double, double)'
> /tmp/cca0xsAB.o:(.data.rel.ro._ZTV18RemoveShapeHandler[_ZTV18RemoveShapeHandler]+0xb8):
>  undefined reference to 
> `osgCookBook::PickHandler::handle(osgGA::GUIEventAdapter const&, 
> osgGA::GUIActionAdapter&)'
> /tmp/cca0xsAB.o:(.data.rel.ro._ZTC18RemoveShapeHandler0_N11osgCookBook11PickHandlerE[_ZTV18RemoveShapeHandler]+0x18):
>  undefined reference to `typeinfo for osgCookBook::PickHandler'
> /tmp/cca0xsAB.o:(.data.rel.ro._ZTC18RemoveShapeHandler0_N11osgCookBook11PickHandlerE[_ZTV18RemoveShapeHandler]+0xb8):
>  undefined reference to 
> `osgCookBook::PickHandler::handle(osgGA::GUIEventAdapter const&, 
> osgGA::GUIActionAdapter&)'
> /tmp/cca0xsAB.o:(.data.rel.ro._ZTC18RemoveShapeHandler0_N11osgCookBook11PickHandlerE[_ZTV18RemoveShapeHandler]+0xe0):
>  undefined reference to `typeinfo for osgCookBook::PickHandler'
> /tmp/cca0xsAB.o:(.data.rel.ro._ZTC18RemoveShapeHandler0_N11osgCookBook11PickHandlerE[_ZTV18RemoveShapeHandler]+0x218):
>  undefined reference to `typeinfo for osgCookBook::PickHandler'
> /tmp/cca0xsAB.o:(.data.rel.ro._ZTC18RemoveShapeHandler0_N11osgCookBook11PickHandlerE[_ZTV18RemoveShapeHandler]+0x428):
>  undefined reference to `typeinfo for osgCookBook::PickHandler'
> /tmp/cca0xsAB.o:(.data.rel.ro._ZTI18RemoveShapeHandler[_ZTI18RemoveShapeHandler]+0x10):
>  undefined reference to `typeinfo for osgCookBook::PickHandler'
> collect2: error: ld returned 1 exit status
> 


Can anybody please tell me what am I doing wrong?

Thank you!

Cheers,
Rodrigo

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75500#75500





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org