osgEarth 2.7 compilation

classic Classic list List threaded Threaded
4 messages Options
gmusjha gmusjha
Reply | Threaded
Open this post in threaded view
|

osgEarth 2.7 compilation

Good Morning,

I am trying to build omnet++ 5.4.1 on centos 7 virtual machine. This software needs osg and and osgEarth library. I was able to build and install osg 3.6.2. I am able to generate Makefile using cmake for osgEarth 2.7.


Out of curiosity, I searched this error. I have seen some suggestion like  include fstream. But I tend not buy that in this case.

However once I use make I get  error below. Since this library must have been compiled thousands of time daily on this planet I am under the assumption that I might be missing some small things.
I was hoping to get some guidance.

Thank you.
Regards,
gmusjha



make clean ;make
[  0%] Generating AutoGenShaders.cpp
Scanning dependencies of target osgEarth
[  0%] Building CXX object src/osgEarth/CMakeFiles/osgEarth.dir/tinystr.cpp.o
[  1%] Building CXX object src/osgEarth/CMakeFiles/osgEarth.dir/tinyxml.cpp.o
[  1%] Building CXX object src/osgEarth/CMakeFiles/osgEarth.dir/tinyxmlerror.cpp.o
[  1%] Building CXX object src/osgEarth/CMakeFiles/osgEarth.dir/tinyxmlparser.cpp.o
[  1%] Building CXX object src/osgEarth/CMakeFiles/osgEarth.dir/AlphaEffect.cpp.o
[  1%] Building CXX object src/osgEarth/CMakeFiles/osgEarth.dir/AutoScale.cpp.o
[  1%] Building CXX object src/osgEarth/CMakeFiles/osgEarth.dir/Bounds.cpp.o
[  2%] Building CXX object src/osgEarth/CMakeFiles/osgEarth.dir/Cache.cpp.o
In file included from /usr/local/include/osgDB/Output:20:0,
                 from /usr/local/include/osgDB/DotOsgWrapper:21,
                 from /usr/local/include/osgDB/Registry:26,
                 from /usr/local/include/osgDB/FileUtils:17,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Cache.cpp:24:
/usr/local/include/osgDB/fstream:34:30: error: invalid use of incomplete type ‘std::ifstream {aka class std::basic_ifstream<char>}’
 class ifstream : public std::ifstream
                              ^
In file included from /usr/include/c++/4.8.2/ios:38:0,
                 from /usr/include/c++/4.8.2/ostream:38,
                 from /usr/local/include/osg/Notify:20,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Notify:24,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Common:24,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Cache:26,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Cache.cpp:19:
/usr/include/c++/4.8.2/iosfwd:111:11: error: declaration of ‘std::ifstream {aka class std::basic_ifstream<char>}’
     class basic_ifstream;
           ^
In file included from /usr/local/include/osgDB/Output:20:0,
                 from /usr/local/include/osgDB/DotOsgWrapper:21,
                 from /usr/local/include/osgDB/Registry:26,
                 from /usr/local/include/osgDB/FileUtils:17,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Cache.cpp:24:
/usr/local/include/osgDB/fstream:46:30: error: invalid use of incomplete type ‘std::ofstream {aka class std::basic_ofstream<char>}’
 class ofstream : public std::ofstream
                              ^
In file included from /usr/include/c++/4.8.2/ios:38:0,
                 from /usr/include/c++/4.8.2/ostream:38,
                 from /usr/local/include/osg/Notify:20,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Notify:24,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Common:24,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Cache:26,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Cache.cpp:19:
/usr/include/c++/4.8.2/iosfwd:114:11: error: declaration of ‘std::ofstream {aka class std::basic_ofstream<char>}’
     class basic_ofstream;
           ^
make[2]: *** [src/osgEarth/CMakeFiles/osgEarth.dir/Cache.cpp.o] Error 1
make[1]: *** [src/osgEarth/CMakeFiles/osgEarth.dir/all] Error 2
make: *** [all] Error 2
plevy plevy
Reply | Threaded
Open this post in threaded view
|

Re: osgEarth 2.7 compilation

Try to use the latest version of osgearth with osg 3.6.2


On Thu, Sep 13, 2018 at 8:58 AM gmusjha [via osgEarth] <[hidden email]> wrote:
Good Morning,

I am trying to build omnet++ 5.4.1 on centos 7 virtual machine. This software needs osg and and osgEarth library. I was able to build and install osg 3.6.2. I am able to generate Makefile using cmake for osgEarth 2.7.


