Discussion:
static linking
(too old to reply)
Patricia Curtis
2009-05-04 00:12:57 UTC
Permalink
Hi guys here we are again and still no fix, i configured and built a
shared version with

../configure --enable-shared --disable-aboutdlg
--disable-accessibility --disable-animatectrl --disable-apple_ieee
--disable-aui --disable-backtrace --disable-busyinfo
--disable-calendar --disable-caret --disable-choicebook
--disable-clipboard --disable-cmdline --disable-coldlg
--disable-collpane --disable-colourpicker --disable-dataviewctrl
--disable-datepick --disable-dccache --disable-debug
--disable-debugreport --disable-detect_sm --disable-dialupman
--disable-docview --disable-dragimage --disable-exceptions
--disable-fontdlg --disable-fontpicker --disable-fs_inet --disable-ftp
--disable-geometry --disable-gif --disable-gif --disable-graphics_ctx
--disable-grid --disable-gstreamer8 --disable-http --disable-icocur
--disable-iff --disable-iff --disable-intl --disable-joystick
--disable-listbook --disable-log --disable-logdialog --disable-loggui
--disable-logwin --disable-mdi --disable-mdidoc --disable-mediactrl
--disable-metafiles --disable-mimetype --disable-miniframe
--disable-mousewheel --disable-mshtmlhelp --disable-mslu
--disable-nanox --disable-numberdlg --disable-official_build
--disable-palette --disable-pcx --disable-pcx --disable-pnm
--disable-pnm --disable-popupwin --disable-postscript
--disable-printarch --disable-printfposparam --disable-progressdlg
--disable-protocol --disable-protocol-ftp --disable-protocol-http
--disable-resources --disable-richtext --disable-sash --disable-serial
--disable-slider --disable-snglinst --disable-sound --disable-splash
--disable-splines --disable-statline --disable-stopwatch
--disable-tabdialog --disable-tarstream --disable-tbarnative
--disable-textdlg --disable-tga --disable-tipdlg --disable-tipwindow
--disable-togglebtn --disable-toolbook --disable-treebook
--disable-url --disable-vendor --disable-webkit --disable-wizarddlg
--disable-xrc --enable-accel --enable-bmpbutton --enable-button
--enable-checkbox --enable-checklst --enable-choice --enable-combobox
--enable-commondlg --enable-controls --enable-datetime --enable-dirdlg
--enable-dirpicker --enable-display --enable-dnd
--enable-dynamicloader --enable-dynlib --enable-ffile --enable-file
--enable-filesystem --enable-finddlg --enable-fontmap
--enable-fs_archive --enable-fs_zip --enable-gauge --enable-html
--enable-htmlhelp --enable-hyperlink --enable-image --enable-imaglist
--enable-largefile --enable-listbox --enable-listctrl
--enable-longlong --enable-menus --enable-msgdlg --enable-no_deps
--enable-no_exceptions --enable-no_rtti --enable-odcombobox
--enable-protocol-file --enable-radiobox --enable-radiobtn
--enable-scrollbar --enable-searchctrl --enable-statbmp
--enable-statbox --enable-stattext --enable-std_iostreams
--enable-std_string --enable-stdpaths --enable-streams
--enable-sysoptions --enable-textbuf --enable-textctrl
--enable-textfile --enable-statusbar --enable-tooltips
--enable-toolbar --enable-threads --enable-timer --enable-unicode
--enable-variant --enable-xpm --enable-notebook --enable-zipstream
--enable-filepicker --enable-spinbtn --enable-spinctrl
--enable-choicedlg --enable-help --enable-filedlg --enable-comboctrl
--enable-bmpcombobox --enable-constraints --enable-treectrl
--enable-validators --with-gtk=2 --enable-splitter --without-libjpeg
--without-libtiff --with-regex


and my code compiled no problems as a shared application, so i know
its using the newly compiled version of wxWidgets

