Opened 4 years ago

Closed 4 years ago

#15305 closed build error (fixed)

Programs using wxX11 fail to link

Reported by: dghart Owned by:
Priority: high Milestone: 2.9.5
Component: build Version: stable-latest
Keywords: wxX11 wxGUIEventLoop wxEventLoopSourcesManager Cc: rob@…
Blocked By: Blocking:
Patch: no

Description

Testing wxX11 pre the 2.9.5 release, it builds OK. However linking 'minimal' fails with 'undefined reference to wxGUIAppTraits::GetEventLoopSourcesManager()'. This seems only to be defined in src/gtk/evtloop and src/osx/core/utilsexc_cf.cpp. I'm not the wxMotif user, but presumably it will fail there too.

I also tried building 'widgets'. This had the same problem, of course, but also complained of an undefined reference to `vtable for wxAnimation'. The 'animate' sample found more missing items, and they are indeed missing from libwx_x11univu_adv-2.9. Looking at the wxX11 Makefile and build output, I can't see that animateg.cpp is being built.

Attachments (6)

wxbld.log download (47.4 KB) - added by rowbearto 4 years ago.
Build log
wxbld.2.log download (47.0 KB) - added by rowbearto 4 years ago.
0001-AddSourceForFd-implementation-for-x11.patch download (6.9 KB) - added by rowbearto 4 years ago.
wx11-linking-works.patch download (1.6 KB) - added by rowbearto 4 years ago.
Patch to make X11 linking work.
wxbld.3.log download (14.0 KB) - added by rowbearto 4 years ago.
wxMotif build log
wxbld.4.log download (14.0 KB) - added by rowbearto 4 years ago.
wxMotif build log

Download all attachments as: .zip

Change History (18)

comment:1 Changed 4 years ago by vadz

  • Cc rob@… added
  • Keywords wxGUIEventLoop wxEventLoopSourcesManager added; 2.9.5 removed
  • Priority changed from normal to high
  • Status changed from new to confirmed
  • Summary changed from wxX11 fails to link its samples to Programs using wxX11 fail to link

Oops, I completely forgot to test wxX11 build before committing these changes (I had planned to do it initially but then it just slipped out of my mind), thanks for doing this!

The part of r74350 that just removed the calls to XtAppAddInput() was clearly wrong, we need to implement wxGUIAppTraits::GetEventLoopSourcesManager() returning an object of wxEventLoopSourcesManagerX11 class that would use this function for its AddSourceForFD() implementation.

Alternatively we could just get rid of wxGUIEventLoop in wxX11 entirely and use the console Unix event loop in it. This would require adding an event source for ConnectionNumber() (see src/x11/evtloop.cpp) to it and arranging to call XNextEvent() when input is detected on it. This would fix the hack with polling in X11 event loop and would get rid of all this rarely used and tested code. But this will probably require even more changes than implementing wxEventLoopSourcesManagerX11 so perhaps it's not the right time to do it.

And one of the same fixes should be applied to wxMotif too...

Rob, if you could look at this it would be really great, otherwise I'll try to do it myself but we risk to have to postpone 2.9.5 then.

Changed 4 years ago by rowbearto

Build log

comment:2 Changed 4 years ago by rowbearto

I'm actually on vacation now until Monday, so its going to be hard for me to work on this. However, programming is my hobby (and also my profession) so I don't mind trying it in my free time here (which is not that much, just an hour maybe at night). But I can't commit a date to you. If you want it sooner you may want to try it yourself.

I just tried the X11 build on my VM which is "Ubuntu 10.04.4 LTS", but it ran into issues. I also remember trying building Motif some time ago, and I also had issues with that too.

I've attached a log of my X11 build so you can see the errors. If you can help me get past this, so I can build and test on X11, I can see what I can do.

I fed these options to ./configure:

--with-x11 --enable-gui --enable-debug --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin --with-regex=builtin --with-zlib=builtin --enable-permissive --with-expat=builtin --enable-unicode

I performed this build after a fresh 'git pull' on the master, so you can use the line numbers from the head to correlate the error messages.

Can't analyze more right now, off to the lake with the family. But if you answer this by tonight I may be able to do the next step of x11 build.

comment:3 Changed 4 years ago by vadz

This is clearly due to using --enable-permissive, simply removing it should fix it. Alternatively, specifying --without-regex could help too but this is a less commonly used configuration.

But your family probably won't appreciate you working on this during your vacations (I know my doesn't ;-)...

comment:4 Changed 4 years ago by rowbearto

Forgot the paddles, so had to come back from the lake for just a moment :)

I took away the --enable-permissive, looks like similar issue. I attach the log again, what do you think?.

Back to the lake now.

Changed 4 years ago by rowbearto

comment:5 Changed 4 years ago by vadz

Sorry, this one was actually a completely independent breakage and was fixed by r74461 in the meanwhile.

Happy paddling!

comment:6 Changed 4 years ago by rowbearto

After pulling the latest head, I was able to do X11 build.

When I tried building the GUI tests, I get errors when building fonttest.cpp(shown below). So this build error on the gui test build would need to be fixed before testing.

I made the changes to use XtAppAddInput() in X11 build, and a patch is attached. However, I get compile errors because XtPointer and XtInputId are undefined. I can't find any .h file in /usr/include/X11 that defines them. Maybe they are Motif only? I noticed that before the wxExecute fix, that only the Motif source files had the XtAppAddInput() call (and not X11 build). I don't see a version of "AddProcessCallback()" for X11 build before the wxExecute patch, so I don't understand how this was handled before in X11 build.

As I'm on vacation and I don't have much time to spend on this, and also I have not worked on X11 or Motif builds before, maybe you (Vadim) should take over from here? Or, if you can get me past these issues, I can try again tomorrow in my limited time.

Build errors for test build in fonttest.cpp:

/home/rob/wx/wxgit-x86-x11-gui-build/bk-deps g++ -c -o test_gui_fonttest.o -I./.pch/testprec_test_gui -DWXX11 -DWXUNIVERSAL -I/rob-server/robb/wx/wxgit/wxWidgets/tests -I/rob-server/robb/wx/wxgit/wxWidgets/tests/../samples -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -D_FILE_OFFSET_BITS=64 -I/home/rob/wx/wxgit-x86-x11-gui-build/lib/wx/include/x11univ-unicode-static-2.9 -I/rob-server/robb/wx/wxgit/wxWidgets/include -D_REENTRANT -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -DWX_PRECOMP -pthread -g -O0 -pthread -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -pthread -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -pthread -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include /rob-server/robb/wx/wxgit/wxWidgets/tests/font/fonttest.cpp
/rob-server/robb/wx/wxgit/wxWidgets/tests/font/fonttest.cpp: In member function ‘void FontTestCase::NativeFontInfo()’:
/rob-server/robb/wx/wxgit/wxWidgets/tests/font/fonttest.cpp:261: error: no matching function for call to ‘wxFont::wxFont(wxString)’
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:82: note: candidates are: wxFont::wxFont(const wxNativeFontInfo&)
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:62: note: wxFont::wxFont(const wxSize&, wxFontFamily, wxFontStyle, wxFontWeight, bool, const wxString&, wxFontEncoding)
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:51: note: wxFont::wxFont(int, wxFontFamily, wxFontStyle, wxFontWeight, bool, const wxString&, wxFontEncoding)
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:39: note: wxFont::wxFont(int, int, int, int, bool, const wxString&, wxFontEncoding)
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:24: note: wxFont::wxFont(const wxFontInfo&)
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:22: note: wxFont::wxFont()
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:19: note: wxFont::wxFont(const wxFont&)
/rob-server/robb/wx/wxgit/wxWidgets/tests/font/fonttest.cpp:265: error: no matching function for call to ‘wxFont::wxFont(wxString)’
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:82: note: candidates are: wxFont::wxFont(const wxNativeFontInfo&)
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:62: note: wxFont::wxFont(const wxSize&, wxFontFamily, wxFontStyle, wxFontWeight, bool, const wxString&, wxFontEncoding)
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:51: note: wxFont::wxFont(int, wxFontFamily, wxFontStyle, wxFontWeight, bool, const wxString&, wxFontEncoding)
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:39: note: wxFont::wxFont(int, int, int, int, bool, const wxString&, wxFontEncoding)
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:24: note: wxFont::wxFont(const wxFontInfo&)
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:22: note: wxFont::wxFont()
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:19: note: wxFont::wxFont(const wxFont&)
/rob-server/robb/wx/wxgit/wxWidgets/tests/font/fonttest.cpp:270: error: no matching function for call to ‘wxFont::wxFont(wxString)’
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:82: note: candidates are: wxFont::wxFont(const wxNativeFontInfo&)
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:62: note: wxFont::wxFont(const wxSize&, wxFontFamily, wxFontStyle, wxFontWeight, bool, const wxString&, wxFontEncoding)
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:51: note: wxFont::wxFont(int, wxFontFamily, wxFontStyle, wxFontWeight, bool, const wxString&, wxFontEncoding)
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:39: note: wxFont::wxFont(int, int, int, int, bool, const wxString&, wxFontEncoding)
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:24: note: wxFont::wxFont(const wxFontInfo&)
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:22: note: wxFont::wxFont()
/rob-server/robb/wx/wxgit/wxWidgets/include/wx/x11/font.h:19: note: wxFont::wxFont(const wxFont&)
make: * [test_gui_fonttest.o] Error 1

comment:7 Changed 4 years ago by vadz

Thanks for looking at this!

fonttest errors are probably simple to fix but for now it could be just excluded from the compilation, either by editing tests/Makefile and removing test_gui_fonttest.o from TEST_GUI_OBJECTS or just commenting out/removing the offending part of the file.

Concerning how it worked before: I'm confused by this too, actually... I see that r74350 removed relevant code from src/motif/utils.cpp but X11 didn't even have it. So maybe it didn't work there even before after all? In this case it would be enough to just make it link for 2.9.5 to at least avoid regressing.

Changed 4 years ago by rowbearto

Patch to make X11 linking work.

comment:8 Changed 4 years ago by rowbearto

I have just added a patch to get wxX11 linking to work.

wxExecute remains unsupported in wxX11, as it was not supported previously. However, now at least wxX11 will link.

On to wxMotif next...

comment:9 Changed 4 years ago by rowbearto

I'm trying to build Motif, but I'm running into errors.

I attached a log file of my build.

Using Ubuntu 10.04.4, using Ubuntu software center, I installed 'lesstif2-dev' and 'lesstif2-dev'

I passed this to configure:

--with-motif --enable-debug --with-libpng=builtin --with-libjpeg=builtin --with-libtiff=builtin --with-regex=builtin --with-zlib=builtin --with-expat=builtin --enable-unicode

I also tried with --disable-shared, got same error.

The end of the build log (still in ./configure) shows this:

checking for IceConnectionNumber in -lICE... yes
checking for Motif/Lesstif headers... found in /usr/include
checking for Motif/Lesstif library... found in /usr/lib
checking if we need -lXp and/or -lSM -lICE... can't find the right libraries
configure: error: can't link a simple motif program
make -j2 2>&1 | tee -a robbmake.log
make: * No targets specified and no makefile found. Stop.
make install 2>&1 | tee -a robbmake.log
make:
* No rule to make target `install'. Stop.

