Errors when building python-ogre


16-03-2010 22:43:42

When I try to build python-ogre I get some errors:

C:\development>python-ogre\ -g ogre

WARNING: std::set<Ogre::Texture*,std::less<Ogre::Texture*>,Ogre::STLAllocator<Ogre::Texture*, Ogre::CategorisedAllocPolicy<Ogre::MEMCATEGORY_GENERAL> > > [class
> warning W1048: There are two or more aliases within
> "pyplusplus::aliases" namespace for the class. Py++ selected
> "stdSetOgreTexturePtrExtra" as class alias. Other aliases:
> stdSetOgreTexturePtr, stdSetOgreTexturePtrExtra
pyplusplus.declarations: WARNING std::set<Ogre::Texture*,std::less<Ogre::Texture*>,Ogre::STLAllocator<Ogre::Texture*, Ogre::CategorisedAllocPolicy<Ogre::MEMCAT
EGORY_GENERAL> > > [class declaration];warning W1048: There are two or more aliases within "pyplusplus::aliases" namespace for the class. Py++ selected "stdSetO
greTexturePtrExtra" as class alias. Other aliases: stdSetOgreTexturePtr, stdSetOgreTexturePtrExtra
Traceback (most recent call last):
File "", line 1446, in <module>
File "", line 1353, in generate_code
mb.build_code_creator (module_name='_ogre_' , doc_extractor= extractor )
File "C:\Python26\lib\site-packages\pyplusplus\module_builder\", line 275, in build_code_creator
self.__code_creator = creator.create()
File "C:\Python26\lib\site-packages\pyplusplus\module_creator\", line 354, in create
File "C:\Python26\lib\site-packages\pyplusplus\module_creator\", line 194, in inform_user
used_not_exported_decls = self.__find_out_used_but_not_exported()
File "C:\Python26\lib\site-packages\pyplusplus\module_creator\", line 138, in __find_out_used_but_not_exported
if self.__has_unexposed_dependency( exported_ids, depend_on_decl, dependency ):
File "C:\Python26\lib\site-packages\pyplusplus\module_creator\", line 101, in __has_unexposed_dependency
value_type = sptr_traits.value_type( depend_on_decl )
File "", line 98, in value_type
return declarations.internal_type_traits.get_by_name( type, "element_type" )
AttributeError: 'module' object has no attribute 'internal_type_traits'

Platform: Windows XP SP3 32-bit
Python-ogre version: SVN trunk
Ogre: 1.7.0 (final)
Python: 2.6.4
Compiler: Visual Studio 2008
GCCXML: 0.9.0
Py++: 1.0.0
pygccxml: 1.0.0
Boost: 1.42

How can I resolve this error?


16-03-2010 23:17:29

this specificall error is found when using pygccxml 1.0.0 and pyplusplus, use the ones that downloads and everything will be fine, i think the ones downloaded are from svn


17-03-2010 15:03:11

Using the svn version of py++ and pygccxml worked great =)



17-03-2010 16:37:16

