Thanks,
I'll look into those. I assumed that PREVIEWRENDER would be for viewport rendering, but after some tests it appears it is not. I'll try to check if it is set when rendering via RenderDocument()!
/Filip
Thanks,
I'll look into those. I assumed that PREVIEWRENDER would be for viewport rendering, but after some tests it appears it is not. I'll try to check if it is set when rendering via RenderDocument()!
/Filip
Thanks,
I will check this again. I am marking this as solved for now.
/Filip
Actually, this does not seem to solve my problem. The option gets added under
"Configuration Properties-> Linker ->All Options->Additional Options"
just as you said, but I would need to modify
"Configuration Properties-> Linker ->All Options->Delay Loaded DLLs".
Is this possible from the project tool? This is for a public open source software, so I would really like to make the build process as streamlined as possible to aid external developers. Therefore, I would like to avoid manually changing the projects generated by the projecttool.
Thanks
/Filip
Thanks, I'll try that!
Regarding the "Ask as a question", have you considered making this the deafult when creating new threads? I would assume most new threads are indeed questions, and it's easy to forget checking this option.
Thanks
/Filip
Hi!
With the project tool, is it possible to specify visual studio-specific options beyond the options outlined here in the docs: https://developers.maxon.net/docs/cpp/2023_2/page_maxonapi_projecttool.html#page_maxonapi_projecttool_definition_win ?
Specifically, I would like to set the /DELAYLOAD linker option in my project from the projecttool. Is this possible?
Thanks
/Filip
@r_gigante said in Specify additional directories for DLL dependencies:
If I end up with some workaround I'll come back here but for the time being I consider it solved.
OK, thanks for the info!
/Filip
Hi!
My plugin depends on a 3rd party external library in the form of a DLL. According to the docs, additional DLLs needed by a plugin can be placed in myplugin\res\libs\win64. (https://developers.maxon.net/docs/cpp/2023_2/page_maxonapi_dev_windows.html#page_maxonapi_dev_windows_practice_dll).
For my plugin, this is not a very convenient solution. The DLL in question is already installed in a specific location, which is added to the PATH environment variable by the installer of the 3rd party library. Also, my plugin project actually consists of several c4d plugins which each need to communicate with the same copy of the DLL. My workaround solution for now is to simply place the DLL in the same directory as the c4d executable. This works, but is not very elegant.
So: Is there any way to specify a custom directory where my plugins will look for additional dynamic libraries? This was possible in previous versions of c4d (using the standard PATH environment variable) so I am really hoping it is possible in R20 as well.
Thanks
/Filip
This has deviated a bit from the original question, so I will mark this as solved and open a new thread with the remaining questions.
Thanks for the input everybody!
I have identified the issue: My plugin could not find/load the dll containing the implementation of the external library. If I place a copy of this dll in <myplugin>\res\libs\win64 then my plugin loads correctly in c4d and is able to call the 3rd party external library.
I found the information about where to place external libs here: https://developers.maxon.net/docs/cpp/2023_2/page_maxonapi_plugin_dev.html#page_maxonapi_plugin_dev_dependencies_dependencies
In the case of my plugin, however, this solution is not quite satisfactory. It is a large project consisting of several c4d plugins, each dependent on the 3rd party external library. With this solution, I would have to place a copy of the dll in each plugin folder- The dll is quite large (it's a renderer!) so this would bloat my plugin significantly.
Is there any way of telling a c4d plugin to look for dll:s in a specificed directory? (And, as a secondary question: Previously, it was enough to add the dll directory to the PATH environment variable. Is there a good reason why this behaviour was changed?)
/Filip
OK; I seem to have pinpointed the problem to the use of an external library. I created a minimal example plugin that recreates the problem. Including the header file for the external library does not cause any problem, but as soon as I actually create an instance of a class defined in this header in my code, my plugin will stop loading (although everything compiles just fine).
The external library is essential to my plugin, so I can't work around this. In previous versions of c4d (pre-R20) I have used this external library a lot without problems.
Is there anything special I should look out for here? Is it possible,for example, that the source processor does anything to the headers of the external library when I include them? (My understanding of the role of the source processor is still a little shallow).
Thanks
/Filip
Thanks a lot for the input everybody! None of these things appear to solve my problem, so I am now investigating more closely if this is something specific to our plugin code. I'll post here again if I come up with a solution.
/Filip
Thanks mp5gosu,
We are both on R20, but it's quite possible that we are on different minor versions. I will check.
I have understood that from R20 and on, compiled plugins will not be compatible across releases, but I assumed that this only applied to major releases. Are you saying that compiled plugins are not even compatible between minor releases?
(As I wrote in my original post, the c4d sdk plugins work fine, it is only our plugin that does not load)
/Filip
Hi all!
I am working with a colleague on a plugin that was recently ported to R20, and have encountered an issue. The plugin works fine on my colleagues machine, but when I compile it on my computer it fails to load in c4d without any warnings or errors. The plugin uses the classic API, and through testing I have concluded that "PluginStart" is never called. Here is what I did to debug this so far:
-I copied the compiled dll from my colleague, that worked on his computer.
-I placed these in a separate folder containing only our plugin and the c4d sdk plugins (built from the same solution).
-In the c4d preferences, I set this folder as the only plugin folder, so that no other plugins are loaded.
In this test, the c4d sdk plugins load fine, but our plugin does not. This is indicates to me that the plugin folder is setup correctly, and the problem actually is with our plugin. But this is the same dll that loads fine on my colleagues computer!
I realize that this is a very vague problem description, but any suggestions on what might be causing a similar issue is warmly welcome!
Best regards
/Filip
Thanks Sebastian, I will try that!
/Filip
Hi!
I am finally taking the plunge and moving my development to R20. To get started I am porting an old plugin to R20. I have successfully compiled the sdk examples for R20. However, when compiling my own plugin, I get errors related to the style guide, e.g.:
error : Style guide requires whitespace before =.
The "projectdefinition.txt" file for my plugin looks as follows:
// Supported platforms - can be [Win64;OSX]
Platform=Win64;OSX
// Type of project - can be [Lib;DLL;App]
Type=DLL
// API dependencies
APIS=cinema.framework;mesh_misc.framework;math.framework;crypt.framework;python.framework;core.framework;
// C4D component
C4D=true
stylecheck=false
//stylecheck.level=0 // must be set after c4d=true
stylecheck.enum-registration=false
stylecheck.enum-class=false
// Custom ID
ModuleId=com.filipmalmberg.solidchamfer
I thought the setting stylecheck=false would disable the stylecheck completely? Am I doing something wrong?
Best regards
/Filip