Out of curiosity, I searched this error. I have seen some suggestion like  include fstream. But I tend not buy that in this case.

However once I use make I get  error below. Since this library must have been compiled thousands of time daily on this planet I am under the assumption that I might be missing some small things.
I was hoping to get some guidance.

Thank you.
Regards,
gmusjha



make clean ;make
[  0%] Generating AutoGenShaders.cpp
Scanning dependencies of target osgEarth
[  0%] Building CXX object src/osgEarth/CMakeFiles/osgEarth.dir/tinystr.cpp.o
[  1%] Building CXX object src/osgEarth/CMakeFiles/osgEarth.dir/tinyxml.cpp.o
[  1%] Building CXX object src/osgEarth/CMakeFiles/osgEarth.dir/tinyxmlerror.cpp.o
[  1%] Building CXX object src/osgEarth/CMakeFiles/osgEarth.dir/tinyxmlparser.cpp.o
[  1%] Building CXX object src/osgEarth/CMakeFiles/osgEarth.dir/AlphaEffect.cpp.o
[  1%] Building CXX object src/osgEarth/CMakeFiles/osgEarth.dir/AutoScale.cpp.o
[  1%] Building CXX object src/osgEarth/CMakeFiles/osgEarth.dir/Bounds.cpp.o
[  2%] Building CXX object src/osgEarth/CMakeFiles/osgEarth.dir/Cache.cpp.o
In file included from /usr/local/include/osgDB/Output:20:0,
                 from /usr/local/include/osgDB/DotOsgWrapper:21,
                 from /usr/local/include/osgDB/Registry:26,
                 from /usr/local/include/osgDB/FileUtils:17,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Cache.cpp:24:
/usr/local/include/osgDB/fstream:34:30: error: invalid use of incomplete type ‘std::ifstream {aka class std::basic_ifstream<char>}’
 class ifstream : public std::ifstream
                              ^
In file included from /usr/include/c++/4.8.2/ios:38:0,
                 from /usr/include/c++/4.8.2/ostream:38,
                 from /usr/local/include/osg/Notify:20,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Notify:24,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Common:24,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Cache:26,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Cache.cpp:19:
/usr/include/c++/4.8.2/iosfwd:111:11: error: declaration of ‘std::ifstream {aka class std::basic_ifstream<char>}’
     class basic_ifstream;
           ^
In file included from /usr/local/include/osgDB/Output:20:0,
                 from /usr/local/include/osgDB/DotOsgWrapper:21,
                 from /usr/local/include/osgDB/Registry:26,
                 from /usr/local/include/osgDB/FileUtils:17,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Cache.cpp:24:
/usr/local/include/osgDB/fstream:46:30: error: invalid use of incomplete type ‘std::ofstream {aka class std::basic_ofstream<char>}’
 class ofstream : public std::ofstream
                              ^
In file included from /usr/include/c++/4.8.2/ios:38:0,
                 from /usr/include/c++/4.8.2/ostream:38,
                 from /usr/local/include/osg/Notify:20,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Notify:24,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Common:24,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Cache:26,
                 from /tmp/osgearth2.7/osgearth-osgearth-2.7/src/osgEarth/Cache.cpp:19:
/usr/include/c++/4.8.2/iosfwd:114:11: error: declaration of ‘std::ofstream {aka class std::basic_ofstream<char>}’
     class basic_ofstream;
           ^
make[2]: *** [src/osgEarth/CMakeFiles/osgEarth.dir/Cache.cpp.o] Error 1
make[1]: *** [src/osgEarth/CMakeFiles/osgEarth.dir/all] Error 2
make: *** [all] Error 2


If you reply to this email, your message will be added to the discussion below:
http://forum.osgearth.org/osgEarth-2-7-compilation-tp7592005.html
To start a new topic under osgEarth, email [hidden email]
To unsubscribe from osgEarth, click here.
NAML
gmusjha gmusjha
Reply | Threaded
Open this post in threaded view
|

Re: osgEarth 2.7 compilation

Yeah. it was a good option. I tried first with osEarth 2.9 before coming down to 2.7. However, compiling with omnet++ I got the error below. It seems there is incompatibility is api call.
Thanks again for your advice.
Regards,
gmusjha