Now I get a new error when compiling Ogre :(

C:\development>python-ogre\ -cv ogre
PythonOgre.BuildModule: INFO Compiling Source code for ogre
scons: Reading SConscript files ...

scons: warning: The Options class is deprecated; use the Variables class instead.
File "C:\development\python-ogre\SConstruct", line 154, in <module>

scons: warning: The ListOption() function is deprecated; use the ListVariable() function instead.
File "C:\development\python-ogre\SConstruct", line 156, in <module>
SCONS: Building ogre
WARNING: Over-Writing C:\development\python-ogre\generated\ogre_1.7.0\SConscript as it already exists
scons: done reading SConscript files.
scons: Building targets ...
cl /FoC:\temp\build_dir_2.6\ogre_1.7.0\DefaultHardwareBufferManagerBase.pypp.obj /c generated\ogre_1.7.0\DefaultHardwareBufferManagerBase.pypp.cpp /nologo /DBOO
ST_PYTHON_MAX_ARITY=19 /DBOOST_PYTHON_NO_PY_SIGNATURES /nologo -Zm200 /W3 /wd4675 /TP /MD /Zc:forScope /EHs /c /Ob2 /Oi /O2 /Ot /Oy /GS- /GR /Ox -IC:\developmen
t\python-ogre\generated\ogre_1.7.0 /DBOOST_PYTHON_STATIC_LIB -IC:\development\root\usr\include /TP /nologo /DBOOST_PYTHON_MAX_ARITY=19 /DBOOST_PYTHON_NO_PY_SIGN
ATURES /nologo -Zm200 /W3 /wd4675 /TP /MD /Zc:forScope /EHs /c /Ob2 /Oi /O2 /Ot /Oy /GS- /GR /Ox -IC:\development\python-ogre\generated\ogre_1.7.0 /DBOOST_PYTHO
N_STATIC_LIB -IC:\development\root\usr\include /IC:\Programfiler\boost\boost_1_42 /IC:\development\ogre\include\OGRE /IC:\Python26\include /IC:\Python26\include
/IC:\Programfiler\boost\boost_1_42 /Yupython_ogre_precompiled.h /Fpgenerated\ogre_1.7.0\buildpch.pch
C:\Programfiler\boost\boost_1_42\boost/thread/win32/recursive_mutex.hpp(38) : error C2248: 'boost::noncopyable_::noncopyable::noncopyable' : cannot access priva
te member declared in class 'boost::noncopyable_::noncopyable'
C:\Programfiler\boost\boost_1_42\boost/noncopyable.hpp(27) : see declaration of 'boost::noncopyable_::noncopyable::noncopyable'
C:\Programfiler\boost\boost_1_42\boost/noncopyable.hpp(22) : see declaration of 'boost::noncopyable_::noncopyable'
This diagnostic occurred in the compiler generated function 'boost::recursive_mutex::recursive_mutex(const boost::recursive_mutex &)'
cl /FoC:\temp\build_dir_2.6\ogre_1.7.0\DefaultRaySceneQuery.pypp.obj /c generated\ogre_1.7.0\DefaultRaySceneQuery.pypp.cpp /nologo /DBOOST_PYTHON_MAX_ARITY=19 /
DBOOST_PYTHON_NO_PY_SIGNATURES /nologo -Zm200 /W3 /wd4675 /TP /MD /Zc:forScope /EHs /c /Ob2 /Oi /O2 /Ot /Oy /GS- /GR /Ox -IC:\development\python-ogre\generated\
ogre_1.7.0 /DBOOST_PYTHON_STATIC_LIB -IC:\development\root\usr\include /TP /nologo /DBOOST_PYTHON_MAX_ARITY=19 /DBOOST_PYTHON_NO_PY_SIGNATURES /nologo -Zm200 /W
3 /wd4675 /TP /MD /Zc:forScope /EHs /c /Ob2 /Oi /O2 /Ot /Oy /GS- /GR /Ox -IC:\development\python-ogre\generated\ogre_1.7.0 /DBOOST_PYTHON_STATIC_LIB -IC:\develo
pment\root\usr\include /IC:\Programfiler\boost\boost_1_42 /IC:\development\ogre\include\OGRE /IC:\Python26\include /IC:\Python26\include /IC:\Programfiler\boost
\boost_1_42 /Yupython_ogre_precompiled.h /Fpgenerated\ogre_1.7.0\buildpch.pch
csl /FoC:\temp\build_dir_2.6\ogre_1.7.0\DefaultSceneManagerFactory.pypp.obj /c generated\ogre_1.7.0\DefaultSceneManagerFactory.pypp.cpp /nologo /DBOOST_PYTHON_M
AX_ARITY=19 /DBOOST_PYTHON_NO_PY_SIGNATURES /nologo -Zm200 /W3 /wd4675 /TP /MD /Zc:forScope /EHs /c /Ob2 /Oi /O2 /Ot /Oy /GS- /GR /Ox -IC:\development\python-og
re\generated\ogre_1.7.0 /DBOOST_PYTHON_STATIC_LIB -IC:\development\root\usr\include /TP /nologo /DBOOST_PYTHON_MAX_ARITY=19 /DBOOST_PYTHON_NO_PY_SIGNATURES /nol
ogo -Zm200 /W3 /wd4675 /TP /MD /Zc:forScope /EHs /c /Ob2 /Oi /O2 /Ot /Oy /GS- /GR /Ox -IC:\development\python-ogre\generated\ogre_1.7.0 /DBOOST_PYTHON_STATIC_LI
B -IC:\development\root\usr\include /IC:\Programfiler\boost\boost_1_42 /IC:\development\ogre\include\OGRE /IC:\Python26\include /IC:\Python26\include /IC:\Progr
amfiler\boost\boost_1_42 /Yupython_ogre_precompiled.h /Fpgenerated\ogre_1.7.0\buildpch.pch
cons: *** [C:\temp\build_dir_2.6\ogre_1.7.0\DefaultHardwareBufferManagerBase.pypp.obj] Error 2
scons: building terminated because of errors.
PythonOgre.BuildModule: WARNING Task Failed


18-03-2010 21:21:37

It seems the copy constructors are responsible for this ...

The files that fails are:
- DefaultHardwareBufferManagerBase.pypp.cpp
- FileSystemArchive.pypp.cpp
- PoolSharedPtr.pypp.cpp
- ResourceManager.pypp.cpp
- ZipArchive.pypp.cpp

The copy constructor looks like this:

wrapper_PoolSharedPtr(Ogre::Pool<Ogre::SharedPtr<Ogre::Resource> > const & arg )
: Ogre::Pool<Ogre::SharedPtr<Ogre::Resource> >( arg )
, bp::wrapper< Ogre::Pool< Ogre::SharedPtr< Ogre::Resource > > >()
// copy constructor


I have tested three of the files above, and removing the copy constructor resolves the error (but introduces new errors).


19-03-2010 14:32:43

Are you using the Ogre 1.7 SDK or building from source -- and if you built from source what option did you use for your threading?

I'm currently testing find using the Ogre prebuilt SDK (should have a binary release out over the weekend..)



19-03-2010 15:32:37

I am using the Ogre 1.7 SDK:
OGRE 1.7.0 SDK for Visual C++ .Net 2008 (32-bit) 28 February 2010 53.5 MB

I got ogre compiled yesterday by adding a few more classes to the noncopy list. I still had to remove the copy constructor manually from the generated PoolSharedPtr, though. I'm sure there is a way to fix that class as well.

Changes I had to make to

--- (revision 1106)
+++ (working copy)
@@ -505,7 +505,10 @@
noncopy = noncopy + ['Compositor', 'DefaultHardwareBufferManager', 'DefaultSceneManager', 'Font', 'FontManager',
'HighLevelGpuProgramManager','Material', 'Mesh', 'MeshManager',
'ParticleSystemManager', 'Pass', 'PatchMesh', 'ResourceGroupManager',
- 'Skeleton', 'SkeletonInstance', 'SkeletonManager', 'UnifiedHighLevelGpuProgram']
+ 'Skeleton', 'SkeletonInstance', 'SkeletonManager', 'UnifiedHighLevelGpuProgram',
+ 'DefaultHardwareBufferManagerBase', 'FileSystemArchive', #'PoolSharedPtr',
+ 'ResourcePool', 'ZipArchive']
for c in noncopy:
main_ns.class_(c).noncopyable = True

