-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading a DLL with dependencies #102
Comments
Can you share a code sample of what you did and the output it created? Please set the |
Hey, I can't share it because it is behind my company's secure network. First off, I create a dll that needs another dll (no source code for the dependency) like so: cmake_minimum_required(VERSION 3.16)
project(my_wrapper_dll LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
add_library(my_wrapper_dll SHARED src/wrapper.cpp)
# Link against the lib if necessary
target_link_libraries(my_wrapper_dll myClosedSrc.lib)
The lib file is used in compile time, the dll in runtime. Next I try loading it like so in python: import zugbruecke as zb
my_session_server = zb.SessionServer()
my_session_server.load_library("./dlls/myClosedSrc.dll")
my_loaded_dll = my_session_server.load_library("./dlls/my_wrapper_dll.dll") When running this my logs say that they manage to attach to The server then proceeds to shutdown. |
DLL discovery can be a bit of a pain. Just for debugging purposes, try putting them all, your DLL and its relevant dependencies, into the current working directory. Alternatively, use symlinks. Wine attempts to follow the semantics of Windows, but there are caveats. Second, you are passing a typical Unix path, which is something that Wine can deal with - however, it can cause issues. Try specifying a Windows path instead. There are helper functions to convert from a Unix to a Windows path and back, see here. Last, just to make sure, |
I tried the three things. I manage to load the dependency on its own properly, but once I try loading my DLL I'm guessing wine doesn't know where to look. Symlinks don't seem to work as the problem seems to be that the dependency isn't loaded through wine. |
Hey @s-m-e |
In this regard, |
Hey.
I've received a DLL and a corresponding Lib from a client, I don't have any access to source code and they won't provide any other solutions.
I've tried running the DLL in windows through python but couldn't manage because its function are changed.
So I made a CPP wrapper that linked the lib in compile time and calls the DLL in runtime.
This now works in python in windows.
When trying to load the DLL with zugbruecke in Linux (the environment works with other dlls) the process fails because it can't find the dependency.
I've attached the dependency to the session but it still won't recognize it.
Has anyone encountered this problem?
The text was updated successfully, but these errors were encountered: