Discussion:
[osg-users] issues compiling 3.0.1
L***@faa.gov
2018-09-26 20:59:36 UTC
Permalink
Hello, I am trying to upgrade some image generators and found that we can no longer compile our code. In fact I cannot compile OSG 3.0.1 anymore. Here is the error I getting:



/data/oldproject/OpenSceneGraph/src/osg/State.cpp: In constructor ‘osg::State::State()’:
/data/oldproject/OpenSceneGraph/src/osg/State.cpp:112:26: error: cannot convert ‘bool’ to ‘bool*’ in assignment
_abortRenderingPtr = false;
^~~~~
/data/oldproject/OpenSceneGraph/src/osg/State.cpp: In member function ‘const osg::StateAttribute* osg::State::getLastAppliedTextureAttribute(unsigned int, osg::StateAttribute::Type, unsigned int) const’:
/data/oldproject/OpenSceneGraph/src/osg/State.cpp:692:55: error: cannot convert ‘bool’ to ‘const osg::StateAttribute*’ in return
if (unit>=_textureAttributeMapList.size()) return false;
^~~~~
src/osg/CMakeFiles/osg.dir/build.make:2702: recipe for target 'src/osg/CMakeFiles/osg.dir/State.o' failed
make[2]: *** [src/osg/CMakeFiles/osg.dir/State.o] Error 1
CMakeFiles/Makefile2:300: recipe for target 'src/osg/CMakeFiles/osg.dir/all' failed
make[1]: *** [src/osg/CMakeFiles/osg.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2



We made an effort to upgrade our software to use the latest and greatest OSG but failed because of some low level code issues which we just don't understand. We plan to do a tech refresh. This is just a band aid to keep things usable.
Voerman, L.
2018-09-27 08:16:30 UTC
Permalink
Hi Lonni,
Both were fixed in 2012 by replacing false with NULL.
Regards, Laurens.

Revision: 5743d30dc1614ce4ee809cbc96d1b09c3778c4c2
Author: Robert Osfield <***@openscenegraph.com>
Date: 2/9/2012 4:54:13 PM
Message:
From Olaf Flebbe, "there are two ocurrences where pointer to bool is mixed
with bool. Fixes warnings on MacOSX with llvm.

diff --git a/src/osg/State.cpp b/src/osg/State.cpp
index 0b88d63..2137bbd 100644
--- a/src/osg/State.cpp
+++ b/src/osg/State.cpp
@@ -109,7 +109,7 @@ State::State():
}
}

- _abortRenderingPtr = false;
+ _abortRenderingPtr = NULL;

_checkGLErrors = ONCE_PER_FRAME;

@@ -689,7 +689,7 @@ bool State::getLastAppliedTextureMode(unsigned int
unit,Stat

const StateAttribute* State::getLastAppliedTextureAttribute(unsigned int
unit,S
{
- if (unit>=_textureAttributeMapList.size()) return false;
+ if (unit>=_textureAttributeMapList.size()) return NULL;
return
getLastAppliedAttribute(_textureAttributeMapList[unit],type,member);
}

"
----
Modified: src/osg/State.cpp
Post by L***@faa.gov
Hello, I am trying to upgrade some image generators and found that we can
no longer compile our code. In fact I cannot compile OSG 3.0.1 anymore.
/data/oldproject/OpenSceneGraph/src/osg/State.cpp: In constructor ‘
/data/oldproject/OpenSceneGraph/src/osg/State.cpp:112:26: error: cannot
convert ‘bool’ to ‘bool*’ in assignment
_abortRenderingPtr = false;
^~~~~
/data/oldproject/OpenSceneGraph/src/osg/State.cpp: In member function ‘const
osg::StateAttribute* osg::State::getLastAppliedTextureAttribute(unsigned
/data/oldproject/OpenSceneGraph/src/osg/State.cpp:692:55: error: cannot
convert ‘bool’ to ‘const osg::StateAttribute*’ in return
if (unit>=_textureAttributeMapList.size()) return false;
^~~~~
src/osg/CMakeFiles/osg.dir/build.make:2702: recipe for target
'src/osg/CMakeFiles/osg.dir/State.o' failed
make[2]: *** [src/osg/CMakeFiles/osg.dir/State.o] Error 1
CMakeFiles/Makefile2:300: recipe for target
'src/osg/CMakeFiles/osg.dir/all' failed
make[1]: *** [src/osg/CMakeFiles/osg.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
We made an effort to upgrade our software to use the latest and greatest
OSG but failed because of some low level code issues which we just don't
understand. We plan to do a tech refresh. This is just a band aid to keep
things usable.
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Robert Osfield
2018-09-27 09:14:18 UTC
Permalink
Hi Lonni,

Laurens suggested fix is what I would have suggested too so I'd
recommend you just apply these locally.

For updating to the latest version, given that you are jumping from
3.01 to 3.6.x would be a big jump. Both are still part of 3.x series
so broadly similar w.r.t public API, so for the most part I would
expect a recompile to be sufficient. It's still a long period though
so there are lots changes to the interface, implementations, as
additional features or features refactored.

If you do the big jump and just find a few problems then just let us
know what issues you have and we may be able to point you in the right
direction to resolve them. If the big jump introduces too many
issues then perhaps jumping to 3.2.x first, get things working, then
jump to 3.4.x then finally to 3.6.x might be easier. Or if you are
lucky then just jumping to 3.4.x would be an easy enough step.

As a general note, few users now use 3.0.x so there hasn't been any
activity within the OSG community to support it, for the last couple
of years the main focus has been on 3.4.x and 3.6.x. Build and bug
fixes have all focused on there two stable release series. I'm pretty
confident that 3.6.3 is the best release we've made so once you've
made the leap and got things working there it should be a much more
stable base - and any issues found by the community will be wrapped up
and pushed out as subsequent minor point releases, so you'll be able
to benefit from these too.

Cheers,
Robert.

Loading...