I am currently trying to complete a plugin for R21 in Windows 10. After compiling the code I distributed the plugin to several people and they were able to successfully run the plugin with the exception of one person. The one exception gave this error.
WARNING: Error loading file:///C:/Program Files/Maxon Cinema 4D R21/plugins/Plugin/Test Plugin.xdl64: Could not load dll. (file:///C:/Program Files/Maxon Cinema 4D
R21/plugins/Plugin/Test Plugin.xdl64) [win_dll.cpp(319)]
Cause: Windows System Error #1114: A dynamic link library (DLL) initialization routine failed. [win_dll.cpp(315)] [general.cpp(386)]
WARNING: Error loading file:///C:/Program Files/Maxon Cinema 4D R21/plugins/Plugin/Test Plugin.xdl64: symbol 'g_maxon' is missing. [win_dll.cpp(393)] [general.cpp(386)]
I've had previous plugins that didn't work because of missing DLLs so before transferring the plugin to any other computer I used a program (Dependency Walker) to check what DLL files it needed and made sure to include them under "Additional Include Directories". This process has worked for the times I've had this kind of issue up until now. This plugin has worked properly on all of the computers its been used it on except for the one giving this error. I do not have direct access to this computer so running tests will be difficult.
There is a separate post on the forums dealing with some of the same issues.
Any help figuring out the cause of this error would be greatly appreciated,
as Riccardo has pointed out, AdditionalIncludeDirectories has nothing to do with DLLs. It is used to define search paths for header files. See Additional include directories. It was never valid.
Also, looking at the error, the plugin was installed into the C:/Program Files folder. In R21, there is no reason to install plugins there; one can install plugins at any location and just tell Cinema 4D the plugin path.
Hi JohnThomas, thanks for reaching out us.
With regard to the reported issue, it's likely that it's happening because of your plugin not being compiled against R21API. Can you confirm that you're compiling against R21 API and not R20 API?
Aside from this check, please be aware that the AdditionalIncludeDirectories statement, you might use in the projectdefinition.txt, doesn't have any impact on the search path to the other DLLs your plugin depends on.
As written in Project Tool - Visual Studio Specific this additional statement in the project definition file is only responsible to set, in the IDE project file, the additional paths to search for headers. If your plugin makes use of additional dynamic libraries, you make sure that those files are copied in the folder specified in Development for Microsoft Windows - DLL.
Thanks for the response.
I am compiling against the R21 API.
As far as including the DLLs I had a similar problem in the past and I used this property inside of Visual Studios to include the necessary DLL files.
I've been using this method since before R21.
The one page you linked said that the DLLs needed can be placed in myplugin\res\libs\win64. I tried including my DLLs inside of this path and that didn't work, neither did changing projectdefinition.txt to use the AdditionalIncludeDirectories statement.
Is one of the methods you linked the proper way to include the DLLs or is using the Additional Include Directories property inside Visual Studios still valid?
As an additional bit of info the computer that it is failing to run on is running Windows Server 2016.