Build tagged versions of protobuf?

26 views
Skip to first unread message

JonathonS

unread,
Oct 22, 2011, 1:43:54 PM10/22/11
to prot...@googlegroups.com
Hi all,

is there a way to have protobuf build the libraries with tags? (like
boost does)

For example...
- the static debug version of protobuf lite will be named: protobuf-lite-sd.a
- the dynamic debug version of protobuf lite will be named: protobuf-lite-d.so
- the static version of protobuf lite will be named: protobuf-lite-s.a
etc.

The issue I am currently having is that since protobuf names their
libraries with all the same name (just the extension is different),
gcc always wants to link the dynamic version of protobuf first instead
of the static version due to gcc's linking priorities of searching for
.so first, then .a.

My linker command will be: -lprotobuf-lite , which links to the .so
first if one exists, and then links to the .a. One way for me to get
around this, is to either manually rename the libraries myself, or
just remove the .so file, but this is a bit inconvenient.

Thanks,
J

Christopher Smith

unread,
Oct 22, 2011, 2:02:00 PM10/22/11
to JonathonS, prot...@googlegroups.com
You could also just specify the static library name and/or use the static link flag. Not sure why you'd solve this via a rename....

--Chris

> --
> You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
> To post to this group, send email to prot...@googlegroups.com.
> To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
>

Jonathon S.

unread,
Oct 22, 2011, 2:56:24 PM10/22/11
to Protocol Buffers
Thanks Chris for the reply. The static library name though is
protobuf-lite, so when I do -L<path to protobuf> -lprotobuf-lite in
gcc, it wants to load the .so first, before the .a (static library).

Also, what is the static link flag?

Thanks,
J

On Oct 22, 11:02 am, Christopher Smith <cbsm...@gmail.com> wrote:
> You could also just specify the static library name and/or use the static link flag. Not sure why you'd solve this via a rename....
>
> --Chris
>
Reply all
Reply to author
Forward
0 new messages