#15327 closed build error (fixed)

In wxX11-2.9.5 the 'widgets' and 'animate' samples don't build

Reported by: dghart Owned by:
Priority: normal Milestone: 2.9.5
Component: wxX11 Version: stable-latest
Keywords: wxX11-2.9.5 samples linking Cc: kosenko
Blocked By: Blocking:
Patch: yes

Description

As mentioned (too briefly. Sorry.) in #15305, the 'animate' sample fails to link in wxX11-2.9.5. Less unimportantly, so does 'widgets' because of its wxAnimate component.

The slightly-snipped output from 'animate' is:

anitest_anitest.o: In function `MyFrame::OnOpen(wxCommandEvent&)':
samples/animate/../../../samples/animate/anitest.cpp:303: undefined reference to `wxAnimation::Load(...)'
anitest_anitest.o: In function `wxAnimation::wxAnimation()':
samples/animate/../../../include/wx/generic/animate.h:26: undefined reference to `vtable for wxAnimation'
anitest_anitest.o: In function `wxAnimationCtrl::wxAnimationCtrl(...)':
samples/animate/../../../include/wx/generic/animate.h:81: undefined reference to `vtable for wxAnimationCtrl'
samples/animate/../../../include/wx/generic/animate.h:81: undefined reference to `vtable for wxAnimationCtrl'
samples/animate/../../../include/wx/generic/animate.h:82: undefined reference to `wxAnimationCtrl::Init()'
samples/animate/../../../include/wx/generic/animate.h:84: undefined reference to `wxAnimationCtrl::Create...)'
anitest_anitest.o: In function `wxAnimation::~wxAnimation()':
samples/animate/../../../include/wx/generic/animate.h:23: undefined reference to `vtable for wxAnimation'

The reason seems to be that src/generic/animateg.cpp isn't built in wxX11. Looking at build/bakefiles/files.bkl there's a comment: "Don't include src/generic/animateg.cpp many times...". However afaict for wxX11 it's not included at all.

There are various places in that file where it could be added. I'll leave it to someone who understands the situation to decide which is best.

Attachments (1)

files.bkl.diff download (483 bytes) - added by dghart 13 months ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 13 months ago by vadz

  • Cc kosenko added
  • Status changed from new to confirmed

I don't understand what's going on here :-( I reverted the changes of r73290 but somehow it still doesn't work. I guess I'll need to look at this again in the morning unless Kolya seems something I don't...

comment:2 Changed 13 months ago by vadz

OK, it was too late yesterday, I redid the same thing today and it worked without problems (that I can see, anyhow). No idea what happened yesterday.

comment:3 Changed 13 months ago by VZ

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

(In [74499]) Do include src/generic/animateg.cpp in wxUniv/X11 sources.

This fixes linking of the widgets sample when using wxUniv/X11.

It partially reverts the changes of r73290 which only included this file in
some selected ports instead of all of them for some reason.

Closes #15327.

Changed 13 months ago by dghart

comment:4 Changed 13 months ago by dghart

FWIW, I'd just been testing a lesser, wxX11-specific reversion (attached), which I confirm also works for both samples in wxX11.

comment:5 Changed 13 months ago by kosenko

  • Patch set
  • Resolution fixed deleted
  • Status changed from closed to reopened

Yes, this patch should fix wxX11/Univ build and don't break wxGTK/Win32 build.

comment:6 Changed 13 months ago by vadz

  • Status changed from reopened to infoneeded_new

Could you please what exactly is broken now? I just don't understand what does wxUniv have to do with wxGTK/Win32 at all. AFAICS this file should be always used in wxUniv...

comment:7 Changed 13 months ago by kosenko

  • Status changed from infoneeded_new to new

After changes in r74499 and when wxGTK/Win32 build is enabled error occured when I try to regenerate mingw and msvc bakefile formats. error: failed to set variable '__objtmp' to value '$(sources2objects(value, id, OBJEXT))': 'NoneType' object has no attribute 'exprs'. It is probably because of src/generic/animateg.cpp file included many times in the same build.

This revision has no affect on Visual C++ project files.

comment:8 follow-up: Changed 13 months ago by vadz

Huh. The error message makes absolutely no sense to me but I still don't see why applying this patch is the right thing to do.

Does the error still happen if you disable wxUniv completely?

comment:9 in reply to: ↑ 8 Changed 13 months ago by kosenko

Huh. The error message makes absolutely no sense to me but I still don't see why applying this patch is the right thing to do.

Yes, I think it is weird error in bakefile generator. msvs2008prj works but msvc doesn't that make no sense.

Does the error still happen if you disable wxUniv completely?

It is error in bakefile generator, so I am unable generate mingw and msvc formats to build something, including wxUniv.

Bakefile error gone when I completly remove src/generic/animateg.cpp from ADVANCED_UNIV_SRC but this should produce linking errors.

You can enable wxGTK/Win32 port in bakefiles as described in docs/msw/gtk.txt and try to regenerate mingw and msvc formats to see error message.

comment:10 Changed 13 months ago by vadz

OK, I give up, I don't understand anything in what's going on here (and it's getting late again...) so I'll just apply David's patch and be done with it. Thanks David!

comment:11 Changed 13 months ago by VZ

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

(In [74510]) Better fix for wxX11 linking problems than r74499.

Fix wxX11 without breaking wxGTK/Windows makefiles generation.

Closes #15327.

Note: See TracTickets for help on using tickets.