[lxc-devel] Duplicate definitions of `lxc_log_define`

Jens Låås jelaas at gmail.com
Sat Jan 9 21:12:22 UTC 2010


Hi!

Ill just add a "Me too!" for this.

I resorted to some hackery to solve the linking. Not sure if it worked
OK or not.

Cheers,
Jens

2010/1/9 Ciprian Dorin, Craciun <ciprian.craciun at gmail.com>:
>    Hy all!
>
>    Yesterday I've played around with LXC containers, and I've wanted
> to statically build the lxc tools.
>
>    While doing this (after messing with the `Makefile.am` from
> `src/lxc` to replace the `.so` with a `.a`), I've hit the following
> problem: in most `.c` files belonging to the applications (like
> `lxc_start.c`), there is a definition (that I'm assuming creates an
> exportable function) like: `lxc_log_define(lxc_start, lxc);`, but the
> same definition is also found in the library `.c` files (like
> `start.c`), which reads exactly the same.
>
>    Now I assume that when dynamically linking the executables no
> conflict is found, but when statically linking them I get multiple
> definitions errors.
>
>    I've fixed this by adding a `_` at the end of the name in the
> `lxc_*.c` files, like: `lxc_log_define(lxc_start_, lxc);`
>
>    So if anyone has time to look this up would be nice.
>
>    Thanks,
>    Ciprian.
>
>    P.S.: Could you also consider adding the option to statically
> build the tools? (My need for them is for an minimal Linux
> distribution that would only bootstrap the containers, and I would
> prefer to have the binaries self-contained and not to bother about
> missing `.so`.)
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel
>




More information about the lxc-devel mailing list