I am having issues running an example from the DronecodeSDK. I got everything downloaded (I did have to modify a few things to get everything to build properly) and have successfully built the example takeoff_land. However, when I try to run the executable I get an error the all of the target_link_libraries are not found. I can see where these files exist within “DronecodeSDK/build/src/…” Does anyone have any ideas as to why the executable does not see they exist?
I really don’t understand how dll finding in Windows works but what I have found so far is that all dlls that are required need to be in the directory where you run the exe from.
@JonasVautherin I see that with the build system reorg the manual copying of dlls is not required anymore, so maybe you can help here.
@trentmhobbs check how it is done in appveyor, in theory you should be able to do the same locally.
I don’t know how Windows finds the DLLs when running an app. I guess you did not move
takeoff_and_land.exe before trying to run it, did you?
I would love to get more insights regarding how that’s working, and whether we should change something in the Windows build.
This said, one solution I see would be to link the sdk libraries statically into
takeoff_and_land.exe (i.e. build the SDK with
-DBUILD_SHARED_LIBS=OFF, which will build static libs instead of shared ones).
Please let us know how it goes!
I haven’t been back to work on it very much since, but I did manage to get it to compile by manually copying over the DLL files to the directory with the .exe file before trying to run the executable. I’m sure there’s a solution where I should not have to manually copy them, but I have not gotten a chance to look into it any more yet.
Right, sounds fair. I guess an alternative would be to install them in the system (isn’t there a “system” or “system32” directory for system DLLs?).