Problem while generating Ogre code

scriptkid

10-04-2007 20:55:29

Hey guys,

(i also sent this to the mailinglist, but the google groups are not clear to me whether those messages do show up when you are not a member. So sorry if this is a duplicate!)

Yesterday i decided to compile python-ogre myself (win32), because now and then my app crashes and i need to start debugging :/

I ran into a problem though, and i have a question. But first the error while generating Ogre. This is the 'head' btw; Eithort gave this problem as well so i though that this was the cause.. but apparently not.

Traceback (most recent call last):
File "generate_code.py", line 971, in <module> generate_code()
File "generate_code.py", line 887, in generate_code ManualExclude ( mb )
File "generate_code.py", line 92, in ManualExclude ogre_ns.class_('Root').mem_fun('termHandler').exclude()
File "c:\python25\Lib\site-packages\pygccxml\declarations\scopedef.py", line 477, in member_function, recursive=recursive )
File "c:\python25\Lib\site-packages\pygccxml\declarations\scopedef.py", line 327, in _find_single found = matcher_module.matcher.get_single( matcher, decls, False )
File "c:\python25\Lib\site-packages\pygccxml\declarations\matcher.py", line 79, in get_single raise matcher.declaration_not_found_t( decl_matcher )
pygccxml.declarations.matcher.declaration_not_found_t: Unable to find declaration. matcher: [(decl type==member_function_t) and (name==termHandler)]

This is an error like the sample on your 'building from source page' so that's not too scary. However removing the offending line causes another problem, which does not look familiar to me:

Traceback (most recent call last):
File "generate_code.py", line 971, in <module> generate_code()
File "generate_code.py", line 887, in generate_code ManualExclude ( mb )
File "generate_code.py", line 93, in ManualExclude ogre_ns.class_( "StaticGeometry" ).class_("Region").member_functions('getLights').exclude()
File "c:\python25\Lib\site-packages\pygccxml\declarations\scopedef.py", line 491, in member_functions , allow_empty=allow_empty)
File "c:\python25\Lib\site-packages\pygccxml\declarations\scopedef.py", line 347, in _find_multiple raise RuntimeError( "Multi declaration query returned 0 declarations." )
RuntimeError: Multi declaration query returned 0 declarations.

Please note that i have modified PythonOgreConfigNt.py and Environment.py, so that it only creates Ogre, Cegui and OIS. The two latter can be generated fine, so i'm quit confident about having done all the prework well. I have compiled both Ogre and Cegui with RTTI enabled.

Now for the question:
Your PythonOgreConfigNt.py file contains this line:
"pyplusplus_install_dir = r'c:/development/pyplus'"

What is 'pyplus' on your system? I checked out pygccxml and have this line:
pyplusplus_install_dir = r'D:/Projects/Python-Ogre-Dev/pygccxml'

Is that the correct one? Besides, i needed to install both 'pyplusplus_dev' and 'pygccxml_dev' right?

Thanks in advance! :)

bye,
Patrick.

Game_Ender

10-04-2007 22:03:03

Are you compiling against CVS ogre or with the SVN Python-Ogre? I believe we are targeting the Ogre 1.4 release only right now. So we can get some much needed stability with our dependencies.

andy

11-04-2007 00:35:24

As mentioned by Game Ender we are focusing on the 1.4 source release so use this and not the CVS version of Ogre..

You do need both pygccxml_dev and pyplusplus_dev -- in my setup both are under the PYPLUS directory..

Also ensure you have VC 7.1 (VS2003) as the compiler..

Also as an aside, all my work to date has been in compiling release versions of the code as I found that debugging 'python' problems into boost and through to the Ogre library to be painful at best.

In the few cases where I wasn't sure what was happening I tended to use the classic "print statement" (OK std::cout) -- but then I'm just an old school hacker :)

Cheers
Andy

Game_Ender

11-04-2007 03:03:09

On linux its actually very easy to debug into Ogre. You can just run the python interpreter through gdb and set break points in Ogre. Works like a charm. The only issue is with OIS and its keyboard grabing, but you have that with any debugger and a screen grabing app.

scriptkid

11-04-2007 08:06:39

Thanks for the quick replies so far! :)

Are you compiling against CVS ogre or with the SVN Python-Ogre? I believe we are targeting the Ogre 1.4 release only right now. So we can get some much needed stability with our dependencies.

I am compiling against the head of Ogre (CVS) and the head of Python-Ogre (SVN).

As mentioned by Game Ender we are focusing on the 1.4 source release so use this and not the CVS version of Ogre..

Okay so i should grap an Ogre source release instead of checking it out with CVS version? That's unlike what the wiki suggests though ;)

You do need both pygccxml_dev and pyplusplus_dev -- in my setup both are under the PYPLUS directory..

Okay so you checked it out to 'pyplus' then? So i should be fine then.

Also ensure you have VC 7.1 (VS2003) as the compiler..
Yes i use that one. However then i don't get why the precompiled Python-Ogre releases require the VC2005 runtime files and some XX80.DLLs... (while using Python-Ogre 0.7 that is)

