[C++-sig] Cross module definition

Arnaud PICARD arnaud.picard at edfgdf.fr
Mon Sep 1 19:05:54 CEST 2003


Sorry, my latest mail was sent before I'd had time to complete it...
--------------------------

Hello,

As I've already mentionned, I still have problems with cross def.
Here you'll find an example I've used to test a method. I'm not sure I've
done it right (actually I guess it's false since I can't get it to work
properly)

So, in these modules, I have define one as ModuleA and the other as
ModuleB.
They are AFAIK well written.

If I import them under python, and define a = ModuleA.Cmplx( 1., 0. ), b =
ModuleB.Printer(), and then try b.print1( a ) or b.print2( a ) it won't
work.
If I define a with ModuleB instead of ModuleA it's running. That's still
the same problem I had with cross-module definition, with an example... If
I remove the line define_Cmplx() from ModuleD definition, I still cannot
get it to work even though I've imported first ModuleA then ModuleB.

What do I have to do so that I can pull the line "define_Cmplx()" out of my
ModuleB definition so that ModuleB's methods recognize my class Cmplx ?
I've understood what was reponsded last time, but I have not been able to
have it work properly...

Thanks in avance and still sorry for the former incomplete message,

Arnaud PICARD
EDF R&D, Clamart
Dept. SINETICS, I23

(See attached file: MyModules.tar.gz)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MyModules.tar.gz
Type: application/octet-stream
Size: 771 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030901/a1bad2db/attachment.obj>


More information about the Cplusplus-sig mailing list