[Stackless] Can't embed Stackless in C++ using MinGW

Ben Sizer kylotan at gmail.com
Sun Sep 14 16:59:23 CEST 2008


Hello all,

I'm trying to get started with embedding Stackless into C++.
Unfortunately I don't seem to have even set it up right, because it
won't compile. Python's include directory and the Stackless include
directory are in my compiler's search path.

My code is simply this:


#include <Python.h>
#include <stackless_api.h>

int main()
{
    return 0;
}


If I comment out the #include <stackless_api.h>, it compiles fine. But
if I leave that in, I get this:


E:/code/Python25/include/Stackless/stackless_api.h:45: error: expected
constructor, destructor, or type conversion before '*' token
E:/code/Python25/include/Stackless/stackless_api.h:52: error: variable
`PyTasklet_Setup' definition is marked dllimport.
E:/code/Python25/include/Stackless/stackless_api.h:52: error:
`PyTaskletObject' was not declared in this scope
E:/code/Python25/include/Stackless/stackless_api.h:52: error: `task'
was not declared in this scope
...etc...


I browsed through some headers and it appears some require '#define
STACKLESS'. That is in <stackless.h>, so I #included that and got
these errors:


Compiling: main.cpp
In file included from
E:/code/Python25/include/Stackless/core/stackless_impl.h:17,
                 from E:/code/Python25/include/Stackless/stackless_api.h:37,
                 from E:\code\cpp\stackless_embed\main.cpp:4:
E:/code/Python25/include/Stackless/core/stackless_structs.h:172:
error: ISO C++ forbids declaration of `PyFrame_ExecFunc' with no type
E:/code/Python25/include/Stackless/core/stackless_structs.h:172:
error: expected `;' before '*' token
In file included from
E:/code/Python25/include/Stackless/core/stackless_impl.h:18,
                 from E:/code/Python25/include/Stackless/stackless_api.h:37,
                 from E:\code\cpp\stackless_embed\main.cpp:4:
E:/code/Python25/include/Stackless/pickling/prickelpit.h:14: error:
`PyFrame_ExecFunc' has not been declared
E:/code/Python25/include/Stackless/pickling/prickelpit.h:15: error:
`PyFrame_ExecFunc' has not been declared


At this point, I'm stuck. I couldn't find any walkthroughs on any of
the various wikis for how to set up Stackless in C++, so I don't know
what to try next. Any suggestions?

Thanks,
Ben Sizer




More information about the Stackless mailing list