Discussion:
static
(too old to reply)
Patricia Curtis
2009-04-29 00:05:55 UTC
Permalink
Hi Guys Firstly let me say awesome job, now onto my problem, im
running fedora 10, and i have built my application on windows and Linux,
with OSX to come a bit later all using wxWidgets 2.8.10, my App is all
working on both platforms but now I need to distribute it, so on linux i
need to build it as a static app --static=yes, i spent most of the day
compiling and recompiling a static build of wxWidgets but

1 it put it it usr/local/lib/wx when the package installer installs it to
/usr/lib/wx
2 the wx-config only comes up with the shared version (probably because its
in a different location)
3 when i symbolic link to the static version it cant find the libraries
4 when i compile my app with the static 'wx-config --libs' etc i get loads
of link errors for every wx Class including undefined wxEmptyString and
wxApp to name just two so it cant find the libraries for the any of the wx
Classes

so my questions are

How do i get a switchable version of wxWidgets shared and static? What
Libraies am i suposed to be linking too? i found loads of .a files which i
was assuming was the libraries.

Im using Eclipse 3.4.1 with

g++ `wx-config --cxxflags`
g++ `wx-config --libs`

i have swapped the command line pattern as per your wikki and shared
compiles no with problems and my application runs with no problems too

so as i said all i need now is a static version, how or where to get a
static build for fedora 10 that will let me compile through eclipse.

Thanks for your time.

PS i am not a newbie i have been programming for years and i know my way
around linux, but i am pulling my hair out here
Leto Atreides wx-users@lists.wxwidgets.org
2009-04-29 00:38:15 UTC
Permalink
Is there a reason you need to statically compile for distribution on
Linux?

What I do is distribute the dynamically linked wxWidgets in a
'MyAppDir/libs/' directory and use either rpath during compile or a
wrapper script to set the ld path to my applications lib directory.

That being said, when I have built a wxWidget static build, I never
let make install it, I placed the compiled binaries into a separate
directory and set my lib and header path to that directory.
Post by Patricia Curtis
Hi Guys
Firstly let me say awesome job, now onto my problem, im
running fedora 10, and i have built my application on windows and
Linux, with OSX to come a bit later all using wxWidgets 2.8.10, my
App is all working on both platforms but now I need to distribute
it, so on linux i need to build it as a static app --static=yes, i
spent most of the day compiling and recompiling a static build of
wxWidgets but
1 it put it it usr/local/lib/wx when the package installer installs
it to /usr/lib/wx
2 the wx-config only comes up with the shared version (probably
because its in a different location)
3 when i symbolic link to the static version it cant find the
libraries
4 when i compile my app with the static 'wx-config --libs' etc i
get loads of link errors for every wx Class including undefined
wxEmptyString and wxApp to name just two so it cant find the
libraries for the any of the wx Classes
so my questions are
How do i get a switchable version of wxWidgets shared and static?
What Libraies am i suposed to be linking too? i found loads of .a
files which i was assuming was the libraries.
Im using Eclipse 3.4.1 with
g++ `wx-config --cxxflags`
g++ `wx-config --libs`
i have swapped the command line pattern as per your wikki and shared
compiles no with problems and my application runs with no problems too
so as i said all i need now is a static version, how or where to get
a static build for fedora 10 that will let me compile through eclipse.
Thanks for your time.
PS i am not a newbie i have been programming for years and i know my
way around linux, but i am pulling my hair out here
_______________________________________________
wx-users mailing list
http://lists.wxwidgets.org/mailman/listinfo/wx-users
Chris Spencer
2009-04-29 00:51:52 UTC
Permalink
Post by Patricia Curtis
Hi Guys Firstly let me say awesome job, now onto my problem, im
running fedora 10, and i have built my application on windows and Linux,
with OSX to come a bit later all using wxWidgets 2.8.10, my App is all
working on both platforms but now I need to distribute it, so on linux i
need to build it as a static app --static=yes, i spent most of the day
compiling and recompiling a static build of wxWidgets but
1 it put it it usr/local/lib/wx when the package installer installs it to
/usr/lib/wx
2 the wx-config only comes up with the shared version (probably because its
in a different location)
3 when i symbolic link to the static version it cant find the libraries
4 when i compile my app with the static 'wx-config --libs' etc i get loads
of link errors for every wx Class including undefined wxEmptyString and
wxApp to name just two so it cant find the libraries for the any of the wx
Classes
so my questions are
How do i get a switchable version of wxWidgets shared and static? What
Libraies am i suposed to be linking too? i found loads of .a files which i
was assuming was the libraries.
Im using Eclipse 3.4.1 with
g++ `wx-config --cxxflags`
g++ `wx-config --libs`
i have swapped the command line pattern as per your wikki and shared
compiles no with problems and my application runs with no problems too
so as i said all i need now is a static version, how or where to get a
static build for fedora 10 that will let me compile through eclipse.
Thanks for your time.
PS i am not a newbie i have been programming for years and i know my way
around linux, but i am pulling my hair out here
Why do you need a static version? Really you should be using the version
in the distribution's packet management system and dynamically link the
that.

