Undefined symbols
-
I'm getting this error message:
Undefined symbols for architecture x86_64:
"ToString(String const&, maxon::FormatStatement const*, bool)", referenced from:
void maxon::ToStrHlp<String>(maxon::String&, String const*, maxon::FormatStatement const*) in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)And I'm not even using the ToString in any of my code.
Trying to recompile all my plugins to R21 is being really hard -
@rui_mac said in Undefined symbols:
maxon::ToStrHlp
If you search the codebase for ToStrHlp it actually gives you a nice little comment about what might be wrong
// If you get a compiler error about "Use of undeclared identifier 'ToString'" as result of calling
// DiagnosticOutput() you must #include "maxon/string.h" in that source file to fix it.
template <typename T> inline void ToStrHlp(String& result, const T* x, const FormatStatement* formatStatement) { result = ToString(*x, formatStatement); }Are you calling DiagnosticOutput() anywhere?
-
Actually, yes.
Would it be better to use GePrint?
Or was it discontinued?
What is the best way to print to the Console now, in C++? -
@rui_mac said in Undefined symbols:
What is the best way to print to the Console now, in C++?
ApplicationOutput()
If you mean the Cinema4D console, that is. -
Hi Rui, thanks for reaching out us.
With regard to the mentioned issued, it's pretty clear looking at the outputted line in the building log that you were trying to feed some function with a data-type missing the ToString() method which is usually supposed to "convert" the data in a convenient
maxon::String
representation.
I warmly recommend to have a look at the Conversion section in the maxon::String Manual.Last but not least this change was already requested to adapt code from R19 to R20 and not from R20 to R21.
Best, R
-
You can still use DiagnosticOutput. The comments from the code I pasted above said the following... did you try this?
“you must #include "maxon/string.h" in that source file to fix it.”
-
I still get the same error, even after adding the #include "maxon/string.h"
I also replaced the DiagnosticOutput() with ApplicationOutput(), but the error persists. -
Thanks for checking, I was interested to know if that was your problem or not.
I will leave you in the hands of the SDK team.
-
Hi rui_mac, might you kindly consider sharing a snippet to reproduce the issue?
Thanks, R
-
Since it is my serial protection code, I may have to edit things a bit, to protect my secrets
I will see if I can adjust to code to provide as much information as possible, without revealing too much, as soon as I get home. -
If you prefer in order to not disclose confidential stuff you can contact us by email at [email protected].
Cheers,
Maxime. -
Great, I will do that.