Embedding python: GCC gives errors of "undefined reference" to Py_* functions.

Discussion in 'Python' started by Shuaib, Aug 19, 2006.

  1. Shuaib

    Shuaib Guest

    Hey!

    I am trying to embedd python into a C programe of mine. But when I try
    to compile the C code, gcc gives errors like "undefined reference to
    `Py_Finalize'" and the same kind for all the other functions. I have
    incuded "Python.h".

    Any idea what might be wrong?

    Thanks.
    Shuaib, Aug 19, 2006
    #1
    1. Advertising

  2. Shuaib

    Shuaib Guest

    OK, I am not ashamed to admit that I am ashamed as I didn't search the
    group for my problem before posting it yet again. The solution was
    right there.

    I have link in my libpython2.4.so while compiling.

    $gcc -I/usr/include/python2.4/ -lpython2.4 -o foo foo.c


    Shuaib wrote:
    > Hey!
    >
    > I am trying to embedd python into a C programe of mine. But when I try
    > to compile the C code, gcc gives errors like "undefined reference to
    > `Py_Finalize'" and the same kind for all the other functions. I have
    > incuded "Python.h".
    >
    > Any idea what might be wrong?
    >
    > Thanks.
    Shuaib, Aug 19, 2006
    #2
    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. Lu
    Replies:
    1
    Views:
    562
    Roel Schroeven
    Jul 10, 2003
  2. Replies:
    10
    Views:
    770
    Kenny McCormack
    May 30, 2005
  3. Replies:
    6
    Views:
    856
    Robert
    Mar 8, 2006
  4. key9
    Replies:
    7
    Views:
    558
    Howard
    May 24, 2006
  5. Sharwan Joram
    Replies:
    4
    Views:
    268
    Sharwan Joram
    Nov 22, 2013
Loading...

Share This Page