You could always try ELF Statifier [1] if you need to. It will combine
the executable and all the dynamically linked libraries into one file.

Chris.

[1] http://statifier.sourceforge.net/
Julian Smart
2009-04-29 06:17:12 UTC
Permalink
Hi Patricia,

I build a static version of wxWidgets in a directory which I then use to
explicitly invoke wx-config, e.g. ~/build/wx-unicode-debug/wx-config.
That way there's no confusion with any existing version on the system.

Regards,

Julian
Post by Patricia Curtis
Hi Guys
Firstly let me say awesome job, now onto my problem, im
running fedora 10, and i have built my application on windows and
Linux, with OSX to come a bit later all using wxWidgets 2.8.10, my App
is all working on both platforms but now I need to distribute it, so
on linux i need to build it as a static app --static=yes, i spent most
of the day compiling and recompiling a static build of wxWidgets but
1 it put it it usr/local/lib/wx when the package installer installs it
to /usr/lib/wx
2 the wx-config only comes up with the shared version
(probably because its in a different location)
3 when i symbolic link to the static version it cant find the libraries
4 when i compile my app with the static 'wx-config --libs' etc i get
loads of link errors for every wx Class including undefined
wxEmptyString and wxApp to name just two so it cant find the libraries
for the any of the wx Classes
so my questions are
How do i get a switchable version of wxWidgets shared and static? What
Libraies am i suposed to be linking too? i found loads of .a files
which i was assuming was the libraries.
Im using Eclipse 3.4.1 with
g++ `wx-config --cxxflags`
g++ `wx-config --libs`
i have swapped the command line pattern as per your wikki and shared
compiles no with problems and my application runs with no problems too
so as i said all i need now is a static version, how or where to get a
static build for fedora 10 that will let me compile through eclipse.
Thanks for your time.
PS i am not a newbie i have been programming for years and i know my
way around linux, but i am pulling my hair out here
------------------------------------------------------------------------
_______________________________________________
wx-users mailing list
http://lists.wxwidgets.org/mailman/listinfo/wx-users
--
Julian Smart, Anthemion Software Ltd.
28/5 Gillespie Crescent, Edinburgh, Midlothian, EH10 4HU
www.anthemion.co.uk | +44 (0)131 229 5306
Tools for writers: www.writerscafe.co.uk
wxWidgets RAD: www.dialogblocks.com
Blog: www.juliansmart.com
Patricia Curtis
2009-04-29 08:44:49 UTC
Permalink
Thanks for your replies, but the ELF Statifier solution turns my 8 meg file
into 30 megs, which is not great, and the build the static build into
another dir is still producing the stream of link errors
GetMac.cpp:(.text+0x145): undefined reference to
`wxEmptyString'GetMac.cpp:(.text+0x158): undefined reference to
`wxStringBase::npos'
GetMac.cpp:(.text+0x176): undefined reference to
`wxStringBase::InitWith(wchar_t const*, unsigned int, unsigned int)'
GetMac.cpp:(.text+0x182): undefined reference to
`wxStringBase::swap(wxStringBase&)'
GetMac.cpp:(.text+0x1de): undefined reference to `wxString::Printf(wchar_t
const*, ...)'
GetMac.cpp:(.text+0x201): undefined reference to
`wxStringBase::ConcatSelf(unsigned int, wchar_t const*, unsigned int)'
GetMac.cpp:(.text+0x238): undefined reference to
`wxStringBase::operator=(wxStringBase const&)'
./Source/Installer.o: In function `wxGetApp()':