cleaned and reconfigured with removing the --enable-shared and added
--disable-shared --enable-static --enable-monolithic which is all i
think i needed for the static version

compiled and installed as before , but this time i am getting this lot
of errors. it should not be this difficult to get a static link
especially in a cross-platform set of widgets

what do you think, am i missing somthing or should i re-write the
whole application as native app?


**** Build of configuration Release for project Installer ****

make all
Building target: roadkill
Invoking: GCC C++ Linker
g++ `/home/trish/Desktop/wxGTK/wxStatic/wx-config --static=yes --libs`
-o"roadkill" ./Source/GetMac.o ./Source/Install_png.o
./Source/Installer.o ./Source/SearchThread.o
-L/home/trish/Desktop/wxGTK/wxStatic/lib
./Source/GetMac.o: In function `GetMacAddresses(wxString*)':
GetMac.cpp:(.text+0x144): undefined reference to `wxEmptyString'
GetMac.cpp:(.text+0x157): undefined reference to `wxStringBase::npos'
GetMac.cpp:(.text+0x172): undefined reference to
`wxStringBase::InitWith(wchar_t const*, unsigned int, unsigned int)'
GetMac.cpp:(.text+0x181): undefined reference to
`wxStringBase::swap(wxStringBase&)'
GetMac.cpp:(.text+0x1dd): undefined reference to
`wxString::Printf(wchar_t const*, ...)'
GetMac.cpp:(.text+0x200): undefined reference to
`wxStringBase::ConcatSelf(unsigned int, wchar_t const*, unsigned int)'
GetMac.cpp:(.text+0x230): undefined reference to
`wxStringBase::operator=(wxStringBase const&)'
./Source/Installer.o: In function `wxGetApp()':
Installer.cpp:(.text+0x22): undefined reference to
`wxAppConsole::ms_appInstance'
./Source/Installer.o: In function `global constructors keyed to linux_icon_xpm':
Installer.cpp:(.text+0x17f): undefined reference to `wxEmptyString'
Installer.cpp:(.text+0x1a5): undefined reference to `wxEmptyString'
Installer.cpp:(.text+0x1cb): undefined reference to `wxEmptyString'
Installer.cpp:(.text+0x1f1): undefined reference to `wxEmptyString'
Installer.cpp:(.text+0x226): undefined reference to
`wxEventHashTable::wxEventHashTable(wxEventTable const&)'
Installer.cpp:(.text+0x23d): undefined reference to
`wxEventHashTable::~wxEventHashTable()'
Installer.cpp:(.text+0x27e): undefined reference to `wxEVT_CLOSE_WINDOW'
Installer.cpp:(.text+0x2ba): undefined reference to
`wxEVT_COMMAND_BUTTON_CLICKED'

And on and on
Dave Silvia
2009-05-04 01:50:04 UTC
Permalink
Hi!

Wow! You really are deep into it, aren't you!;)

Couple of questions:

1) What is/are the platform(s) on which you are doing this build? What
version(s)?

2) Which version of wxWidgets are we looking at?

3) What build tools are you using? (I hope it's not just an editor and
command line tools!;)

I build wxWidgets statically all the time. I find very little practical
application for shared objects. No matter how many people tell you and no
matter how many reasons they give for doing shared builds, they're usually
wrong. It's a fad that came along a little over 20 years ago that's gone
crazy, raving mad. Most folks build shared just because they think that's
what 'should/ought/must' be done -- it's not!;) Also, I find very little
purpose in building Monolithic...

I'd like to help out, but need a little more information...

thx,
Dave S.


----- Original Message -----
From: "Patricia Curtis" <***@unboxedgames.com>
To: <wx-***@lists.wxwidgets.org>
Sent: Sunday, May 03, 2009 7:12 PM
Subject: Re: static linking
Post by Patricia Curtis
Hi guys here we are again and still no fix, i configured and built a
shared version with
../configure --enable-shared --disable-aboutdlg
--disable-accessibility --disable-animatectrl --disable-apple_ieee
--disable-aui --disable-backtrace --disable-busyinfo
--disable-calendar --disable-caret --disable-choicebook
--disable-clipboard --disable-cmdline --disable-coldlg
--disable-collpane --disable-colourpicker --disable-dataviewctrl
--disable-datepick --disable-dccache --disable-debug
--disable-debugreport --disable-detect_sm --disable-dialupman
--disable-docview --disable-dragimage --disable-exceptions
--disable-fontdlg --disable-fontpicker --disable-fs_inet --disable-ftp
--disable-geometry --disable-gif --disable-gif --disable-graphics_ctx
--disable-grid --disable-gstreamer8 --disable-http --disable-icocur
--disable-iff --disable-iff --disable-intl --disable-joystick
--disable-listbook --disable-log --disable-logdialog --disable-loggui
--disable-logwin --disable-mdi --disable-mdidoc --disable-mediactrl
--disable-metafiles --disable-mimetype --disable-miniframe
--disable-mousewheel --disable-mshtmlhelp --disable-mslu
--disable-nanox --disable-numberdlg --disable-official_build
--disable-palette --disable-pcx --disable-pcx --disable-pnm
--disable-pnm --disable-popupwin --disable-postscript
--disable-printarch --disable-printfposparam --disable-progressdlg
--disable-protocol --disable-protocol-ftp --disable-protocol-http
--disable-resources --disable-richtext --disable-sash --disable-serial
--disable-slider --disable-snglinst --disable-sound --disable-splash
--disable-splines --disable-statline --disable-stopwatch
--disable-tabdialog --disable-tarstream --disable-tbarnative
--disable-textdlg --disable-tga --disable-tipdlg --disable-tipwindow
--disable-togglebtn --disable-toolbook --disable-treebook
--disable-url --disable-vendor --disable-webkit --disable-wizarddlg
--disable-xrc --enable-accel --enable-bmpbutton --enable-button
--enable-checkbox --enable-checklst --enable-choice --enable-combobox
--enable-commondlg --enable-controls --enable-datetime --enable-dirdlg
--enable-dirpicker --enable-display --enable-dnd
--enable-dynamicloader --enable-dynlib --enable-ffile --enable-file
--enable-filesystem --enable-finddlg --enable-fontmap
--enable-fs_archive --enable-fs_zip --enable-gauge --enable-html
--enable-htmlhelp --enable-hyperlink --enable-image --enable-imaglist
--enable-largefile --enable-listbox --enable-listctrl
--enable-longlong --enable-menus --enable-msgdlg --enable-no_deps
--enable-no_exceptions --enable-no_rtti --enable-odcombobox
--enable-protocol-file --enable-radiobox --enable-radiobtn
--enable-scrollbar --enable-searchctrl --enable-statbmp
--enable-statbox --enable-stattext --enable-std_iostreams
--enable-std_string --enable-stdpaths --enable-streams
--enable-sysoptions --enable-textbuf --enable-textctrl
--enable-textfile --enable-statusbar --enable-tooltips
--enable-toolbar --enable-threads --enable-timer --enable-unicode
--enable-variant --enable-xpm --enable-notebook --enable-zipstream
--enable-filepicker --enable-spinbtn --enable-spinctrl
--enable-choicedlg --enable-help --enable-filedlg --enable-comboctrl
--enable-bmpcombobox --enable-constraints --enable-treectrl
--enable-validators --with-gtk=2 --enable-splitter --without-libjpeg
--without-libtiff --with-regex
and my code compiled no problems as a shared application, so i know
its using the newly compiled version of wxWidgets
cleaned and reconfigured with removing the --enable-shared and added
--disable-shared --enable-static --enable-monolithic which is all i
think i needed for the static version
compiled and installed as before , but this time i am getting this lot
of errors. it should not be this difficult to get a static link
especially in a cross-platform set of widgets
what do you think, am i missing somthing or should i re-write the
whole application as native app?
**** Build of configuration Release for project Installer ****
make all
Building target: roadkill
Invoking: GCC C++ Linker
g++ `/home/trish/Desktop/wxGTK/wxStatic/wx-config --static=yes --libs`
-o"roadkill" ./Source/GetMac.o ./Source/Install_png.o
./Source/Installer.o ./Source/SearchThread.o
-L/home/trish/Desktop/wxGTK/wxStatic/lib
GetMac.cpp:(.text+0x144): undefined reference to `wxEmptyString'
GetMac.cpp:(.text+0x157): undefined reference to `wxStringBase::npos'
GetMac.cpp:(.text+0x172): undefined reference to
`wxStringBase::InitWith(wchar_t const*, unsigned int, unsigned int)'
GetMac.cpp:(.text+0x181): undefined reference to
`wxStringBase::swap(wxStringBase&)'
GetMac.cpp:(.text+0x1dd): undefined reference to
`wxString::Printf(wchar_t const*, ...)'
GetMac.cpp:(.text+0x200): undefined reference to
`wxStringBase::ConcatSelf(unsigned int, wchar_t const*, unsigned int)'
GetMac.cpp:(.text+0x230): undefined reference to
`wxStringBase::operator=(wxStringBase const&)'
Installer.cpp:(.text+0x22): undefined reference to
`wxAppConsole::ms_appInstance'
./Source/Installer.o: In function `global constructors keyed to
Installer.cpp:(.text+0x17f): undefined reference to `wxEmptyString'
Installer.cpp:(.text+0x1a5): undefined reference to `wxEmptyString'
Installer.cpp:(.text+0x1cb): undefined reference to `wxEmptyString'
Installer.cpp:(.text+0x1f1): undefined reference to `wxEmptyString'
Installer.cpp:(.text+0x226): undefined reference to
`wxEventHashTable::wxEventHashTable(wxEventTable const&)'
Installer.cpp:(.text+0x23d): undefined reference to
`wxEventHashTable::~wxEventHashTable()'
Installer.cpp:(.text+0x27e): undefined reference to `wxEVT_CLOSE_WINDOW'
Installer.cpp:(.text+0x2ba): undefined reference to
`wxEVT_COMMAND_BUTTON_CLICKED'
And on and on
_______________________________________________
wx-users mailing list
http://lists.wxwidgets.org/mailman/listinfo/wx-users
Vadim Zeitlin
2009-05-04 10:09:39 UTC
Permalink
On Mon, 4 May 2009 01:12:57 +0100 Patricia Curtis <***@unboxedgames.com> wrote:

