From: mathias.spoerr on
Hello,

I have problems with building wxPropertyGrid under Ubuntu 8.10. I
already asked the author Jaakko Salli, but unfortunately he has no
more idea.
I want to have a staic ansi release build of the wxPropertyGrid lib.
For this I built my own static ansi release wxWidgets version:

mspoerr(a)mspoerr-laptop:~/Desktop/propgrid/bneu$ wx-config --list

Default config is gtk2-ansi-release-static-2.8

Default config will be used for output

Alternate matches:
gtk2-ansi-debug-static-2.8

mspoerr(a)mspoerr-laptop:~/Desktop/propgrid/bneu$

I am able to build small wxWidgets apps and all samples. When trying
to build wxPropertyGrid, I get the following errors:

----------------------------------------------------------------
Configuration for PROPGRID 1.4.4 successfully completed.
Summary of main configuration settings for PROPGRID:
- RELEASE build
- ANSI mode
- STATIC mode

The wxWidgets build which will be used by PROPGRID 1.4.4
has the following settings:
- RELEASE build
- ANSI mode
- STATIC mode
- VERSION: 2.8.10
- PORT: gtk2

Now, just run make.
----------------------------------------------------------------
mspoerr(a)mspoerr-laptop:~/Desktop/propgrid$ make
/home/mspoerr/Desktop/propgrid/bk-deps g++ -c -o
propgrid_lib_advprops.o -I./include -I/usr/local/lib/wx/include/gtk2-
ansi-release-static-2.8 -I/usr/local/include/wx-2.8 -
D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -g -O2 -O2 ./
src/advprops.cpp
/home/mspoerr/Desktop/propgrid/bk-deps g++ -c -o
propgrid_lib_editors.o -I./include -I/usr/local/lib/wx/include/gtk2-
ansi-release-static-2.8 -I/usr/local/include/wx-2.8 -
D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -g -O2 -O2 ./
src/editors.cpp
/home/mspoerr/Desktop/propgrid/bk-deps g++ -c -o propgrid_lib_extras.o
-I./include -I/usr/local/lib/wx/include/gtk2-ansi-release-static-2.8 -
I/usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -
D__WXGTK__ -pthread -g -O2 -O2 ./src/extras.cpp
/home/mspoerr/Desktop/propgrid/bk-deps g++ -c -o
propgrid_lib_manager.o -I./include -I/usr/local/lib/wx/include/gtk2-
ansi-release-static-2.8 -I/usr/local/include/wx-2.8 -
D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -g -O2 -O2 ./
src/manager.cpp
/home/mspoerr/Desktop/propgrid/bk-deps g++ -c -o
propgrid_lib_odcombo.o -I./include -I/usr/local/lib/wx/include/gtk2-
ansi-release-static-2.8 -I/usr/local/include/wx-2.8 -
D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -g -O2 -O2 ./
src/odcombo.cpp
/home/mspoerr/Desktop/propgrid/bk-deps g++ -c -o
propgrid_lib_propgrid.o -I./include -I/usr/local/lib/wx/include/gtk2-
ansi-release-static-2.8 -I/usr/local/include/wx-2.8 -
D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -g -O2 -O2 ./
src/propgrid.cpp
/home/mspoerr/Desktop/propgrid/bk-deps g++ -c -o propgrid_lib_props.o -
I./include -I/usr/local/lib/wx/include/gtk2-ansi-release-static-2.8 -I/
usr/local/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -
D__WXGTK__ -pthread -g -O2 -O2 ./src/props.cpp
rm -f lib/libwxcode_gtk2_propgrid-2.8.a
ar rcu lib/libwxcode_gtk2_propgrid-2.8.a propgrid_lib_advprops.o
propgrid_lib_editors.o propgrid_lib_extras.o propgrid_lib_manager.o
propgrid_lib_odcombo.o propgrid_lib_propgrid.o propgrid_lib_props.o
ranlib lib/libwxcode_gtk2_propgrid-2.8.a
/home/mspoerr/Desktop/propgrid/bk-deps g++ -c -o
propgridsample_minimal.o -I./include -I/usr/local/lib/wx/include/gtk2-
ansi-release-static-2.8 -I/usr/local/include/wx-2.8 -
D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -g -O2 -O2 ./
samples/minimal.cpp
/home/mspoerr/Desktop/propgrid/bk-deps g++ -c -o
propgridsample_propgridsample.o -I./include -I/usr/local/lib/wx/
include/gtk2-ansi-release-static-2.8 -I/usr/local/include/wx-2.8 -
D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -g -O2 -O2 ./
samples/propgridsample.cpp
/home/mspoerr/Desktop/propgrid/bk-deps g++ -c -o
propgridsample_sampleprops.o -I./include -I/usr/local/lib/wx/include/
gtk2-ansi-release-static-2.8 -I/usr/local/include/wx-2.8 -
D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -g -O2 -O2 ./
samples/sampleprops.cpp
/home/mspoerr/Desktop/propgrid/bk-deps g++ -c -o
propgridsample_tests.o -I./include -I/usr/local/lib/wx/include/gtk2-
ansi-release-static-2.8 -I/usr/local/include/wx-2.8 -
D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -g -O2 -O2 ./
samples/tests.cpp
/home/mspoerr/Desktop/propgrid/bk-deps g++ -c -o
propgridsample_xh_propgrid.o -I./include -I/usr/local/lib/wx/include/
gtk2-ansi-release-static-2.8 -I/usr/local/include/wx-2.8 -
D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -g -O2 -O2 ./
src/xh_propgrid.cpp
g++ -o samples/propgridsample propgridsample_minimal.o
propgridsample_propgridsample.o propgridsample_sampleprops.o
propgridsample_tests.o propgridsample_xh_propgrid.o -L./lib -L./lib -
lwxcode_gtk2_propgrid-2.8 -L/usr/local/lib -pthread /usr/local/lib/
libwx_base-2.8.a /usr/local/lib/libwx_gtk2_core-2.8.a /usr/local/lib/
libwx_base_xml-2.8.a /usr/local/lib/libwx_gtk2_xrc-2.8.a /usr/local/
lib/libwx_gtk2_adv-2.8.a -lwxtiff-2.8 -lwxjpeg-2.8 -ldl -pthread -lgtk-
x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lm -
lgio-2.0 -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -
lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lXinerama -lSM -lpng -lz -
lexpat
/usr/local/lib/libwx_gtk2_core-2.8.a(corelib_gtk_dataobj.o): In
function `wxBitmapDataObject::DoConvertToPng()':
dataobj.cpp:(.text+0x17f): undefined reference to
`wxMemoryOutputStream::wxMemoryOutputStream(void*, unsigned int)'
dataobj.cpp:(.text+0x19e): undefined reference to
`wxMemoryOutputStream::~wxMemoryOutputStream()'
dataobj.cpp:(.text+0x1fd): undefined reference to
`wxMemoryOutputStream::~wxMemoryOutputStream()'
/usr/local/lib/libwx_gtk2_core-2.8.a(corelib_gtk_dataobj.o): In
function `wxBitmapDataObject::SetData(unsigned int, void const*)':
dataobj.cpp:(.text+0x2b9): undefined reference to
`wxMemoryInputStream::wxMemoryInputStream(void const*, unsigned int)'
dataobj.cpp:(.text+0x35a): undefined reference to
`wxMemoryInputStream::~wxMemoryInputStream()'
dataobj.cpp:(.text+0x392): undefined reference to
`wxMemoryInputStream::~wxMemoryInputStream()'
/usr/local/lib/libwx_gtk2_core-2.8.a(corelib_gtk_window.o): In
function `wxWindow::GtkSendPaintEvents()':
window.cpp:(.text+0x768e): undefined reference to
`wxSystemOptions::GetOptionet(wxString const&)'
/usr/local/lib/libwx_gtk2_core-2.8.a(corelib_gtk_control.o): In
function `wxGtkFixSensitivity(wxWindow*)':
control.cpp:(.text+0x851): undefined reference to
`wxSystemOptions::GetOptionet(wxString const&)'
/usr/local/lib/libwx_gtk2_core-2.8.a(corelib_rendcmn.o): In function
`wxRendererNative::Load(wxString const&)':
rendcmn.cpp:(.text+0x222): undefined reference to
`wxDynamicLibrary::CanonicalizePluginName(wxString const&,
wxPluginCategory)'
rendcmn.cpp:(.text+0x243): undefined reference to
`wxDynamicLibrary::Load(wxString const&, int)'
rendcmn.cpp:(.text+0x286): undefined reference to
`wxDynamicLibrary::GetSymbol(wxString const&, bool*) const'
rendcmn.cpp:(.text+0x345): undefined reference to
`wxDynamicLibrary::Unload(void*)'
rendcmn.cpp:(.text+0x3ef): undefined reference to
`wxDynamicLibrary::Unload(void*)'
.......
.......
/usr/local/lib/libwx_gtk2_core-2.8.a(corelib_sizer.o):
(.rodata._ZTV16wxStaticBoxSizer[vtable for wxStaticBoxSizer]+0x7c):
undefined reference to `wxClientDataContainer::DoSetClientObject
(wxClientData*)'
/usr/local/lib/libwx_gtk2_core-2.8.a(corelib_sizer.o):
(.rodata._ZTV16wxStaticBoxSizer[vtable for wxStaticBoxSizer]+0x80):
undefined reference to `wxClientDataContainer::DoGetClientObject()
const'
/usr/local/lib/libwx_gtk2_core-2.8.a(corelib_sizer.o):
(.rodata._ZTV16wxStaticBoxSizer[vtable for wxStaticBoxSizer]+0x84):
undefined reference to `wxClientDataContainer::DoSetClientData
(void*)'
.......
.......
collect2: ld gab 1 als Ende-Status zurück
make: *** [samples/propgridsample] Fehler 1

mspoerr(a)mspoerr-laptop:~/Desktop/propgrid$ sudo make install
[sudo] password for mspoerr:
g++ -o samples/propgridsample propgridsample_minimal.o
propgridsample_propgridsample.o propgridsample_sampleprops.o
propgridsample_tests.o propgridsample_xh_propgrid.o -L./lib -L./lib -
lwxcode_gtk2_propgrid-2.8 -L/usr/local/lib -pthread /usr/local/lib/
libwx_base-2.8.a /usr/local/lib/libwx_gtk2_core-2.8.a /usr/local/lib/
libwx_base_xml-2.8.a /usr/local/lib/libwx_gtk2_xrc-2.8.a /usr/local/
lib/libwx_gtk2_adv-2.8.a -lwxtiff-2.8 -lwxjpeg-2.8 -ldl -pthread -lgtk-
x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lm -
lgio-2.0 -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -
lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lXinerama -lSM -lpng -lz -
lexpat
/usr/local/lib/libwx_gtk2_core-2.8.a(corelib_gtk_dataobj.o): In
function `wxBitmapDataObject::DoConvertToPng()':
dataobj.cpp:(.text+0x17f): undefined reference to
`wxMemoryOutputStream::wxMemoryOutputStream(void*, unsigned int)'
dataobj.cpp:(.text+0x19e): undefined reference to
`wxMemoryOutputStream::~wxMemoryOutputStream()'
dataobj.cpp:(.text+0x1fd): undefined reference to
`wxMemoryOutputStream::~wxMemoryOutputStream()'
/usr/local/lib/libwx_gtk2_core-2.8.a(corelib_gtk_dataobj.o): In
function `wxBitmapDataObject::SetData(unsigned int, void const*)':
dataobj.cpp:(.text+0x2b9): undefined reference to
`wxMemoryInputStream::wxMemoryInputStream(void const*, unsigned int)'
dataobj.cpp:(.text+0x35a): undefined reference to
`wxMemoryInputStream::~wxMemoryInputStream()'
dataobj.cpp:(.text+0x392): undefined reference to
`wxMemoryInputStream::~wxMemoryInputStream()'
.......
.......
collect2: ld gab 1 als Ende-Status zurück
make: *** [samples/propgridsample] Fehler 1
mspoerr(a)mspoerr-laptop:~/Desktop/propgrid$


In my application I get the following errors when linking to
libwxcode_gtk2_propgrid-2.8.a

linking wktools4 (g++)
linking wktools4 (g++)
/home/mspoerr/Desktop/propgrid/lib/libwxcode_gtk2_propgrid-2.8.a
(propgrid_lib_advprops.o): In function
`wxPGDatePickerCtrlEditor::OnEvent(wxPropertyGrid*, wxPGProperty*,
wxWindow*, wxEvent&) const':
/home/mspoerr/Desktop/propgrid/./src/advprops.cpp:531: undefined
reference to `wxEVT_DATE_CHANGED'
/home/mspoerr/Desktop/propgrid/lib/libwxcode_gtk2_propgrid-2.8.a
(propgrid_lib_advprops.o): In function
`wxPGSpinCtrlEditor::CreateControls(wxPropertyGrid*, wxPGProperty*,
wxPoint const&, wxSize const&) const':
/home/mspoerr/Desktop/propgrid/./src/advprops.cpp:275: undefined
reference to `wxSpinButton::wxSpinButton()'
/home/mspoerr/Desktop/propgrid/./src/advprops.cpp:281: undefined
reference to `wxSpinButton::Create(wxWindow*, int, wxPoint const&,
wxSize const&, long, wxString const&)'
/home/mspoerr/Desktop/propgrid/lib/libwxcode_gtk2_propgrid-2.8.a
(propgrid_lib_advprops.o): In function `wxDatePickerCtrlGeneric':
/usr/local/include/wx-2.8/wx/generic/datectrl.h:25: undefined
reference to `vtable for wxDatePickerCtrlGeneric'
/usr/local/include/wx-2.8/wx/generic/datectrl.h:25: undefined
reference to `wxDatePickerCtrlGeneric::Init()'
.......
.......
/home/mspoerr/Desktop/propgrid/lib/libwxcode_gtk2_propgrid-2.8.a
(propgrid_lib_editors.o):(.rodata._ZTI12wxPGComboBox[typeinfo for
wxPGComboBox]+0x8): undefined reference to `typeinfo for
wxOwnerDrawnComboBox'
/home/mspoerr/Desktop/propgrid/lib/libwxcode_gtk2_propgrid-2.8.a
(propgrid_lib_propgrid.o): In function `wxPropertyGrid::OnMouseCommon
(wxMouseEvent&, int*, int*)':
/home/mspoerr/Desktop/propgrid/./src/propgrid.cpp:7643: undefined
reference to `wxOwnerDrawnComboBox::ms_classInfo'
/home/mspoerr/Desktop/propgrid/lib/libwxcode_gtk2_propgrid-2.8.a
(propgrid_lib_propgrid.o): In function
`wxPropertyGrid::DoEditorValidate()':
/home/mspoerr/Desktop/propgrid/./src/propgrid.cpp:6023: undefined
reference to `wxOwnerDrawnComboBox::ms_classInfo'
/home/mspoerr/Desktop/propgrid/lib/libwxcode_gtk2_propgrid-2.8.a
(propgrid_lib_propgrid.o): In function `wxPropertyGrid::OnNavigationKey
(wxNavigationKeyEvent&)':
/home/mspoerr/Desktop/propgrid/./src/propgrid.cpp:8248: undefined
reference to `wxOwnerDrawnComboBox::ms_classInfo'
/home/mspoerr/Desktop/propgrid/lib/libwxcode_gtk2_propgrid-2.8.a
(propgrid_lib_props.o): In function `wxDirProperty::OnButtonClick
(wxPropertyGrid*, wxString&)':
/home/mspoerr/Desktop/propgrid/./src/props.cpp:1726: undefined
reference to `wxDirDialog::wxDirDialog(wxWindow*, wxString const&,
wxString const&, long, wxPoint const&, wxSize const&, wxString
const&)'
/home/mspoerr/Desktop/propgrid/./src/props.cpp:1732: undefined
reference to `wxDirDialog::ShowModal()'
/home/mspoerr/Desktop/propgrid/./src/props.cpp:1734: undefined
reference to `wxDirDialog::GetPath() const'
collect2: ld returned 1 exit status
make[2]: *** [wktools4] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
*** Exited with status: 2 ***


