[C++-sig] Help! Py++ Generated Binding Won't Compile

Rocketman@JSC snemeth at houston.rr.com
Sat Apr 14 05:03:45 CEST 2007


Roman, 

Well earlier I posted too soon.  Apparently the only reason it built up was
cause the Event class was excluded from the wrapper file, but now I finally
do have it working--yea!

The clip below was used sucessfully in the generate_code.py file, but the
"event_class.opaque = True" was removed.

One other big thing had to be fixed and I only found it by trial and error:  

Basically somewhere along the lines, either boost or py++ didn't like the
two data members, PyObject *condition and PyObject *action in the Event
class definition.

Once I made those private, all built up without the compiler error.

My simple sim now runs and gives the same results as the SWIG version.   I
really have lots to learn.  

Thanks Again for the help,

Scott


Roman Yakovenko wrote:
> 
> On 4/13/07, Rocketman at JSC <snemeth at houston.rr.com> wrote:
>>
>> Thanks for the help Roman.  Not totally sure what I did, but this added
>> code
>> to the generate_code.py file seemed to fix the problem:
>>
>> event_class = mb.class_( 'Event' )
>> event_class.opaque = True
>>
>> event_class_setCon_ptr = event_class.member_function( 'setCondition',
>> recursive=False )
>> event_class_setCon_ptr.call_policies =
>> module_builder.call_policies.return_value_policy(
>> call_policies.return_opaque_pointer )
>>
>> event_class_setAct_ptr = event_class.member_function( 'setAction',
>> recursive=False )
>> event_class_setAct_ptr.call_policies =
>> module_builder.call_policies.return_value_policy(
>> call_policies.return_opaque_pointer )
> 
> Well you set call policies. I am not sure they are the best one. Does
> it work for you?
> ( I mean run-time )
> 
> -- 
> Roman Yakovenko
> C++ Python language binding
> http://www.language-binding.net/
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
> 
> 

-- 
View this message in context: http://www.nabble.com/Help%21--Py%2B%2B-Generated-Binding-Won%27t-Compile-tf3563358.html#a9989600
Sent from the Python - c++-sig mailing list archive at Nabble.com.




More information about the Cplusplus-sig mailing list