We developed a new plugin for R20, but we still have users on R19.
So, we need to compile the plugin also for R19.
Compiling is ok, but when linking I get the following error:
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol "void __cdecl maxon::_ConsoleOutputC4D(enum maxon::OUTPUT,class String const &,__int64,char const *)" ([email protected]@@[email protected]@[email protected]@[email protected]) commandlinerendering C:\Program Files\Maxon\CINEMA 4D R19.024\plugins\CommandLineRendering\commandlinerender.obj 1
What am I missing?
Hi @pim , thanks for reaching out us.
Looking at the error it looks like at the link time the linker is missing the Cinema 4D static libs.
With regard to your question do you confirm that:
Looking forward your answers, give best.
you're using different IDE project files for R19 and R20?
you've just ported the code from R20 to R19 and not copied-pasted project related settings?
I took an old R19 project and started from there.
I just copied the sources from R20 to the R19 project.
you're able to compile the cinema4dsdk on R19 without any problem?
No issues when compiling.
Here the Solution Explorer.
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
Where can I check the Cinema 4D static libs?
Now the plugin is working in R20 and in R21, any suggestions for R19?
After some extra tests I found out that when I comment out all DiagnosticOutput()
// DiagnosticOutput("Rendering Phase: Finalize");
it compiles and links ok!
What could be wrong?
Pinned it down to
And here another one
DiagnosticOutput("Loading Project: " + fn.GetString());
So I should use
And what to use for this one?
DiagnosticOutput() statements like these
DiagnosticOutput("Rendering successful: " + maxon::String::FloatToString((GeGetTimer() - starttime) / 1000.0) + " sec.");
give me the following warning:
Normal DiagnosticOutput() are ok
DiagnosticOutput("Rendering successful: ");
This is part of the R15 transition Change in R15, more information on
Debugging - Conversion To String and String - Creation Manual.
And you are looking for maxon::FormatString
Ok, I will read and try to understand.
Yes, I should have read the manual.
In R19 it is GeConsoleOut() and not DiagnosticOutput()
I have the original R16 and R19 SDK documentation installed locally, and there I do find DiagnosticOutput.
As such, I am still wondering what the issue is you have.
here's an excerpt from the R16 SDK documentation:
#define DiagnosticOutput ( fmt,
DiagnosticOutput outputs text into the console. The output is visible in debug builds or in a release build when the debug console with diagnostic output is activated. The full printf syntax can be used for the format string. THREADSAFE.
To me this seems mostly identical to what the current R21 online documentation mentions.
So in theory it should be no problem for R19.
But going from DiagnosticOutput() to GeConsoleOut() solved the issue.
Using maxon::String in DiagnosticOutput() seems to be the issue.
Looking at the doc in R19:
So I'm afraid there is no simple solution that will work on each version maxon::String being introduced in R20, you will need to adapt your code.