@@ -1003,6 +1006,7 @@
+ 'PoolSharedPtr',

My problem now is that CEGUI refuses to generate at all:

C:\development>python-ogre\ cegui -gv
PythonOgre.BuildModule: INFO Building Source code for cegui
..\common_utils\ DeprecationWarning: the md5 module is deprecated; use hashlib instead
import md5
INFO Creating xml file "C:\development\python-ogre\code_generators\cache\cegui_0.7.1_cache.xml" from source file "C:\development\python-ogre\code_generators\ceg
ui\python_CEGUI.h" ...
INFO gccxml cmd: ""C:\development\gccxml\bin\Release\gccxml.exe" -D"_HAS_TR1=0" -I"C:\development\python-ogre" -I"C:\Programfiler\boost\boost_1_42" -I"C:\d
evelopment\CEGUI-0.7.1\cegui\include" -I"C:\development\CEGUI-0.7.1" -I"C:\development\CEGUI-0.7.1\cegui\include\RendererModules\Ogre" -I"C:\development\ogre\in
ENDERER_EXPORTS" -D"VERSION_0_7_1" -D"BOOST_HAS_THREADS" -D"BOOST_HAS_WINTHREADS" "C:\development\python-ogre\code_generators\cegui\python_CEGUI.h" -fxml="C:\d
Traceback (most recent call last):
File "", line 385, in <module>
File "", line 316, in generate_code
, cflags=environment.ogre.cflags
File "C:\Python26\lib\site-packages\pyplusplus\module_builder\", line 95, in __init__
, indexing_suite_version)
File "C:\Python26\lib\site-packages\pyplusplus\module_builder\", line 138, in __parse_declarations
decls = reader.read_files( files, compilation_mode )
File "C:\Python26\lib\site-packages\pygccxml\parser\", line 217, in read_files
return self.__parse_file_by_file(files)
File "C:\Python26\lib\site-packages\pygccxml\parser\", line 254, in __parse_file_by_file
reader.create_xml_file( header, prj_file.cached_source_file )
File "C:\Python26\lib\site-packages\pygccxml\parser\", line 179, in create_xml_file
raise error
pygccxml.parser.source_reader.gccxml_runtime_error_t: Error occured while running GCC-XML: C:/development/ogre/include/OGRE/OgreLog.h:202: internal compiler err
or: in maybe_emit_vtables, at decl2.c:1521
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:> for instructions.
PythonOgre.BuildModule: WARNING Task Failed

