#29 Linking with wxGTK-2.9.1 broken

closed-fixed
5
2011-01-22
2011-01-22
No

wx-config from 2.9 behaves differently with regard to --libs than previous versions. In 2.8 all libraries were output:

$ wx-config-2.8 --libs
-L/usr/lib64 -pthread -lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8 -lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 -lwx_baseu_net-2.8 -lwx_baseu-2.8

However, in 2.9 only the "std" libraries are listed:

$ wx-config-2.9 --libs
-L/usr/lib64 -pthread -lwx_gtk2u_xrc-2.9 -lwx_gtk2u_html-2.9 -lwx_gtk2u_qa-2.9 -lwx_gtk2u_adv-2.9 -lwx_gtk2u_core-2.9 -lwx_baseu_xml-2.9 -lwx_baseu_net-2.9 -lwx_baseu-2.9

Because the aui library isn't included here like it was in 2.8, linking fails with undefined references:

x86_64-unknown-linux-gnu-g++ -O2 -march=native -g -pipe -fno-strict-aliasing -W -Wall -Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed -o xchm chmapp.o chmfile.o chmframe.o chmfshandler.o chminputstream.o chmfontdialog.o chmhtmlnotebook.o chmsearchpanel.o chmhtmlwindow.o chmfinddialog.o chmindexpanel.o chmlistctrl.o spantag.o hhcparser.o -L/usr/lib64 -pthread -lwx_gtk2u_xrc-2.9 -lwx_gtk2u_html-2.9 -lwx_gtk2u_qa-2.9 -lwx_gtk2u_adv-2.9 -lwx_gtk2u_core-2.9 -lwx_baseu_xml-2.9 -lwx_baseu_net-2.9 -lwx_baseu-2.9 -lchm
chmhtmlnotebook.o: In function `CHMHtmlNotebook::OnPageChanged(wxAuiNotebookEvent&)':
/var/tmp/portage/app-text/xchm-1.18/work/xchm-1.18/src/chmhtmlnotebook.cpp:185: undefined reference to `wxAuiNotebook::GetPageCount() const'
chmhtmlnotebook.o: In function `CHMHtmlNotebook::AddPage(wxWindow*, wxString const&)':

According to http://trac.wxwidgets.org/ticket/9707 the solution is to use `wx-config --libs std,aui`. This will also work with 2.8's wx-config.

Discussion

  • Fixed in 1.19.

     
    • status: open --> closed-fixed