How to debug WebKit2GTK+ extensions

前端 未结 1 433
一向
一向 2021-01-22 15:22

I am trying to get WebKit2GTK+ Extensions to work, it is a simple extension that will just print into the console when a page is created. Here is my project structure:



        
相关标签:
1条回答
  • 2021-01-22 15:58

    Since it's C++ it could be due to name mangling. Try to prefix the webkit_web_extension_initialize function with extern "C". For example:

    extern "C" G_MODULE_EXPORT void
    webkit_web_extension_initialize (WebKitWebExtension *extension)
    {
        std::cout << "extension hi\n";
        /* your code */
    }
    

    You can use readelf or objdump to list all exported symbols and see if they have mangled names.

    0 讨论(0)
提交回复
热议问题