PC> and my code compiled no problems as a shared application, so i know
PC> its using the newly compiled version of wxWidgets

I really fail to see the logic here...

PC> compiled and installed as before , but this time i am getting this lot
PC> of errors. it should not be this difficult to get a static link
PC> especially in a cross-platform set of widgets

It isn't difficult at all. Surprisingly, the problem is in your build
process and has nothing to do with wxWidgets.

PC> what do you think, am i missing somthing or should i re-write the
PC> whole application as native app?

Yes, absolutely, this certainly will be much less work than learning to
use the linker correctly.

PC> **** Build of configuration Release for project Installer ****
PC>
PC> make all
PC> Building target: roadkill
PC> Invoking: GCC C++ Linker
PC> g++ `/home/trish/Desktop/wxGTK/wxStatic/wx-config --static=yes --libs`
PC> -o"roadkill" ./Source/GetMac.o ./Source/Install_png.o
PC> ./Source/Installer.o ./Source/SearchThread.o
PC> -L/home/trish/Desktop/wxGTK/wxStatic/lib

First of all, you don't need to add -L options manually when using
wx-config, this is the whole point of using this script. Adding the paths
manually can only result in extra mistakes.

Second, and most importantly, the static libraries must come *after* the
object files referencing them (and in the correct order, but wx-config does
ensure this). IOW your link command must be

g++ -o roadkill *.o `wx-config --libs`

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Continue reading on narkive:
Loading...