469,946 Members | 1,865 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,946 developers. It's quick & easy.

Embeding python with mingw on win32 and python 2.4.4

Hi
I'm bringing up an old story once more! I'm on win32 (winxp sp2)
python 2.4.4. mingw gcc version is 3.4.5. msys is in c:\msys. mingw is
in c:\mingw and python is in c:\pyton24. there is also python24.lib
and libpython24.a in c:\python24\libs.
when I try to compile this sample code [1] from with command [2] in
msys shell I get the results [3].
this subject was discussed a few times over these years and I tried
everything in the posts and forums that I found and google could
translate with no success. I realy need your suggestion!

Regards, Mani
[1] Sample code:

#include<Python.h>

int main(int argc, char *argv[])
{
Py_Initialize();
PyRun_SimpleString("from time import time,ctime\n"
"print 'Today is',ctime(time())\n");
Py_Finalize();
return 0;
}

[2] Command:
$ g++ -I/c/python24/include -I/c/MinGW/include -L/c/python24/libs -L/c/
mingw/lib -lpython24 -shared -mwin32 -o p1 p1.o

[3] Results:
p1.o:p1.cpp:(.text+0x2b): undefined reference to `_imp__Py_Initialize'
p1.o:p1.cpp:(.text+0x39): undefined reference to
`_imp__PyRun_SimpleString'
p1.o:p1.cpp:(.text+0x40): undefined reference to `_imp__Py_Finalize'
collect2: ld returned 1 exit status
Jan 28 '08 #1
0 1153

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by David Isal | last post: by
reply views Thread by Phil Schmidt | last post: by
1 post views Thread by A. B., Khalid | last post: by
14 posts views Thread by Mark Dufour | last post: by
66 posts views Thread by Srijit Kumar Bhadra | last post: by
1 post views Thread by Srijit Kumar Bhadra | last post: by
1 post views Thread by rcmn | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.