Plugin Development Toolchains

Discussion in 'Plugins' started by abm, Apr 17, 2017.

  1. abm

    abm Registered

    Joined:
    Apr 17, 2017
    Messages:
    2
    Likes Received:
    1
    Hello,

    I am currently developing a plugin (based on the internals plugin v3 given on the official site) for rFactor1/rfactor2. With the Visual Studio example project everything works fine but I have trouble with using MinGW/Eclipse CDT.

    What I don't understand is why the DLLs created by the Visual Studio tool chain actually work, as none of the functions (e.g. updateTelemetry) is declared to be exported (with __declspec(dllexport)) explicitly. Has anyone ever tried building an internals plugin with MinGW? Which functions have you marked to be exported?

    Thanks for any help in advance,

    Andre
     
    Juergen-BY likes this.
  2. palm3r

    palm3r Registered

    Joined:
    Jan 11, 2012
    Messages:
    37
    Likes Received:
    10
    It is not possible to mix EXE and DLL built with MSVC and MinGW.
    C ++ does not have ABI (Application Binary Interface) compatibility between different compilers.
    C ++ functions (such as class names and method names) are named differently for each compiler when exported from a DLL. (Google "C++ name mangling")
    Although linking is possible by using export of C format (extern "C"), this way can not be used since rF2 plugin uses C ++ class.
    So you can't use MinGW for developing rF2 plugin.
     
    The Iron Wolf likes this.
  3. abm

    abm Registered

    Joined:
    Apr 17, 2017
    Messages:
    2
    Likes Received:
    1
    Hello palm3r,

    your help is very much appreciated. I will use the Visual Studio toolchain.
     

Share This Page