Re: [C++-sig] PhysX3.x Wrapping Problems
Hi Nicolay, thanks for your Tip. I tested this, but same Error. I think that is the biggest sh... Error in my live. Maybe I would better become a musician. :-) Best Regards Peter -----Ursprüngliche Nachricht----- Von: Cplusplus-sig [mailto:cplusplus-sig-bounces+arm=rfh-koeln.de@python.org] Im Auftrag von cplusplus-sig-request@python.org Gesendet: Mittwoch, 29. Januar 2014 16:22 An: cplusplus-sig@python.org Betreff: Cplusplus-sig Digest, Vol 64, Issue 12 Send Cplusplus-sig mailing list submissions to cplusplus-sig@python.org To subscribe or unsubscribe via the World Wide Web, visit https://mail.python.org/mailman/listinfo/cplusplus-sig or, via email, send a message with subject or body 'help' to cplusplus-sig-request@python.org You can reach the person managing the list at cplusplus-sig-owner@python.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Cplusplus-sig digest..." Today's Topics: 1. Re: Cplusplus-sig Digest, Vol 64, Issue 11 (Peter Armbr?ster) 2. Re: PhysX3.x Wrapping Problems (Nikolay Mladenov) ---------------------------------------------------------------------- Message: 1 Date: Wed, 29 Jan 2014 12:26:18 +0100 From: Peter Armbr?ster <arm@rfh-koeln.de> To: <cplusplus-sig@python.org> Subject: Re: [C++-sig] Cplusplus-sig Digest, Vol 64, Issue 11 Message-ID: <03d701cf1ce4$ee69dc30$cb3d9490$@rfh-koeln.de> Content-Type: text/plain; charset="iso-8859-1" Hi Niki and Giuseppe, thanks for your answers, but once I had already considered . My compiler flags are: /DWIN32 /DDEBUG /GR /RTCsu /DPX_DEBUG I wish you a nice day. Peter -----Urspr?ngliche Nachricht----- Von: Cplusplus-sig [mailto:cplusplus-sig-bounces+arm=rfh-koeln.de@python.org] Im Auftrag von cplusplus-sig-request@python.org Gesendet: Mittwoch, 29. Januar 2014 12:00 An: cplusplus-sig@python.org Betreff: Cplusplus-sig Digest, Vol 64, Issue 11 Send Cplusplus-sig mailing list submissions to cplusplus-sig@python.org To subscribe or unsubscribe via the World Wide Web, visit https://mail.python.org/mailman/listinfo/cplusplus-sig or, via email, send a message with subject or body 'help' to cplusplus-sig-request@python.org You can reach the person managing the list at cplusplus-sig-owner@python.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Cplusplus-sig digest..." Today's Topics: 1. Re: PhysX3.x Wrapping Problems (niki) 2. Re: PhysX3.x Wrapping Problems (Giuseppe Corbelli) ---------------------------------------------------------------------- Message: 1 Date: Wed, 29 Jan 2014 10:19:59 +0200 From: niki <niki@vintech.bg> To: Development of Python/C++ integration <cplusplus-sig@python.org> Subject: Re: [C++-sig] PhysX3.x Wrapping Problems Message-ID: <52E8B9AF.4050602@vintech.bg> Content-Type: text/plain; charset=UTF-8; format=flowed On 28.01.2014 18:33, Peter Armbr?ster wrote:
Dear Boost.python, C++ and Py++ Experts,
this is my first post in your excellent Forum.
I have chosen as the wrapper software the boost.python/Py++ Packageto write a physx 3.x Wrapper, because I think it is the best.
Many many thanks to David Abrahams and Roman Yakovenko for the great Tools.
The wrapping of old versions physx 2.x had made no problems.
And now I come across a very big problem at the 3.x Versions.
All wrappings of classes works very well.
The problem only exists in the PhysX free functions, which are responsible for the initialization of PhysX.
I try to explain with a reduced Example.
The initialization of PhysX starts with create of foundation :
*0 static*PxFoundation*mFoundation=NULL;
*1 static*PxDefaultErrorCallbackgDefaultErrorCallback; *2 static*PxDefaultAllocatorgDefaultAllocatorCallback; 3 mFoundation=PxCreateFoundation(PX_PHYSICS_VERSION,gDefaultAllocatorCal lback,gDefaultErrorCallback);4 *4 if*(!mFoundation)
5 fatalError("PxCreateFoundation failed!");
The wrapped python program generate a runtime error at line 3:RuntimeError: Access violation - no RTTI data!
Just wild guess: add compiler option to enable RTTI HTH Niki ------------------------------ Message: 2 Date: Wed, 29 Jan 2014 11:03:00 +0100 From: Giuseppe Corbelli <giuseppe.corbelli@copanitalia.com> To: Development of Python/C++ integration <cplusplus-sig@python.org> Subject: Re: [C++-sig] PhysX3.x Wrapping Problems Message-ID: <52E8D1D4.7060003@copanitalia.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 28/01/2014 17:33, Peter Armbr?ster wrote:
Dear Boost.python, C++ and Py++ Experts,
this is my first post in your excellent Forum.
I have chosen as the wrapper software the boost.python/Py++ Packageto write a physx 3.x Wrapper, because I think it is the best.
Many many thanks to David Abrahams and Roman Yakovenko for the great Tools.
The wrapping of old versions physx 2.x had made no problems.
And now I come across a very big problem at the 3.x Versions.
All wrappings of classes works very well.
The problem only exists in the PhysX free functions, which are responsible for the initialization of PhysX.
I try to explain with a reduced Example.
The initialization of PhysX starts with create of foundation :
*0 static*PxFoundation*mFoundation=NULL;
*1 static*PxDefaultErrorCallbackgDefaultErrorCallback; *2 static*PxDefaultAllocatorgDefaultAllocatorCallback; 3 mFoundation=PxCreateFoundation(PX_PHYSICS_VERSION,gDefaultAllocatorCal lback,gDefaultErrorCallback);4 *4 if*(!mFoundation)
5 fatalError("PxCreateFoundation failed!");
The wrapped python program generate a runtime error at line 3:RuntimeError: Access violation - no RTTI data!
Its impossible to get mFoundation.
*Notes: *
- physx comes as SDK: only Headers, libs and dlls.
Before reading on I'd investigate the "no RTTI data" message. Make sure you're using the /GR compiler option. -- Giuseppe Corbelli WASP Software Engineer, Copan Italia S.p.A Phone: +390303666318 Fax: +390302659932 E-mail: giuseppe.corbelli@copanitalia.com ------------------------------ Subject: Digest Footer _______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org https://mail.python.org/mailman/listinfo/cplusplus-sig ------------------------------ End of Cplusplus-sig Digest, Vol 64, Issue 11 ********************************************* ------------------------------ Message: 2 Date: Wed, 29 Jan 2014 10:21:50 -0500 From: Nikolay Mladenov <nikolay.mladenov@gmail.com> To: "Development of Python/C++ integration" <cplusplus-sig@python.org> Subject: Re: [C++-sig] PhysX3.x Wrapping Problems Message-ID: <CACbdn-J9sPWzS4cVqB9BPnJ5A=ecz__c2qnbFoQzRtj=F0O2mw@mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" Recently I had such symptom - it went away when I turned "Whole Program Optimization" off On Tue, Jan 28, 2014 at 11:33 AM, Peter Armbr?ster <arm@rfh-koeln.de> wrote:
Dear Boost.python, C++ and Py++ Experts,
this is my first post in your excellent Forum.
I have chosen as the wrapper software the boost.python/Py++ Package to write a physx 3.x Wrapper, because I think it is the best.
Many many thanks to David Abrahams and Roman Yakovenko for the great Tools.
The wrapping of old versions physx 2.x had made no problems.
And now I come across a very big problem at the 3.x Versions.
All wrappings of classes works very well.
The problem only exists in the PhysX free functions, which are responsible for the initialization of PhysX.
I try to explain with a reduced Example.
The initialization of PhysX starts with create of foundation :
*0 static* PxFoundation *mFoundation = NULL;
*1 static* PxDefaultErrorCallback gDefaultErrorCallback; *2 static* PxDefaultAllocator gDefaultAllocatorCallback; 3 mFoundation = PxCreateFoundation(PX_PHYSICS_VERSION, gDefaultAllocatorCallback, gDefaultErrorCallback); 4 *4 if*(!mFoundation)
5 fatalError("PxCreateFoundation failed!");
The wrapped python program generate a runtime error at line 3:RuntimeError: Access violation - no RTTI data!
Its impossible to get mFoundation.
*Notes: *
- physx comes as SDK: only Headers, libs and dlls.
- PxFoundation is a Abstract class:
*class* PX_FOUNDATION_API PxFoundation { *public*: *virtual* *void* release() = 0; *virtual* PxErrorCallback& getErrorCallback() *const* = 0; *virtual* *void* setErrorLevel(PxErrorCode::Enum mask = PxErrorCode::eMASK_ALL) = 0; *virtual* PxErrorCode::Enum getErrorLevel() *const* = 0; *virtual* PxBroadcastingAllocator& getAllocator() *const* = 0; *virtual* PxAllocatorCallback& getAllocatorCallback() *const* = 0; *virtual* *bool* getReportAllocationNames() *const* = 0; *virtual* *void* setReportAllocationNames(*bool* value) = 0;
*virtual* ~PxFoundation() {} };
- The wrapping of PxFoundation makes no problem.
To make sure that I made no mistake with the initialization of PhysX, I tried a different solution.
A small function InitPhysX create the foundation, and GetFoundation get this.
C++ Code:
*using* *namespace* physx;
PxU32 PHYSICS_VERSION = PX_PHYSICS_VERSION; *static* PxFoundation *mFoundation = NULL; *static* PxDefaultErrorCallback gDefaultErrorCallback; *static* PxDefaultAllocator gDefaultAllocatorCallback;
PxFoundation* GetFoundation(){ *return* mFoundation; }
*void* InitPhysX() { mFoundation = PxCreateFoundation( PX_PHYSICS_VERSION, gDefaultAllocatorCallback, gDefaultErrorCallback);
*if*(!mFoundation) printf("ERROR: PxCreateFoundation failed!\n");
*else* printf("PxCreateFoundation created!\n"); }
The wrapped python program:
1 import _physx324_d as PX
2 PX.InitPhysX()
3 foundation = PX.GetFoundation()
I get on line 2 the message: "PxCreateFoundation created!" => OK!
On Line 3 the same error RuntimeError: Access violation - no RTTI data!
Now i check the wrappings of PxCreateFoundation in _physx324_d_free_functions.pypp.cpp
void register_free_functions(){
. . .
{ //::GetFoundation
typedef ::physx::PxFoundation * ( *GetFoundation_function_type )( );
bp::def( "GetFoundation" , GetFoundation_function_type( &::GetFoundation ) , bp::return_value_policy< bp::reference_existing_object
() );
}
. . .
I think: return_value_policy< bp::reference_existing_object > thats right!?
Then a debug session with PTVS, start with a break point in InitPhysX
and inspect the mFoundation after the successful generation.
Its a vptr with 9 Entries => thats right, PxFoundation has 9 Methods.
That's all what I can see, because I have no source code and no pdb (symbols).
I place the next Breakpoint in
PxFoundation* GetFoundation(){ *return* mFoundation; }
to search the Error location.
Then followed a trace trip through the code, for me is a journey through an unreadable jungles of wrapper C + + code.
Unfortunately, I am not an C++Expert.
The Error is not to find for me.
The same problem occurs with PxCreatePhysics.
My work enviroment:
? Windows 7 x64
? Python 2.7
? physxVersion 3.24 (i try: 3.01, 3.23, 3.3, same problem)
? visualStudioVersion 11 (i try: VS 9 and VS 10, same problem)
? PythonTools for Visual Studio (PTVS)
? Boost 1.55 (i try: 1.45, same problem)
? gccxml 0.9
? pyplusplus 1.0 svn 1.5.1
? pygccxml 1.0 svn 1.5.1
What is my mistake?
I would be very grateful if someone could an expert help.
Thanks for your response.
Peter Armold
_______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org https://mail.python.org/mailman/listinfo/cplusplus-sig
participants (1)
-
Peter Armbrüster