[Webkit-unassigned] [Bug 29244] [GTK] Linking fails with unreferenced symbols error

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 15 22:40:17 PDT 2009


--- Comment #2 from Priit Laes (IRC: plaes) <amd at store20.com>  2009-09-15 22:40:16 PDT ---
>From the discussion with gperf developer Bruno Haible:

> >   - the source code of the source file that #includes the processed file?
> Hum? It seems to be compiled straight into library...

OK, so that was compiled as a C file and thus created a 'findEntity' function
with C linkage.

> >   - the output of
> >        $ nm --dynamic .libs/libwebkit-1.0.so | grep findEntity
> [output]
>                        U _Z10findEntityPKcj
> 000000000138d1a8 T findEntity
> [/output]

Here you see that 'findEntity' exists as a function with C linkage but some
other compilation unit needs it as a function with C++ linkage.

What you need is either to #include the generated C file like this:
  #include "gperf-generated-c-code.c"
from a C++ compilation unit. Or directly name the generated file
"gperf-generated-c-code.cc", and tell gperf to generate C++ code instead
of ANSI C code.

Or to use the following declaration in your C++ compilation units:

  extern "C" {
  extern const struct Entity *findEntity (const char *str, unsigned int len);

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list