building static binary

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
sadfub
In need of some credit
In need of some credit
Posts: 9
Joined: Fri Jan 26, 2007 9:55 am
Contact:

Post by sadfub »

Ok, I've played a little with compiler options and since you all now that we are developing with g++, I get only about 30 errors when I put before the *.a libraries a '-Wl' command, meaning this is passed through direct to the linker. I assume g++ interpretes all files given to him either as object files (and that is why he couldn't get any symbols resolved, cause (.a != .o)) or as source files. The remaining errors are:

Code: Select all



me@ipc840:~/colorcode/gui$ g++ -O3 -march=athlon -g -o gui ./*.o ../*.o -L/home/me/test/wxWidgets-2.8.0/buildgtk-static/lib  -Wl,--rpath -Wl,`pkg-config libgvc --variable=libdir` `pkg-config libgvc --libs`  -L. -Wl,libwx_base-2.8.a,libwx_base_net-2.8.a,libwx_base_xml-2.8.a,libwx_gtk2_adv-2.8.a,
libwx_gtk2_aui-2.8.a,libwx_gtk2_core-2.8.a,libwx_gtk2_fl-2.8.a,libwx_gtk2_gizmos-2.8.a,
libwx_gtk2_gizmos_xrc-2.8.a,libwx_gtk2_html-2.8.a,libwx_gtk2_mmedia-2.8.a,
libwx_gtk2_ogl-2.8.a,libwx_gtk2_plot-2.8.a,libwx_gtk2_qa-2.8.a,libwx_gtk2_richtext-2.8.a,
libwx_gtk2_stc-2.8.a,libwx_gtk2_svg-2.8.a,libwx_gtk2_xrc-2.8.a -L/usr/X11R6/lib -lgtk-x11-2.0 -lXxf86vm -lgthread-2.0 -lSM

libwx_gtk2_core-2.8.a(corelib_bmpbase.o)(.text+0x106): In function `operator<<(wxVariant&, wxBitmap const&)':
: undefined reference to `wxVariant::SetData(wxVariantData*)'
libwx_gtk2_core-2.8.a(corelib_bmpbase.o)(.text+0x270): In function `operator<<(wxVariant&, wxIcon const&)':
: undefined reference to `wxVariant::SetData(wxVariantData*)'
libwx_gtk2_core-2.8.a(corelib_bmpbase.o)(.text+0x78f): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `wxVariantData::ms_classInfo'
libwx_gtk2_core-2.8.a(corelib_bmpbase.o)(.text+0x7fd): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `wxVariantData::ms_classInfo'
libwx_gtk2_core-2.8.a(corelib_bmpbase.o)(.gnu.linkonce.r._ZTI19wxBitmapVariantData+0x8): undefined reference to `typeinfo for wxVariantData'
libwx_gtk2_core-2.8.a(corelib_bmpbase.o)(.gnu.linkonce.r._ZTI17wxIconVariantData+0x8): undefined reference to `typeinfo for wxVariantData'
libwx_gtk2_core-2.8.a(corelib_colourcmn.o)(.text+0x106): In function `operator<<(wxVariant&, wxColour const&)':
: undefined reference to `wxVariant::SetData(wxVariantData*)'
libwx_gtk2_core-2.8.a(corelib_colourcmn.o)(.text+0x6a7): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `wxVariantData::ms_classInfo'
libwx_gtk2_core-2.8.a(corelib_colourcmn.o)(.gnu.linkonce.r._ZTI19wxColourVariantData+0x8): undefined reference to `typeinfo for wxVariantData'
libwx_gtk2_core-2.8.a(corelib_image.o)(.text+0x106): In function `operator<<(wxVariant&, wxImage const&)':
: undefined reference to `wxVariant::SetData(wxVariantData*)'
libwx_gtk2_core-2.8.a(corelib_image.o)(.text+0x83ad): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `wxVariantData::ms_classInfo'
libwx_gtk2_core-2.8.a(corelib_image.o)(.gnu.linkonce.r._ZTI18wxImageVariantData+0x8): undefined reference to `typeinfo for wxVariantData'
libwx_gtk2_core-2.8.a(corelib_wincmn.o)(.text+0x263): In function `wxWindowBase::wxWindowBase[not-in-charge]()':
: undefined reference to `wxSystemOptions::HasOption(wxString const&)'
libwx_gtk2_core-2.8.a(corelib_wincmn.o)(.text+0x2b1): In function `wxWindowBase::wxWindowBase[not-in-charge]()':
: undefined reference to `wxSystemOptions::GetOptionInt(wxString const&)'
libwx_gtk2_core-2.8.a(corelib_wincmn.o)(.text+0x633): In function `wxWindowBase::wxWindowBase[in-charge]()':
: undefined reference to `wxSystemOptions::HasOption(wxString const&)'
libwx_gtk2_core-2.8.a(corelib_wincmn.o)(.text+0x681): In function `wxWindowBase::wxWindowBase[in-charge]()':
: undefined reference to `wxSystemOptions::GetOptionInt(wxString const&)'
libwx_gtk2_core-2.8.a(corelib_gprint.o)(.text+0x91): In function `wxGnomePrintLibrary::wxGnomePrintLibrary[not-in-charge]()':
: undefined reference to `wxDynamicLibrary::Load(wxString const&, int)'
libwx_gtk2_core-2.8.a(corelib_gprint.o)(.text+0x124): In function `wxGnomePrintLibrary::wxGnomePrintLibrary[not-in-charge]()':
: undefined reference to `wxDynamicLibrary::Load(wxString const&, int)'
libwx_gtk2_core-2.8.a(corelib_gprint.o)(.text+0x261): In function `wxGnomePrintLibrary::wxGnomePrintLibrary[in-charge]()':
: undefined reference to `wxDynamicLibrary::Load(wxString const&, int)'
libwx_gtk2_core-2.8.a(corelib_gprint.o)(.text+0x2f4): In function `wxGnomePrintLibrary::wxGnomePrintLibrary[in-charge]()':
: undefined reference to `wxDynamicLibrary::Load(wxString const&, int)'
libwx_gtk2_core-2.8.a(corelib_gprint.o)(.text+0x3f6): In function `wxGnomePrintLibrary::~wxGnomePrintLibrary [not-in-charge]()':
: undefined reference to `wxDynamicLibrary::Unload(void*)'
libwx_gtk2_core-2.8.a(corelib_gprint.o)(.text+0x414): In function `wxGnomePrintLibrary::~wxGnomePrintLibrary [not-in-charge]()':
: undefined reference to `wxDynamicLibrary::Unload(void*)'
libwx_gtk2_core-2.8.a(corelib_gprint.o)(.text+0x466): In function `wxGnomePrintLibrary::~wxGnomePrintLibrary [in-charge]()':
: undefined reference to `wxDynamicLibrary::Unload(void*)'
libwx_gtk2_core-2.8.a(corelib_gprint.o)(.text+0x484): In function `wxGnomePrintLibrary::~wxGnomePrintLibrary [in-charge]()':
: undefined reference to `wxDynamicLibrary::Unload(void*)'
libwx_gtk2_core-2.8.a(corelib_gprint.o)(.text+0x4ec): In function `wxGnomePrintLibrary::InitializeMethods()':
: undefined reference to `wxDynamicLibrary::GetSymbol(wxString const&, bool*) const'
libwx_gtk2_core-2.8.a(corelib_gprint.o)(.text+0x54e): In function `wxGnomePrintLibrary::InitializeMethods()':
: undefined reference to `wxDynamicLibrary::GetSymbol(wxString const&, bool*) const'
libwx_gtk2_core-2.8.a(corelib_gprint.o)(.text+0x5b0): In function `wxGnomePrintLibrary::InitializeMethods()':
: undefined reference to `wxDynamicLibrary::GetSymbol(wxString const&, bool*) const'
libwx_gtk2_core-2.8.a(corelib_gprint.o)(.text+0x612): In function `wxGnomePrintLibrary::InitializeMethods()':
: undefined reference to `wxDynamicLibrary::GetSymbol(wxString const&, bool*) const'
libwx_gtk2_core-2.8.a(corelib_gprint.o)(.text+0x674): In function `wxGnomePrintLibrary::InitializeMethods()':
: undefined reference to `wxDynamicLibrary::GetSymbol(wxString const&, bool*) const'
libwx_gtk2_core-2.8.a(corelib_gprint.o)(.text+0x6d6): more undefined references to `wxDynamicLibrary::GetSymbol(wxString const&, bool*) const' follow
libwx_gtk2_core-2.8.a(corelib_rendcmn.o)(.text+0x1c0): In function `wxRendererNative::Load(wxString const&)':
: undefined reference to `wxDynamicLibrary::CanonicalizePluginName(wxString const&, wxPluginCategory)'
libwx_gtk2_core-2.8.a(corelib_rendcmn.o)(.text+0x1df): In function `wxRendererNative::Load(wxString const&)':
: undefined reference to `wxDynamicLibrary::Load(wxString const&, int)'
libwx_gtk2_core-2.8.a(corelib_rendcmn.o)(.text+0x227): In function `wxRendererNative::Load(wxString const&)':
: undefined reference to `wxDynamicLibrary::GetSymbol(wxString const&, bool*) const'
libwx_gtk2_core-2.8.a(corelib_rendcmn.o)(.text+0x2fb): In function `wxRendererNative::Load(wxString const&)':
: undefined reference to `wxDynamicLibrary::Unload(void*)'
libwx_gtk2_core-2.8.a(corelib_rendcmn.o)(.text+0x368): In function `wxRendererNative::Load(wxString const&)':
: undefined reference to `wxDynamicLibrary::Unload(void*)'
libwx_gtk2_core-2.8.a(corelib_rendcmn.o)(.text+0x3ec): In function `wxRendererNative::Load(wxString const&)':
: undefined reference to `wxDynamicLibrary::Unload(void*)'
libwx_gtk2_core-2.8.a(corelib_rendcmn.o)(.gnu.linkonce.t._ZN20wxRendererFromDynLibD1Ev+0x2b): In function `wxRendererFromDynLib::~wxRendererFromDynLib [in-charge]()':
: undefined reference to `wxDynamicLibrary::Unload(void*)'
libwx_gtk2_core-2.8.a(corelib_rendcmn.o)(.gnu.linkonce.t._ZN20wxRendererFromDynLibD0Ev+0x2b): In function `wxRendererFromDynLib::~wxRendererFromDynLib [in-charge deleting]()':
: undefined reference to `wxDynamicLibrary::Unload(void*)'
libwx_gtk2_core-2.8.a(corelib_dirctrlg.o)(.text+0x544): In function `wxDirItemData::HasFiles(wxString const&) const':
: undefined reference to `wxDir::HasFiles(wxString const&)'
libwx_gtk2_core-2.8.a(corelib_dataobj.o)(.text+0xf0f): In function `wxBitmapDataObject::SetData(unsigned, void const*)':
: undefined reference to `wxMemoryInputStream::wxMemoryInputStream[in-charge](void const*, unsigned)'
libwx_gtk2_core-2.8.a(corelib_dataobj.o)(.text+0xf57): In function `wxBitmapDataObject::SetData(unsigned, void const*)':
: undefined reference to `wxMemoryInputStream::~wxMemoryInputStream [in-charge]()'
libwx_gtk2_core-2.8.a(corelib_dataobj.o)(.text+0xfd2): In function `wxBitmapDataObject::SetData(unsigned, void const*)':
: undefined reference to `wxMemoryInputStream::~wxMemoryInputStream [in-charge]()'
libwx_gtk2_core-2.8.a(corelib_dataobj.o)(.text+0x1006): In function `wxBitmapDataObject::SetData(unsigned, void const*)':
: undefined reference to `wxMemoryInputStream::~wxMemoryInputStream [in-charge]()'
libwx_gtk2_core-2.8.a(corelib_dataobj.o)(.text+0x10d3): In function `wxBitmapDataObject::DoConvertToPng()':
: undefined reference to `wxMemoryOutputStream::wxMemoryOutputStream[in-charge](void*, unsigned)'
libwx_gtk2_core-2.8.a(corelib_dataobj.o)(.text+0x10f3): In function `wxBitmapDataObject::DoConvertToPng()':
: undefined reference to `wxMemoryOutputStream::~wxMemoryOutputStream [in-charge]()'
libwx_gtk2_core-2.8.a(corelib_dataobj.o)(.text+0x1123): In function `wxBitmapDataObject::DoConvertToPng()':
: undefined reference to `wxMemoryOutputStream::~wxMemoryOutputStream [in-charge]()'
collect2: ld returned 1 exit status

But, this is ATM only for correct understanding of the problem. (should I split into a new thread? But this isnt wx related anymore, sorry) If I would I could use the linker command above. Anyway thanks all of you for your help.
Post Reply