python-ogrenewt2 wrapper generation fails (Linux Mint x64).

lperkins2

25-05-2012 08:58:23

So I've been working my way through building everything on linux (64 bit linux mint debian testing, gcc4.6 libboost1.48) Compiling ogrenewt2 worked, but when I ran `Buildmodule.py -g ogrenewt2` I got the error below. It is similar to the error here: viewtopic.php?f=3&t=14857&p=82853&hilit=ogrenewt#p82853 (It's not a hyperlink because I may be new enough to not be able to post them, but it is from this forum too)
However, when I followed the suggested fix from that thread, it didn't make a difference. When I applied that patch to the ogre package (code_generators/ogre/python_ogre.h) it made ogre no longer generate, so at that point I figured it wouldn't help. I also tried updating the compiler number there from 420 to 460, to no effect.

I've seen this part of the error message pop up before, and have found numerous mentions of it on other projects using gccxml, but never how to fix it.
/usr/include/c++/4.6/tr1/type_traits:211: error: a function call cannot appear in a constant-expression

Anyway, I've run in circles with it enough I'm hoping a fresh set of eyes will spot something I've missed.


05-25 00:29 PythonOgre.BuildModule INFO Building Source code for ogrenewt2
05-25 00:29 PythonOgre.BuildModule DEBUG Spawning 'python generate_code.py' in '/home/ogredev/development/python-ogre/code_generators/ogrenewt2'
05-25 00:29 PythonOgre.BuildModule WARNING Task Failed
05-25 00:29 PythonOgre.BuildModule DEBUG
05-25 00:29 PythonOgre.BuildModule DEBUG INFO Creating xml file "/home/ogredev/development/python-ogre/code_generators/cache/ogrenewt2_r2764_2.11_cache.xml" from source file "/home/ogredev/development/python-ogre/code_generators/ogrenewt2/python_ogrenewt2.h" ...
INFO gccxml cmd: /usr/local/bin/gccxml -I"/home/ogredev/development/python-ogre" -I"/home/ogredev/development/root/usr/include/boost" -I"/home/ogredev/development/newtonSDK/sdk" -I"/home/ogredev/development/newtonSDK/sdk/dMath" -I"/home/ogredev/development/newtonSDK/sdk/dAnimation" -I"/home/ogredev/development/newtonSDK/sdk/dContainers" -I"/home/ogredev/development/newtonSDK/sdk/dCustomJoints" -I"/home/ogredev/development/root/usr/include/OGRE" -I"/home/ogredev/development/root/usr/include/OgreNewt" -I"/home/ogredev/development/root/usr/include/OGRE" -D"OGRE_NONCLIENT_BUILD" -D"OGRE_GCC_VISIBILITY" -D"__PYTHONOGRE_BUILD_CODE" -D"HAVE_OGRE_BUILDSETTINGS_H" -D"_OGRENEWT_DYNAMIC" -D"OIS_NONCLIENT_BUILD" -D"VERSION_r2764_2.11" "/home/ogredev/development/python-ogre/code_generators/ogrenewt2/python_ogrenewt2.h" -fxml="/home/ogredev/development/python-ogre/code_generators/cache/ogrenewt2_r2764_2.11_cache.xml"
Traceback (most recent call last):
File "generate_code.py", line 337, in <module>
generate_code()
File "generate_code.py", line 259, in generate_code
, cflags=environment.ogrenewt2.cflags
File "/home/ogredev/development/root/usr/lib/python2.7/site-packages/pyplusplus/module_builder/boost_python_builder.py", line 95, in __init__
, indexing_suite_version)
File "/home/ogredev/development/root/usr/lib/python2.7/site-packages/pyplusplus/module_builder/boost_python_builder.py", line 138, in __parse_declarations
decls = reader.read_files( files, compilation_mode )
File "/home/ogredev/development/root/usr/lib/python2.7/site-packages/pygccxml/parser/project_reader.py", line 217, in read_files
return self.__parse_file_by_file(files)
File "/home/ogredev/development/root/usr/lib/python2.7/site-packages/pygccxml/parser/project_reader.py", line 254, in __parse_file_by_file
reader.create_xml_file( header, prj_file.cached_source_file )
File "/home/ogredev/development/root/usr/lib/python2.7/site-packages/pygccxml/parser/source_reader.py", line 179, in create_xml_file
raise error
pygccxml.parser.source_reader.gccxml_runtime_error_t: Error occured while running GCC-XML: In file included from /usr/include/c++/4.6/tr1/unordered_map:39,
from /home/ogredev/development/root/usr/include/OGRE/OgreStdHeaders.h:40,
from /home/ogredev/development/root/usr/include/OGRE/OgrePrerequisites.h:315,
from /home/ogredev/development/root/usr/include/OGRE/OgreVector3.h:31,
from /home/ogredev/development/root/usr/include/OgreNewt/OgreNewt_Prerequisites.h:34,
from /home/ogredev/development/root/usr/include/OgreNewt/OgreNewt_World.h:18,
from /home/ogredev/development/root/usr/include/OgreNewt/OgreNewt.h:24,
from /home/ogredev/development/python-ogre/code_generators/ogrenewt2/python_ogrenewt2.h:2:
/usr/include/c++/4.6/tr1/type_traits:211: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:211: error: template argument 2 is invalid
/usr/include/c++/4.6/tr1/type_traits:217: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:217: error: template argument 2 is invalid
/usr/include/c++/4.6/tr1/type_traits:223: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:223: error: template argument 2 is invalid
/usr/include/c++/4.6/tr1/type_traits:230: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:230: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:231: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:231: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:231: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:233: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:233: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:234: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:234: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:234: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:236: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:236: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:237: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:237: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:237: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:239: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:239: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:240: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:240: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:240: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:242: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:242: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:243: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:243: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:243: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:245: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:245: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:246: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:246: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:246: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:248: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:248: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:249: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:249: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:249: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:251: error: expected nested-name-specifier before '...' token
/usr/include/c++/4.6/tr1/type_traits:251: error: expected '>' before '...' token
/usr/include/c++/4.6/tr1/type_traits:252: error: '_ArgTypes' was not declared in this scope
/usr/include/c++/4.6/tr1/type_traits:252: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp> struct std::tr1::is_function'
/usr/include/c++/4.6/tr1/type_traits:252: error: expected a type, got '(_Res)(<expression error>)'
/usr/include/c++/4.6/tr1/type_traits:337: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:337: error: template argument 2 is invalid
/usr/include/c++/4.6/tr1/type_traits:343: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:343: error: template argument 2 is invalid
/usr/include/c++/4.6/tr1/type_traits:349: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:349: error: template argument 2 is invalid
/usr/include/c++/4.6/tr1/type_traits:582: error: expected primary-expression before ',' token
/usr/include/c++/4.6/tr1/type_traits:582: error: expected primary-expression before ')' token
/usr/include/c++/4.6/tr1/type_traits:582: error: a function call cannot appear in a constant-expression
/usr/include/c++/4.6/tr1/type_traits:676: error: requested alignment is not a constant
In file included from /home/ogredev/development/root/usr/include/OgreNewt/OgreNewt.h:24,
from /home/ogredev/development/python-ogre/code_generators/ogrenewt2/python_ogrenewt2.h:2:
/home/ogredev/development/newtonSDK/sdk/Newton.h: In member function 'int OgreNewt::World::getVersion() const':
/home/ogredev/development/newtonSDK/sdk/Newton.h:363: error: too few arguments to function 'int NewtonWorldGetVersion(const NewtonWorld*)'
/home/ogredev/development/root/usr/include/OgreNewt/OgreNewt_World.h:349: error: at this point in file
In file included from /home/ogredev/development/root/usr/include/OgreNewt/OgreNewt_ContactCallback.h:17,
from /home/ogredev/development/root/usr/include/OgreNewt/OgreNewt_MaterialPair.h:18,
from /home/ogredev/development/root/usr/include/OgreNewt/OgreNewt.h:30,
from /home/ogredev/development/python-ogre/code_generators/ogrenewt2/python_ogrenewt2.h:2:
/home/ogredev/development/root/usr/include/OgreNewt/OgreNewt_ContactJoint.h: In member function 'void OgreNewt::Contact::getPositionAndNormal(Ogre::Vector3&, Ogre::Vector3&, OgreNewt::Body*) const':
/home/ogredev/development/root/usr/include/OgreNewt/OgreNewt_ContactJoint.h:115: error: cannot convert 'NewtonBody*' to 'float*' for argument '2' to 'void NewtonMaterialGetContactPositionAndNormal(const NewtonMaterial*, float*, float*)'
/home/ogredev/development/root/usr/include/OgreNewt/OgreNewt_ContactJoint.h: In member function 'void OgreNewt::Contact::getTangentDirections(Ogre::Vector3&, Ogre::Vector3&, OgreNewt::Body*) const':
/home/ogredev/development/root/usr/include/OgreNewt/OgreNewt_ContactJoint.h:118: error: cannot convert 'NewtonBody*' to 'float*' for argument '2' to 'void NewtonMaterialGetContactTangentDirections(const NewtonMaterial*, float*, float*)'

dermont

25-05-2012 13:58:33

What version of python-ogre are you using? If you are using trunk then it should be a case of adding a single line to the top of python_ogrenewt2.h

#include "../ogre/python_ogre_include_OGRE.h" <-----
#include "OgreNewt.h"
#include "NewtonCustomJoint.h"


gccxml doesn't support tr1 that's why the compiler version fudge is required to disable the HashMap ::std::tr1::unordered_map/set defined from Ogre.

lperkins2

25-05-2012 18:39:41

Okay, well that worked. I spotted that solution in another thread and thought I'd tried it, but I figured I'd do it again for completeness, and it worked. I wonder what I did differently. I still have a version conflict with libNewton, but that should be pretty easy to fix. Anyway, thanks for the help.