Changed 4 years ago by rowbearto

wxMotif build log

comment:10 Changed 4 years ago by dghart

Hi Rob,

It looks as if the lesstif2-dev package in debian wheezy (and presumably ubuntu raring) is missing the .so symlink to /usr/lib/x86_64-linux-gnu/libXmu.so.6. Creating that in /usr/lib/x86_64-linux-gnu/ by hand with:
sudo ln -s libXmu.so.6 libXmu.so
fixed configuring.

The build then failed as expected with:
../src/motif/evtloop.cpp:124:40: error: no ‘void wxGUIEventLoop::SchduleExit(int)’ member function declared in class ‘wxGUIEventLoop’

comment:11 Changed 4 years ago by VZ

(In [74477]) Add wxX11EventLoopSourcesManager stub implementation to fix wxX11 linking.

Asynchronous wxExecute() still doesn't work in wxX11 but at least the programs
using the library can be linked now.

See #15305.

comment:12 Changed 4 years ago by vadz

OK, I've restored the old wxMotif code and -- miracle -- the tests pass now. I'll commit this now but it would be actually nice to do the same thing for X11 too if anybody really cares about it...

comment:13 Changed 4 years ago by VZ

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [74480]) Implement monitoring of file descriptors in wxMotif event loop.

This allows applications using wxMotif to link again after the changes of
r74350 -- and wxExecute() unit tests actually pass, too.

Closes #15305.

Note: See TracTickets for help on using tickets.