undefined symbol: _ZN6google8protobuf7Message20DiscardUnknownFieldsEv

141 views
Skip to first unread message

jacobsmbo...@yahoo.de

unread,
May 25, 2009, 10:46:09 AM5/25/09
to Protocol Buffers
Hi,

After successfully compiling my lib using a generated protocol buffer
class, i am receiving this awful error when i try to load it:
Unable to load dynamic library ...
undefined symbol: _ZN6google8protobuf7Message20DiscardUnknownFieldsEv

Why? What's it mean? Is a file missing?
I don't have "DiscardUnknownFieldsEv" in my code...
Please give me a hint!

I already made extensive use of ldconfig and recompiled/reinstalled
several related libs and programs. I don't know what to do.

Thanks in advance,
J. Smith

Kenton Varda

unread,
May 25, 2009, 3:50:42 PM5/25/09
to jacobsmbo...@yahoo.de, Protocol Buffers
You need to link against libprotobuf by adding -lprotobuf to your linker command-line.

jacobsmbo...@yahoo.de

unread,
May 26, 2009, 4:08:51 AM5/26/09
to Protocol Buffers
Thanks a lot!

It worked well after i figured how to add it to the configure script
of my PHP extension project:
./configure ... EXTRA_LDFLAGS='-lprotobuf'

Kenton Varda

unread,
May 26, 2009, 8:24:36 PM5/26/09
to jacobsmbo...@yahoo.de, Protocol Buffers
You should be able to add macros to your configure.ac/configure.in file so that it does this automatically.  Check the autoconf docs.  Note that you may also have to compile with -lpthread on some platforms, so you might as well add that on all platforms if you haven't already.

Antony Dovgal

unread,
May 27, 2009, 6:06:50 AM5/27/09
to jacobsmbo...@yahoo.de, Protocol Buffers
On 26.05.2009 12:08, jacobsmbo...@yahoo.de wrote:
> Thanks a lot!
>
> It worked well after i figured how to add it to the configure script
> of my PHP extension project:
> ./configure ... EXTRA_LDFLAGS='-lprotobuf'

You can use my config.m4 as an example:
http://github.com/tony2001/pinba_extension/blob/c6a633c9f3343d20892d1c804effccb4f5d67469/config.m4

--
Wbr,
Antony Dovgal
---
http://pinba.org - realtime statistics for PHP

Reply all
Reply to author
Forward
0 new messages