Wrong plugin name in log

Answered

Comments

7 comments

  • Avatar
    Evgeny Balashov

    Can you please check how NX_PLUGIN_API macro is defined in your plugin?

    0
    Comment actions Permalink
  • Avatar
    Plain Wu

    Here are places containing NX_PLUGIN_API word:

     

    In CMakeLists.txt:

    target_compile_definitions(nx_sdk PRIVATE NX_PLUGIN_API="")

    target_compile_definitions(df_plugin
    PRIVATE NX_PLUGIN_API=${API_EXPORT_MACRO}
    INTERFACE NX_PLUGIN_API=${API_IMPORT_MACRO} #< Needed to link unit tests exe to plugin lib.
    )

     

    In Engine.cpp:

    extern "C" NX_PLUGIN_API nx::sdk::IPlugin* createNxPlugin() {

    return new nx::sdk::analytics::Plugin(
    kPluginManifest,
    [](nx::sdk::analytics::Plugin* plugin)
    {
    return new DFNxEngine(plugin);
    });
    }
    0
    Comment actions Permalink
  • Avatar
    Plain Wu

    Most of the code sniplets are copied from stub_analytics_plugin sample

    0
    Comment actions Permalink
  • Avatar
    Plain Wu

    In addition to previous comments:

     

    if(WIN32)
    set(API_IMPORT_MACRO "__declspec(dllimport)")
    set(API_EXPORT_MACRO "__declspec(dllexport)")
    else()
    set(API_IMPORT_MACRO "")
    set(API_EXPORT_MACRO "__attribute__((visibility(\"default\")))")
    endif()
    0
    Comment actions Permalink
  • Avatar
    Plain Wu

    My OS: Ubuntu

    0
    Comment actions Permalink
  • Avatar
    Mike Shevchenko

    Hi Plain Wu,

    I suggest that you check the following:

     

    1. The file lib_context.cpp from the SDK is compiled as part of your plugin project.

    2. The following function defined in your plugin is actually being called by the Server (e.g. set a breakpoint):

    lib_contrext.cpp: /*extern "C"*/ ILibContext* nxLibContext()

    For details about how lib_context mechanism works, please see the comments in `lib_context.h`.

    0
    Comment actions Permalink
  • Avatar
    Plain Wu

    Great! this works!

     

    I added instance.setName() in LibContext& libContext();

     

    Thank you!

    0
    Comment actions Permalink

Please sign in to leave a comment.