and on and on for 1500+ errors ......

i configured and built my static build into a separate dir then pointed g++
in eclipse to that config using g++ `/home/trish/wxStatic/bin/wx-config
--cxxflags` and g++ `/home/trish/wxStatic/bin/wx-config --libs` but its not
finding the libs

g++ `/home/trish/wxStatic/bin/wx-config --libs` produces

-L/home/trish/wxStatic/lib -pthread
/home/trish/wxStatic/lib/libwx_gtk2u-2.8.a -pthread -lgtk-x11-2.0
-lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0
-lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0
-lgthread-2.0 -lrt -lglib-2.0 -lXinerama -lSM -lpng -lz -lwxregexu-2.8
-lwxexpat-2.8 -lwxtiff-2.8 -lwxjpeg-2.8 -lz -ldl -lm


any ideas

PS great book Julian
Julian Smart
2009-04-29 12:07:51 UTC
Permalink
Hi,

I'm afraid I don't know what the ELF Statifier is, so I guess I'm not
using it. Anyway you may need to pass some further flags to wx-config.

Here are some lines from my makefile:

CXXFLAGS = $(APPEXTRACXXFLAGS) $(ARCHFLAGS) `$(WXBUILDDIR)/wx-config
--inplace --prefix=$(WXDIR) --exec-prefix=$(WXBUILDDIR) --cxxflags `

$(PROGRAM): $(OBJECTS)
$(CXX) -o $@ $(OBJECTS) \
$(APPEXTRALIBS) $(EXTRALINKFLAGS) `$(WXBUILDDIR)/wx-config
--inplace --exec-prefix=$(WXBUILDDIR) --static --libs`

Not sure if that's going to help... I'm not sure why the libs aren't
being found if you have -L/home/trish/wxStatic/lib on the command line.

Regards,

Julian
Post by Patricia Curtis
Thanks for your replies, but the ELF Statifier solution turns my 8 meg
file into 30 megs, which is not great, and the build the static build
into another dir is still producing the stream of link errors
GetMac.cpp:(.text+0x145): undefined reference to `wxEmptyString'
GetMac.cpp:(.text+0x158): undefined reference to `wxStringBase::npos'
GetMac.cpp:(.text+0x176): undefined reference to
`wxStringBase::InitWith(wchar_t const*, unsigned int, unsigned int)'
GetMac.cpp:(.text+0x182): undefined reference to
`wxStringBase::swap(wxStringBase&)'
GetMac.cpp:(.text+0x1de): undefined reference to
`wxString::Printf(wchar_t const*, ...)'
GetMac.cpp:(.text+0x201): undefined reference to
`wxStringBase::ConcatSelf(unsigned int, wchar_t const*, unsigned int)'
GetMac.cpp:(.text+0x238): undefined reference to
`wxStringBase::operator=(wxStringBase const&)'
and on and on for 1500+ errors ......
i configured and built my static build into a separate dir then
pointed g++ in eclipse to that config using g++
`/home/trish/wxStatic/bin/wx-config --cxxflags` and g++
`/home/trish/wxStatic/bin/wx-config --libs` but its not finding the libs
g++ `/home/trish/wxStatic/bin/wx-config --libs` produces
-L/home/trish/wxStatic/lib -pthread
/home/trish/wxStatic/lib/libwx_gtk2u-2.8.a -pthread -lgtk-x11-2.0
-lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0
-lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0
-lgthread-2.0 -lrt -lglib-2.0 -lXinerama -lSM -lpng -lz -lwxregexu-2.8
-lwxexpat-2.8 -lwxtiff-2.8 -lwxjpeg-2.8 -lz -ldl -lm
any ideas
PS great book Julian
Loading...