tags:

views:

47

answers:

0

iam trying to export some C++ symbols from GTK webkit code with default flags -fvisibility=hidden and -fvisibility-inline-hidden

Only the C apis seem to be exported and work:

#define API __attribute__((visibility("default")))


class API export1 {
 public:
  void export1_f();
};

API void export2();
extern "C" API void export3();

Output:

nm -C .libs/libwebkitgtk-1.0.so|grep export 
0000000000aadc60 t WebKit::export1::export1_f()
0000000000aadc80 t WebKit::export2()
0000000000aadc70 T export3

As you can see above, only the C symbol is exported. Any pointers on what could be wrong (the same thing with a simple example works - not sure which flags could cause this behavior)

The symbols are proper in the compilation unit, problem seems to be in the linking phase

nm -C ./WebKit/gtk/WebCoreSupport/.libs/libwebkitgtk_1_0_la-DumpRenderTreeSupportGtk.o |grep export
0000000000000000 T WebKit::export1::export1_f()
0000000000000020 T WebKit::export2()
0000000000000010 T export3