static program including python interpreter + dynamic python extensions

Discussion in 'Python' started by Tim Fuehner, Dec 8, 2003.

  1. Tim Fuehner

    Tim Fuehner Guest

    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
     
    Tim Fuehner, Dec 8, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robin Becker

    per interpreter storage for C extensions

    Robin Becker, Dec 28, 2006, in forum: Python
    Replies:
    3
    Views:
    244
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Dec 30, 2006
  2. Replies:
    3
    Views:
    779
    Ziga Seilnacht
    Jan 3, 2007
  3. =?iso-8859-1?B?QW5kcuk=?=
    Replies:
    8
    Views:
    396
    =?iso-8859-1?B?QW5kcuk=?=
    May 1, 2007
  4. J Kenneth King
    Replies:
    8
    Views:
    394
    J Kenneth King
    Oct 24, 2008
  5. Shanti Braford

    Including core class extensions from gems

    Shanti Braford, Jan 5, 2007, in forum: Ruby
    Replies:
    1
    Views:
    105
    Eric Hodel
    Jan 5, 2007
Loading...

Share This Page