static program including python interpreter + dynamic python extensions

T

Tim Fuehner

Dear Newsgroup,

I have a problem that is somewhat related to Alexandre Gillet's ones:
"build a static python executable".

I would like to make a C[++] program scriptable. Therefor, I have included
a python interpreter into the program. Additionally I have wraped all the
program's interfaces that I need, using SWIG. Finally, I have created a
shared library, which includes this interface and all functions that are
to be available from within python scripts. And it works: one can write
a script, which can access the program's routines and data, the main
program correctly loads them, using its python interpreter.

However, the program has to be linked dynamically. Once I try to change
the main program's linkage to static, loading any module, that is not a
plain python file (but a shared library), fails, saying:
Fatal Python error: Interpreter not initialized (version mismatch?)

Since I need the program to be linked statically, I would appreciate any
hint on how to fix this problem.
I'm using gcc 3.2 under linux (2.4.19) and python 2.3.2 (also checked with
2.2).

Thanks

-tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top