Embed+extend+port

V

Vio

My story: I played with a little embedded python
piece of code (python interpreter embedded in wxWidgets app),
and used SWIG to extend this embedded py interpreter.
I did it in Linux, after some ironing all builds and runs as expected.

On a particularily lazy day, I pasted these same wrapper sources to
Win32 (cygnus). After fiddling with the Makefile to point in the right
directions, compilation seems to go ok (give or take a couple of
warnings). But then the linking step chokes with unfriendly messages
like "undefined reference to _PyExit, _Py_Initialize, etc.".

Could someone tell me what this mean? My guess is that my linker is not
pointed at the right Python library, but could someone confirm/rebute
this? I'm pointing the linker (on win32) to -L"/Python23/libs" where
lives "python23.lib", as presumably I need an equivalent to Linux's
"/usr/local/lib/python2.3/config/libpython2.3.a", so I'm wondering if
I'm pointing at the right place on the win32 side, or even if I'd need
to compile Python on win32 (currently using some precompiled distro on
win32, while I recompiled Py on Linux). In other words, I'd like to do
all my development on Linux, and not have to redo the work on win32
(besides some cut&paste). If I sound like a win32 newbie, well, I also
like like one:)

Cheers,
Vio

PS I just read on the list some comments that wxWidgets+Python mix is
kinda slow. Bummer.
 
C

Chris Liechti

My story: I played with a little embedded python
piece of code (python interpreter embedded in wxWidgets app),
and used SWIG to extend this embedded py interpreter.
I did it in Linux, after some ironing all builds and runs as expected.

why someone would embedd a python interpreter but write the gui code some
some other language escapes me, but well ;-)
On a particularily lazy day, I pasted these same wrapper sources to
Win32 (cygnus). After fiddling with the Makefile to point in the right
directions, compilation seems to go ok (give or take a couple of
warnings). But then the linking step chokes with unfriendly messages
like "undefined reference to _PyExit, _Py_Initialize, etc.".

Could someone tell me what this mean? My guess is that my linker is not
pointed at the right Python library,

right. you need to create an import lib for gcc. thats done with pexports
and dlltool:

http://docs.python.org/inst/tweak-flags.html#SECTION000622000000000000000

also remember to use -mno-cygwin for gcc if you want to make native win32
apps with cygwin.
PS I just read on the list some comments that wxWidgets+Python mix is
kinda slow. Bummer.

is it too slow for _you_?
there are always people that say something is slow, even if it isn't
relevant in real world applications...

chris
 

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

Forum statistics

Threads
474,197
Messages
2,571,040
Members
47,634
Latest member
RonnyBoelk

Latest Threads

Top