compile error under X for OS X and wxPython 2.5.3.1

Hi,

   I'm trying to compile wxPython 2.5.3.1 under OS X for X, not for
the native GUI. Why? I'm trying to find some combination of wx
and VTK that I can get compiled for this system I can't get a
build of VTK on my own but fink managed, so I'm trying that way.
Grrr!

I think, btw, that I'm only building the wxWidgets portion at
this time, not wxPython.

Here are the last few lines of the make output. The errors are of
the form "ld: monodll_utilsx11.o illegal reference to symbol:
_XChangeProperty defined in indirectly referenced dynamic
library /usr/X11R6/lib/libX11.6.dylib"

A cursory web search wasn't much help.

g++ -dynamiclib -single_module -headerpad_max_install_names -o lib/libwx_gtk2ud-2.5.3.0.0.dylib monodll_appbase.o monodll_clntdata.o monodll_cmdline.o monodll_config.o monodll_datetime.o monodll_datstrm.o monodll_dircmn.o monodll_dynarray.o monodll_dynlib.o monodll_dynload.o
    .. much text deleted ...
monodll_xh_stbmp.o monodll_xh_stbox.o monodll_xh_stlin.o monodll_xh_sttxt.o monodll_xh_text.o monodll_xh_tglbtn.o monodll_xh_toolb.o monodll_xh_tree.o monodll_xh_unkwn.o monodll_xh_wizrd.o monodll_xmlres.o monodll_xmlrsall.o monodll_xml.o monodll_xtixml.o -L/usr/X11R6/lib -Llib -install_name /sw/wx/2.5/lib/libwx_gtk2ud-2.5.3.dylib -compatibility_version 2.5.3 -current_version 2.5.3 -lwxtiffd-2.5 -lwxjpegd-2.5 -lwxpngd-2.5 -lwxregexud-2.5 -lwxexpatd-2.5 -L/usr/X11R6/lib -lz -lpthread -liconv -L/sw/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl -liconv -L/sw/lib -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv -lXinerama -lXxf86vm -L/sw/lib -lSDLmain -lSDL -framework Cocoa -framework OpenGL
ld: monodll_utilsx11.o illegal reference to symbol: _XChangeProperty defined in indirectly referenced dynamic library /usr/X11R6/lib/libX11.6.dylib
ld: monodll_dcpsg.o illegal reference to symbol: _FT_Done_Glyph defined in indirectly referenced dynamic library /usr/X11R6/lib/libfreetype.6.dylib
ld: /usr/X11R6/lib/libXxf86vm.a(XF86VMode.o) illegal reference to symbol: _XMissingExtension defined in indirectly referenced dynamic library /usr/X11R6/lib/libXext.6.dylib
ld: warning multiple definitions of symbol _regfree
lib/libwxregexud-2.5.a(wxregex_regfree.o) definition of _regfree in section (__TEXT,__text)
/usr/lib/libpthread.dylib(regfree.So) definition of _regfree
ld: warning multiple definitions of symbol _locale_charset
/sw/lib/libiconv.dylib(localcharset.o) definition of _locale_charset
/sw/lib/libintl.dylib(localcharset.lo) definition of _locale_charset
ld: warning multiple definitions of symbol _regerror
lib/libwxregexud-2.5.a(wxregex_regerror.o) definition of _regerror in section (__TEXT,__text)
/usr/lib/libpthread.dylib(regerror.So) definition of _regerror
/usr/bin/libtool: internal link edit command failed
make: *** [lib/libwx_gtk2ud-2.5.3.0.0.dylib] Error 1

Here's the info the configure script spits out

