weave, including headers in generated file

Hello. I'm having a problem with using weave which I was wondering if someone could help me out with. I've got a class Hello declared in a file hw.h, but how do I tell weave to include this file in the generated cpp-file? If I try: code = """ Hello h; h.hw(); """ weave.inline(code, [], compiler='gcc', verbose=2, force=1, sources=['/home/mw/weave/inline-ex/hw.cpp'], include_dirs=['/home/mw/weave/inline-ex/'], ) Compiling fails because Hello is not defined: /home/mw/.python23_compiled/sc_dbdc99b5e1f621cd206ee575625e18f15.cpp:644: error: ` Hello' undeclared (first use this function) If I open the cpp file manually and puts: #include <hw.h> in it, everything works. Magne Westlie

"MW" == Magne Westlie <magnew@math.uio.no> writes:
MW> I've got a class Hello declared in a file hw.h, but how do I MW> tell weave to include this file in the generated cpp-file? If MW> I try: MW> code = """ Hello h; h.hw(); """ MW> weave.inline(code, MW> [], compiler='gcc', verbose=2, force=1, MW> sources=['/home/mw/weave/inline-ex/hw.cpp'], MW> include_dirs=['/home/mw/weave/inline-ex/'], ) Use the headers keyword and put hw.h into it. Also add the path to your header in include_dirs. cheers, prabhu
participants (2)
-
Magne Westlie
-
Prabhu Ramachandran