Ogre and Cegui are the only packages I've had problems with to now.


20-03-2010 06:36:41

OK -- What version of GCCXML are you using -- it HAS to be the CVS version dated before Jan 2010... If you look in environment .py you can see that we pull down the Nov version
cvs -d co -D 10Nov2009 gccxml

I'm actually using 01Jan2010 for my build and will update the svn, however I don't think anything changed..

GCCXML was buggy before this release (well, it got much better during mid 2009 however I don't know the date on your version) and when I generate code on my machine I don't even create the copy constructors that you are trying to exclude, so clearly we have a difference here..

Also if you do update gccxml remember to delete the .xml files from code_generators/cache before doing a rebuild..



20-03-2010 13:30:53

I'm using the GCCXML version downloaded by the build script. The CVS/TAG file contains "D2009." so I assume it is the correct version.

I have also tried the official 0.9 version, but I still get the same error message when generating CEGUI.

Edit: Tried 01Jan2010, same error


26-03-2010 09:15:21

There must also be something wrong with my version of GCCXML since on Linux I also had to update the noncopy list mentioned above. Also there were updates to exclude the readwrite properties for recursive_mutexes.


26-03-2010 14:27:51

Ill sugges you to wipe out all pygccxml related stuff you may have, since i was able to compile CEGUI without any patch using rv1107 and AFAIK there has not been changes on CEGUI generated code since 1100 or so


27-03-2010 06:43:24

The above patch wasn't related to CEGUI, it was for building the Ogre module with threading support on Linux for Ogre svn trunk(last revision before the move to hg).

Since threading isn't implemented by default on Linux I didn't post to the tracker. I believe Andy has already applied this to SVN.

Since I'm compiling with CMake and haven't got round to fully automating the build (i.e. code generation etc.) part of the patch may not apply though it appears reasonable to me. If there are problems with this you can always submit a patch to the tracker.


21-05-2011 03:28:58

I'm using the GCCXML version downloaded by the build script. The CVS/TAG file contains "D2009." so I assume it is the correct version.

I have also tried the official 0.9 version, but I still get the same error message when generating CEGUI.

Edit: Tried 01Jan2010, same error

I am trying to build CEGUI 0.7.5 with Ogre 1.7.2.
I use GCCXML SVN 01Jan2010, and get the same error (OgreLog.h ... decl12.c:1521).
Did anyone find what was causing this issue?!?


15-08-2011 08:46:02

I already mentioned this to Mohican by PM, but here's the public version: I had the exact same error (the OgreLog.h one), but after running the -g command on the Cegui files a few times, i suddenly had a complete Cegui XML cache file. Like gccxml is some incremental tool, don't know for sure. Anyhow, after that i was able to successfully build a cegui binding for Cegui 0.7.5 :)