I seems, that the lib was created, becasue I get a
libwxcode_gtk2_propgrid-2.8.a file, but when working with this lib, I
get lots of linker errors.

Does anyone have an idea, what I am doing wrong?

Thanks,
mspoerr

From: Vadim Zeitlin on
On Sun, 31 May 2009 13:30:32 -0700 (PDT) mathias.spoerr(a)gmail.com wrote:

> I want to have a staic ansi release build of the wxPropertyGrid lib.

As usual with static libraries, ensure that you list the libraries you
link with in the correct order, i.e. that libraries containing the
dependencies come after the libraries referencing them.

> In my application I get the following errors when linking to
> libwxcode_gtk2_propgrid-2.8.a
>
> linking wktools4 (g++)
> linking wktools4 (g++)
> /home/mspoerr/Desktop/propgrid/lib/libwxcode_gtk2_propgrid-2.8.a
> (propgrid_lib_advprops.o): In function
> `wxPGDatePickerCtrlEditor::OnEvent(wxPropertyGrid*, wxPGProperty*,
> wxWindow*, wxEvent&) const':
> /home/mspoerr/Desktop/propgrid/./src/advprops.cpp:531: undefined
> reference to `wxEVT_DATE_CHANGED'

E.g. this error will typically happen if core library appears before the
pg one on your linker command line.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
From: mathias.spoerr on
Hi Vadim,

