2012/1/31 Wim Dumon <w...@emweb.be>

> Hello Frans,
>
> What always worked for me is to omit -static and instead use full
> paths to the .a files when linking (without -l):
> g++  -O2 -o hello hello.C /usr/local/lib/libwthttp.a
> /usr/local/lib/libwt.a ...
>
> There may be some option of ld or gcc that avoids static linking for
> some libraries, but I don't know that by heart.
>
> Best regards,
> Wim.
>

Hi Wim.

Thanks alot, That is a good suggestion, didn't think of that one.

This page http://redmine.webtoolkit.eu/projects/wt/wiki/Wt_embeddedsuggested:

By default, shared/static libraries is all-or-nothing with CMake. However,
you probably want to use system-wide versions of libstdc++, libm and libc
depending on other applications on your device.

   - Use -Bdynamic in front of libraries you wish to link dynamically
   against

 But that did not work too well for me.
I've also reconfigured with the suggestions made with the page above. Let's
see what that delivers.

Frans

>
> 2012/1/31 Frans Meulenbroeks <fransmeulenbro...@gmail.com>:
> > Hi,
> >
> > I'm trying to statically link hello to learn about footprint.
> > I peeked at the instructions at
> > http://redmine.webtoolkit.eu/projects/wt/wiki/Wt_embedded, I haven't
> applied
> > all of them, but I feel I'm quite far from the results listed on that
> page
> > as my exe is about 5 MB. (intel x86-64)
> >
> > The thing that I do not seem to get under control is using libc (and
> maybe
> > some other libs) dynamically.
> >
> > E.g. with this command:
> > g++  -O2 -o hello hello.C -static -lwthttp -lwt -lstdc++ -lboost_signals
> -lz
> > \
> >     -lssl -lcrypto -lboost_thread -lboost_filesystem
> -lboost_program_options
> > -lboost_date_time -lpthread -lboost_regex \
> >     -lboost_system -lrt -ldl -licudata -licui18n -licuuc -Bdynamic -lz
> -lm
> > -Bdynamic -lc
> >
> > I still end up with a fully statically linked executable.
> >
> > The other thing that somewhat concerns me are these linker messages:
> >
> > /usr/lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
> > (.text+0x5c4): warning: Using 'dlopen' in statically linked applications
> > requires at runtime the shared libraries from the glibc version used for
> > linking
> > /usr/lib64/libwthttp.a(Server.o): In function `getaddrinfo':
> > /usr/include/boost/asio/detail/socket_ops.hpp:1809: warning: Using
> > 'getaddrinfo' in statically linked applications requires at runtime the
> > shared libraries from the glibc version used for linking
> >
> > Anyone any pointers on how to improve my results
> > (and yes, I know there are some things in the wiki that I have not
> tried).
> >
> > Rationale for going static is that this is the only C++ app in my target
> > system, so I'd rather have only those parts of the lib that I really use.
> > (and I came to the list of libs above by dynamically linking and doing
> ldd
> > -v hello
> >
> > Thanks in advance for any suggestions!
> > Frans
> >
> >
> ------------------------------------------------------------------------------
> > Keep Your Developer Skills Current with LearnDevNow!
> > The most comprehensive online learning library for Microsoft developers
> > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> > Metro Style Apps, more. Free future releases when you subscribe now!
> > http://p.sf.net/sfu/learndevnow-d2d
> > _______________________________________________
> > witty-interest mailing list
> > witty-interest@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/witty-interest
> >
>
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to