Also as an aside, all my work to date has been in compiling release versions of the code as I found that debugging 'python' problems into boost and through to the Ogre library to be painful at best.

That's a serious one, because the reason i am compiling everyhing myself (in debug mode) is that i would like to debug -i think- Ogre :(
(After re-reading): i don't have to debug python itself any better because i can do this with my IDE. But you mean 'stepping' from python into a dll probably? Then we are on the same track :)

In the few cases where I wasn't sure what was happening I tended to use the classic "print statement" (OK std::cout) -- but then I'm just an old school hacker.

Hehe, those ancient statements still do the trick now and then indeed :)

The linux hint is a good one too; i should try to get my linux machine up and running again then.

scriptkid

23-04-2007 20:15:24

Okay i have given the build process another try with a bit more luck now. I think that my remaing errors are related... the first one ocurs during the code generation; it is the exception as mentioned in my initial post in this thread. By adding a try-except block inside the ManualExclude method i am able to keep things running. The aformentioned exception is the only one.

My second error happens when 'scon'-sing ogre. While compiling AnimationIterator i get this error:


cl /nologo -Zm800 -nologo -W3 -wd4675 -TP -MD -Zc:forScope -EHs -c -O
-D"BOOST_PYTHON_MAX_ARITY=19" /TP /ID:\Projects\Python-Ogre-Dev\boost
cts\Python-Ogre-Dev\Ogrenew\OgreMain\include /IC:\python25\include /I
\Python-Ogre-Dev\boost /c generated\ogre_1.4\AnimationIterator.pypp.c
mp\build_dir\ogre_1.4\AnimationIterator.pypp.obj
AnimationIterator.pypp.cpp
D:\Projects\Python-Ogre-Dev\boost\boost\python\object\make_instance.h
ror C2027: use of undefined type 'boost::STATIC_ASSERTION_FAILURE<x>'
with
[
x=false
]


This might be related because my exception while generating code happens here:


{*} function "::Ogre::BillboardSet::billboardVisible" is marked as internal
{*} function "::Ogre::BillboardSet::increasePool" is marked as internal
{*} function "::Ogre::AnimationTrack::populateClone" is marked as internal
{*} function "::Ogre::AnimationStateSet::_notifyAnimationStateEnabled" is marked
as internal
{*} function "::Ogre::Animation::buildKeyFrameTimeList" is marked as internal
*********************
Exception
*********************


Looking at the alphabetic order, it might be just that AnimationIterator...

Any more clues? I double checked everything again. Downloaded Ogre 1.4 instead of cvs. Even got gccxml from from cvs to be sure to have the latest version. I have VS2003 with SP1 and so on...

Thanks again! :)

Martins1

25-04-2007 14:14:28

I can confirm, than I have the same error as scriptkid:

{*} function "::Ogre::Animation::buildKeyFrameTimeList" is marked as internal
Traceback (most recent call last):
File "generate_code.py", line 971, in <module>
generate_code()
File "generate_code.py", line 887, in generate_code
ManualExclude ( mb )
File "generate_code.py", line 92, in ManualExclude
ogre_ns.class_('Root').mem_fun('termHandler').exclude()
File "g:\pyhton\lib\site-packages\pygccxml\declarations\scopedef.py", line 477
, in member_function
, recursive=recursive )
File "g:\pyhton\lib\site-packages\pygccxml\declarations\scopedef.py", line 327
, in _find_single
found = matcher_module.matcher.get_single( matcher, decls, False )
File "g:\pyhton\lib\site-packages\pygccxml\declarations\matcher.py", line 79,
in get_single
raise matcher.declaration_not_found_t( decl_matcher )
pygccxml.declarations.matcher.declaration_not_found_t: Unable to find declaratio
n. matcher: [(decl type==member_function_t) and (name==termHandler)]

Martins1

25-04-2007 14:24:26

I commented out the following lines in generate_code.py,
and it went ok:

## Functions defined in .h files but not implemented in source files
# ogre_ns.class_('Root').mem_fun('termHandler').exclude()
# ogre_ns.class_( "StaticGeometry" ).class_("Region").member_functions('getLights').exclude()

dermont

25-04-2007 20:06:43

You may also want to check your using the latest svn version(272 at last count), I think the above are already commented out.
http://www.python-ogre.org/wiki/DownloadsPage
https://svn.python-ogre.org/trunk/python-ogre/

I had similar problems on windows where my svn client was downloading from the old link:
(https://svn.python-ogre.python-hosting. ... ython-ogre ).

andy

26-04-2007 00:45:28

I hadn't thought to ask that...

Yes, please ensure you are using the correct SVN location for any development -- always a problem when things get moved...

Cheers
Andy

Martins1

26-04-2007 08:49:20

You are very right dermont!

I was using the old SVN repository (did not notice that there is new one).
May be you could switch off the old one so people start
getting error when downloading?

And thanks for great job, I am eager to get my hands on this.

scriptkid

26-04-2007 22:07:42

Cool, this seems to have done the trick for me as well! :-)