Configured wxWidgets 2.5.3 for `powerpc-apple-darwin7.5.0'

   Which GUI toolkit should wxWidgets use? GTK+ 2
   Should wxWidgets be compiled into single library? yes
   Should wxWidgets be compiled in debug mode? yes
   Should wxWidgets be linked as a shared library? yes
   Should wxWidgets be compiled in Unicode mode? yes
   What level of wxWidgets compatibility should be enabled?
                                        wxWidgets 2.2 no
                                        wxWidgets 2.4 yes
   Which libraries should wxWidgets use?
                                        jpeg builtin
                                        png builtin
                                        regex builtin
                                        tiff builtin
                                        zlib sys
                                        odbc no
                                        expat builtin
                                        libmspack no
                                        sdl yes

          Andrew
          dalke@dalkescientific.com

Andrew Dalke wrote:

Hi,

  I'm trying to compile wxPython 2.5.3.1 under OS X for X, not for
the native GUI. Why? I'm trying to find some combination of wx
and VTK that I can get compiled for this system I can't get a
build of VTK on my own but fink managed, so I'm trying that way.
Grrr!

I think, btw, that I'm only building the wxWidgets portion at
this time, not wxPython.

Correct.

Here are the last few lines of the make output. The errors are of
the form "ld: monodll_utilsx11.o illegal reference to symbol:
_XChangeProperty defined in indirectly referenced dynamic
library /usr/X11R6/lib/libX11.6.dylib"

IIRC, this means that it's finding the symbol because of the linking of another library, but that libX11 isn't explicitly mentioned. This is normally okay on ELF based systems like Linux, but on OSX the linker wants to know exactly where every symbol is coming from.

Please ask about this on the wx-dev list, as I don't know what the best way to fix this is, and somebody there probably will know.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin:

IIRC, this means that it's finding the symbol because of the linking of
another library, but that libX11 isn't explicitly mentioned. This is
normally okay on ELF based systems like Linux, but on OSX the linker
wants to know exactly where every symbol is coming from.

Thanks Robin, that was enough of a clue. I added the needed -l flags
to the Makefile. That is, after I did

../configure --prefix=/sw/wx/2.5 --with-gtk2 --with-opengl --enable-debug \
    --enable-geometry --enable-display --enable-unicode --enable-monolithic

(note, not using SDL because I couldn't get that to work) I then
added " -lfreetype -lXext -lX11" to the end of the EXTRALIBS_GUI
line in the Makefile.

I had to hack utilsunx.cpp as well because there's a hard-coded

#if defined(__DARWIN__)
     endProcData->tag = wxAddProcessCallbackForPid(endProcData, execData.pid);

where the wxAddProcessCallbackForPid is in code that's only compiled
(AFAICT) for native Mac, and not Mac with X GUI.

With the changes I do get one warning message, which is

  (Timer.py:29402): GLib-WARNING **: poll(2) failed due to: Invalid argument.

The line number has nothing to do with that file.

Please ask about this on the wx-dev list, as I don't know what the best
way to fix this is, and somebody there probably will know.

I'll report the changes there.

I did have to change part of the wxPython build. In config.py
there's a check for the arch. type

     if sys.platform[:6] == "darwin":

This doesn't check if I'm trying to build for gtk instead of
native. That prevents setup.py from getting the right cflags.

I hacked around it; don't have a correct patch.

BTW, while playing around I noticed that XMLtreeview.py needs
a 'py2' which isn't defined anywhere in the module.

          Andrew Dalke
          dalke@dalkescientific.com

Andrew Dalke wrote:

Hi,

  I'm trying to compile wxPython 2.5.3.1 under OS X for X, not for
the native GUI. Why? I'm trying to find some combination of wx
and VTK that I can get compiled for this system I can't get a
build of VTK on my own but fink managed, so I'm trying that way.

FWIW, I understand that people have PyGTK and VTK working well on OS-X, so that may be another option, depending on how committed you are to wxPython. That being said, I'd love to see wxPython+VTK working on OS-X, though I'd be happier if it was the native version, rather than X.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

This is somewhat related to the message I posted last week (or somewhere
thereabouts).

I have an application that reads AD signals, and communicates with a
wxPython application that performs some calculations and continuously
displays the results.

In my wxPython application I've created a wxTimer object and an
EVT_TIMER handler to update my display. This works beautifully on my
linux box (Debian Sarge, wxWidgets 2.4.2), no problems whatsoever.
However on WindowsXP & wxWidgets 2.4.2, the application controls are
very unresponsive... for example, it sometimes takes several mouse
clicks on a button to register the event. The situation improves a bit
if I increase the milliseconds parameter to wxTimer.Start().

There's a very short blurb in the wxWidgets documentation that says "in
MS Windows timers are a limited resource", but little information about
what this implies or how to work around it (most of my programming
experience is with Unix/Linux... I don't know Windows very well) Several
Google searches haven't turned up any clues either.

Any information/hints/clues or FM's to R would be greatly appreciated.
TIA

I've implemented a thread modeled after the threads example in the
wxPython demo. The thread waits on time.sleep() then posts an event.
I'm still having the same problem. On windows, if I try to post events
faster than about three events a second, the gui controls become
unresponsive. Again, this works fine in linux... I can post as many as
100 events a second without any problems with the gui. Any help would
be greatly appreciated TIA

···

On Fri, 2004-11-12 at 10:37, Jeffrey Hurt wrote:

This is somewhat related to the message I posted last week (or somewhere
thereabouts).

I have an application that reads AD signals, and communicates with a
wxPython application that performs some calculations and continuously
displays the results.

In my wxPython application I've created a wxTimer object and an
EVT_TIMER handler to update my display. This works beautifully on my
linux box (Debian Sarge, wxWidgets 2.4.2), no problems whatsoever.
However on WindowsXP & wxWidgets 2.4.2, the application controls are
very unresponsive... for example, it sometimes takes several mouse
clicks on a button to register the event. The situation improves a bit
if I increase the milliseconds parameter to wxTimer.Start().

There's a very short blurb in the wxWidgets documentation that says "in
MS Windows timers are a limited resource", but little information about
what this implies or how to work around it (most of my programming
experience is with Unix/Linux... I don't know Windows very well) Several
Google searches haven't turned up any clues either.

Any information/hints/clues or FM's to R would be greatly appreciated.
TIA

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

Jeffrey Hurt wrote:

This is somewhat related to the message I posted last week (or somewhere
thereabouts).

I have an application that reads AD signals, and communicates with a
wxPython application that performs some calculations and continuously
displays the results.

In my wxPython application I've created a wxTimer object and an
EVT_TIMER handler to update my display. This works beautifully on my
linux box (Debian Sarge, wxWidgets 2.4.2), no problems whatsoever. However on WindowsXP & wxWidgets 2.4.2, the application controls are
very unresponsive... for example, it sometimes takes several mouse
clicks on a button to register the event. The situation improves a bit
if I increase the milliseconds parameter to wxTimer.Start().

There's a very short blurb in the wxWidgets documentation that says "in
MS Windows timers are a limited resource", but little information about
what this implies or how to work around it (most of my programming
experience is with Unix/Linux... I don't know Windows very well) Several
Google searches haven't turned up any clues either.

Any information/hints/clues or FM's to R would be greatly appreciated. TIA

We have a class for using Win32 Waitable Timers (which will interrupt threads and are threadsafe) instead of standard Windows timers from a wxTimer class. There's a thread on wx-dev from about September 2002 about this - never got the code included for some reason ... but its very useful in our code.
I've attached the code here in case you find it useful. Have a look at the MSDN docs on Waitable Timers (and other kinds of timers).
One of the main advantages is that you can run the timer in a separate thread. You could also try modify the code to use a different kind of timer.
Of course for any of these you need to do C++ compiling ... :slight_smile:
I'd be interested to hear if you find this useful.

David

waitabletimer.cpp (6.47 KB)

waitabletimer.h (1.15 KB)

Andrew Dalke wrote:

I did have to change part of the wxPython build. In config.py
there's a check for the arch. type

    if sys.platform[:6] == "darwin":

This doesn't check if I'm trying to build for gtk instead of
native. That prevents setup.py from getting the right cflags.

I already have a fix for that in the CVS version.

BTW, while playing around I noticed that XMLtreeview.py needs
a 'py2' which isn't defined anywhere in the module.

Thanks, I've taken care of that.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Jeffrey Hurt wrote:

This is somewhat related to the message I posted last week (or somewhere
thereabouts).

I have an application that reads AD signals, and communicates with a
wxPython application that performs some calculations and continuously
displays the results.

In my wxPython application I've created a wxTimer object and an
EVT_TIMER handler to update my display. This works beautifully on my
linux box (Debian Sarge, wxWidgets 2.4.2), no problems whatsoever. However on WindowsXP & wxWidgets 2.4.2, the application controls are
very unresponsive... for example, it sometimes takes several mouse
clicks on a button to register the event. The situation improves a bit
if I increase the milliseconds parameter to wxTimer.Start().

Please try to reproduce the problem in a small standalone application that we can experiment with.

There's a very short blurb in the wxWidgets documentation that says "in
MS Windows timers are a limited resource", but little information about
what this implies or how to work around it (most of my programming
experience is with Unix/Linux... I don't know Windows very well) Several
Google searches haven't turned up any clues either.

That should only be a problem on win9x platforms and if you have many timers (dozens?) active at once.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!