Creating executable: out/gcc-release//sockets
===== Compiling osg-intro ====
fallback.cc
OsgScene.cc
Creating executable: out/gcc-release//osg-intro
===== Compiling osg-earth ====
ChannelController.cc
ChannelController.cc: In member function ‘virtual void ChannelController::initialize(int)’:
ChannelController.cc:84:103: error: no matching function for call to ‘osgEarth::Annotation::FeatureNode::FeatureNode(osgEarth::MapNode*, osgEarth::Features::Feature*)’
             connectionGraphNode = new FeatureNode(mapNode.get(), new Feature(new LineString(), geoSRS));
                                                                                                       ^
ChannelController.cc:84:103: note: candidates are:
In file included from ChannelController.h:17:0,
                 from ChannelController.cc:11:
/usr/local/include/osgEarthAnnotation/FeatureNode:191:9: note: osgEarth::Annotation::FeatureNode::FeatureNode(const osgEarth::Annotation::FeatureNode&, const osg::CopyOp&)
         FeatureNode(const FeatureNode& rhs, const osg::CopyOp& op) { }
         ^
/usr/local/include/osgEarthAnnotation/FeatureNode:191:9: note:   no known conversion for argument 1 from ‘osgEarth::MapNode*’ to ‘const osgEarth::Annotation::FeatureNode&’
/usr/local/include/osgEarthAnnotation/FeatureNode:190:9: note: osgEarth::Annotation::FeatureNode::FeatureNode()
         FeatureNode() { }
         ^
/usr/local/include/osgEarthAnnotation/FeatureNode:190:9: note:   candidate expects 0 arguments, 2 provided
/usr/local/include/osgEarthAnnotation/FeatureNode:164:9: note: osgEarth::Annotation::FeatureNode::FeatureNode(const osgEarth::Config&, const osgDB::Options*)
         FeatureNode(const Config& conf, const osgDB::Options* options);
         ^
/usr/local/include/osgEarthAnnotation/FeatureNode:164:9: note:   no known conversion for argument 1 from ‘osgEarth::MapNode*’ to ‘const osgEarth::Config&’
In file included from ChannelController.h:17:0,
                 from ChannelController.cc:11:
/usr/local/include/osgEarthAnnotation/FeatureNode:61:9: note: osgEarth::Annotation::FeatureNode::FeatureNode(const FeatureList&, const osgEarth::Symbology::Style&, const osgEarth::Features::GeometryCompilerOptions&, osgEarth::Symbology::StyleSheet*)
         FeatureNode(
         ^
/usr/local/include/osgEarthAnnotation/FeatureNode:61:9: note:   no known conversion for argument 1 from ‘osgEarth::MapNode*’ to ‘const FeatureList& {aka const std::list<osg::ref_ptr<osgEarth::Features::Feature> >&}’
/usr/local/include/osgEarthAnnotation/FeatureNode:52:9: note: osgEarth::Annotation::FeatureNode::FeatureNode(osgEarth::Features::Feature*, const osgEarth::Symbology::Style&, const osgEarth::Features::GeometryCompilerOptions&, osgEarth::Symbology::StyleSheet*)
         FeatureNode(
         ^
/usr/local/include/osgEarthAnnotation/FeatureNode:52:9: note:   no known conversion for argument 1 from ‘osgEarth::MapNode*’ to ‘osgEarth::Features::Feature*’
/usr/local/include/osgEarthAnnotation/FeatureNode:44:31: note: osgEarth::Annotation::FeatureNode::FeatureNode(const osgEarth::Annotation::FeatureNode&)
     class OSGEARTHANNO_EXPORT FeatureNode : public AnnotationNode
                               ^
/usr/local/include/osgEarthAnnotation/FeatureNode:44:31: note:   candidate expects 1 argument, 2 provided
ChannelController.cc:86:22: error: ‘class osgEarth::MapNode’ has no member named ‘getModelLayerGroup’
             mapNode->getModelLayerGroup()->addChild(connectionGraphNode);
                      ^
make[2]: *** [out/gcc-release//ChannelController.o] Error 1
make[1]: *** [osg-earth] Error 2
make: *** [allmodes] Error 2
gmusjha gmusjha
Reply | Threaded
Open this post in threaded view
|

Re: osgEarth 2.7 compilation

I think I have solution. It was bad choice to compile osgEarth 2.7 or 2.9 with OpenSceneGraph 3.6.2 as there is incompatibility in APIs. e.g Decluttering.cpp at line #799 tries to access _traversalNumber which is not available on 3.6.2. In 3.6.2 they call _traversalOrderNumber. However it is available in 3.4.1.

Thank you.
Regards,
gmusjha