thank you for your answer. My wx-config --libs output is the
following:
mspoerr(a)mspoerr-laptop:~$ wx-config --libs
-L/usr/local/lib -pthread /usr/local/lib/libwx_gtk2_richtext-2.8.a /
usr/local/lib/libwx_gtk2_aui-2.8.a /usr/local/lib/
libwx_gtk2_xrc-2.8.a /usr/local/lib/libwx_gtk2_qa-2.8.a /usr/local/lib/
libwx_gtk2_html-2.8.a /usr/local/lib/libwx_gtk2_adv-2.8.a /usr/local/
lib/libwx_gtk2_core-2.8.a /usr/local/lib/libwx_base_xml-2.8.a /usr/
local/lib/libwx_base_net-2.8.a /usr/local/lib/libwx_base-2.8.a -
pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lpangoft2-1.0 -
lgdk_pixbuf-2.0 -lgio-2.0 -lpango-1.0 -lfreetype -lfontconfig -
lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 -lXinerama -
lSM -lpng -lexpat -lwxtiff-2.8 -lwxjpeg-2.8 -lz -ldl -lm
mspoerr(a)mspoerr-laptop:~$

In the sample app only the wxPropertyGrid lib is additionally linked
(as far as I know). How would you change the order? Have you any tipps
or should I try...

Thanks,
mspoerr
From: mathias.spoerr on
On 1 Jun., 23:55, Vadim Zeitlin <va...(a)wxwidgets.org> wrote:

>  `wx-config --libs` should be correct but where do you put pg library
> compared to it? It should precede it.

First I added it to the "LDADD" option in kdevelop, but now it's the
first entry in "Linker Flags (LDFLAGS)" Option and IT WORKS!

Vadim - thank you very much for your help!

Regards,
mspoerr