Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Linking to an external library

8 REPLIES 8
Reply
Message 1 of 9
chrisdawlud
874 Views, 8 Replies

Linking to an external library

I'm writing a global utility plugin and I want to use OpenImageIO library. The obvious solution is to create the plugin executable, statically linking against the static OIIO library, which ends up with one executable, but I'm having a hard time making this approach work, because of the library-specific errors that I'm getting.

Until I solve this, I want to dynamically link to OIIO library at load-time, but I don't know how to do that properly.

 

The OIIO library requires 14 dependencies (e.g. boost_filesysten-vc142-mt-x64-1_70.dll, IlmImf-2_3.dll, jpeg62.dll, etc.)

I'm using vcpkg, so all these .dlls are automatically copied to where the plugin .dll is in 3ds Max 2020/Plugins, but I'm still getting the following error when the plugin is loaded.

 problem.jpg

8 REPLIES 8
Message 2 of 9
istan
in reply to: chrisdawlud

Put these DLLs to the path where 3dsmax.exe is located.

Message 3 of 9
chrisdawlud
in reply to: istan

That would override already existing libraries like zlib.dll or jpeg62.dll. I tried it anyway, but I got the same error dialog as before, and additional one with 'stdplugins/OSLMap.dlt failed to initialize'  instead.

Message 4 of 9
istan
in reply to: chrisdawlud

I would check with 'depency walker' which other DLLs might be missing..

Message 5 of 9
chrisdawlud
in reply to: istan

It doesn't really tell me what is going on exactly, but I don't think it's because the dependencies are missing, but rather they are not loaded properly. Is there some alternative to moving the .dlls inside root 3ds Max folder?

 

dependencies.jpg

Message 6 of 9
istan
in reply to: chrisdawlud

The last two yellow marked DLLs are missing. Search for them on the disk, your GUP needs them aparently.

Message 7 of 9
chrisdawlud
in reply to: istan

These 2 dependencies seem to be resolved at a later stage because they always show up as not found even if some plugin requiring them is loaded correctly. Same thing with BMM.DLL, CORE.DLL, GUP.DLL, etc. if the scanned .dll is not in root 3ds max directory but in Plugins folder instead.

Message 8 of 9
istan
in reply to: chrisdawlud

For BMM.DLL e.g. these DLLs are not marked as not found on my machine...

Message 9 of 9
chrisdawlud
in reply to: istan

Considering that there is already an OpenImageIO.dll (1.8.0) inside Max directory, I have build OpenImageIO (1.8.0) and linked my project to the import library. Now, apart from not having the most recent version, it all works fine.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report