SAMSON Forum
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • SAMSON Connect
    • Get SAMSON

    DLL dependencies of an Element

    Apps
    3
    4
    3022
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Alain last edited by

      Hi,

      The Element I am developing has dependencies to two other DLLs that are also part of my project. When I launch SAMSON, these DLLs are not found unless they are present in the PATH environment variable.

      How should I handle this case? Is it possible to install them automatically at some location recognized by SAMSON?

      And, for a later step: will it be possible to also upload them when uploading my Element to samson-connect?

      Best,
      Alain

      1 Reply Last reply Reply Quote 0
      • J
        Jocelyn last edited by

        Hi,
        For the moment there is no mechanism to do that with Samson. Is it possible for you to statically link to theses dll?
        When Samson starts it loads all Samson dll, then it iterate to all Samson elements dlls and do a dlopen on theses libraries.
        We have never tried to load this kind of library.
        It should work if you put the library in the same folder of Samson-core.exe
        Maybe this function can help : void QCoreApplication::addLibraryPath(const QString &path) (static)
        Or this one : DLL_DIRECTORY_COOKIE WINAPI AddDllDirectory(
        In PCWSTR NewDirectory
        );

        Tell me if it solve your problem, and if yes we will think to add this possibility on Samson 0.8.0

        Best, Jocelyn

        I will try to test on a concrete example on Tuesday.

        1 Reply Last reply Reply Quote 0
        • A
          Alain last edited by Alain

          Thanks for the answer!

          Actually it is a total of three libraries:

          • the first one is a module that I load with dlopen. For this one I just implemented a solution where it is installed in the Element Resource directory from CMake, and I then fetch it with a path like SB_ELEMENT_PATH + "/Resource/MyLib.dll". This works.

          • the second one is a shared library on which the element directly depends. I fear I cannot use QCoreApplication::addLibraryPath because this library will be required before any code from the SAMSON Element can be executed. I will have a look if I can convert it to a static library.

          • the third one is the dynamic library for Intel TBB. One could require the user to install Intel TBB himself. Otherwise it is the same problem as for the second library above.

          1 Reply Last reply Reply Quote 0
          • K
            khushbu last edited by

            From here you can solve your issue related to the dll file, what you need to do is check missing Burutter.dll and copy the setting and save the dll file setting in your PC then you are able to replying of dll files.

            1 Reply Last reply Reply Quote -1
            • First post
              Last post