Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Embedding python: GCC gives errors of "undefined reference" to Py_* functions.

Reply
Thread Tools

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

 
 
Shuaib
Guest
Posts: n/a
 
      08-19-2006
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.

 
Reply With Quote
 
 
 
 
Shuaib
Guest
Posts: n/a
 
      08-19-2006
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GCC gives SEGFAULT... but GDB runs sethukr@gmail.com C Programming 6 03-02-2007 05:53 PM
char as array index gives warning in gcc Eugene Rice C Programming 13 11-06-2006 08:38 AM
gcc 2.95 and gcc 3.2 gouqizi.lvcha@gmail.com C++ 8 03-16-2005 02:34 AM
Errors, errors, errors Mark Goldin ASP .Net 2 01-17-2004 08:05 PM
C99 structure initialization in gcc-2.95.3 vs gcc-3.3.1 Kevin P. Fleming C Programming 2 11-06-2003 05:15 AM



Advertisments