I'm finally starting to compile (or trying to) my plugins in VisualStudio, in Windows.
I started with the simplest one and I'm getting lots of errors when building it.
Error LNK2001 unresolved external symbol "public: static struct maxon::StringInterface::MTable maxon::StringInterface::MTable::_instance" ([email protected]@[email protected]@@[email protected]) cmyk C:\Program Files\MAXON\Cinema 4D R20\sdk\plugins\cmyk\project\main.obj 1
Error LNK2019 unresolved external symbol "void __cdecl GePrint(class maxon::String const &)" ([email protected]@[email protected]@@@Z) referenced in function "bool __cdecl PluginStart(void)" ([email protected]@YA_NXZ) cmyk C:\Program Files\MAXON\Cinema 4D R20\sdk\plugins\cmyk\project\main.obj 1
Error LNK2019 unresolved external symbol "class Filename const __cdecl GeGetPluginPath(void)" ([email protected]@[email protected]@XZ) referenced in function "bool __cdecl PluginStart(void)" ([email protected]@YA_NXZ) cmyk C:\Program Files\MAXON\Cinema 4D R20\sdk\plugins\cmyk\project\main.obj 1
Error LNK2001 unresolved external symbol "class GeResource g_resource" ([email protected]@[email protected]@A) cmyk C:\Program Files\MAXON\Cinema 4D R20\sdk\plugins\cmyk\project\main.obj 1
The cinema4dsdk compiled just fine. What can be going wrong?
How does your projectdefinition.txt look like?
Also, which project did you open in VS?
The project I opened is the one selected here:
And the content of my projectdefinition.txt is:
// Supported platforms - can be [Win64;OSX]
// Type of project - can be [Lib;DLL;App]
// API dependencies
// C4D component
stylecheck.level=3 // must be set after c4d=true
// Custom ID
Hi rui_mac, thanks for reaching us.
With regard to your question, it should be noted that you can't compile the .vcxproj file directly but rather you have to create a .sln file to be opened in VisualStudio as Solution and then "build" it.
I recommend you to have a look to the SDK Structure and more specifically to custom solution at our documentation.
You have to open the master solution file, by default located in sdk\plugins\project. The projectdefinition.txt in there also has to be setup to load your cmyk plugin.
I was just using the files that were created by Project Tool, just like I did on Xcode.
I already had a look at the links you provided (I had already seen those, when creating Xcode stuff) but, how can I create a .sln file?
I went to the Build menu and selected "Build Solution" and I still got the same errors.
Ok, just to let you all know that it is finally working
we are glad @rui_mac you were able to solve your problem.
I'd just like to quickly recap to make this also clear for future readers.
Visual Studio has two "concepts" two organize your development work.
Now, our project tool can and does create both projects (for your plugins and for our frameworks) and a solution containing all of the above (actual workflow described in our docs under the links provided by Riccardo earlier on in this thread). So when you open such a solution and build your plugin project, also the frameworks it's depending on should be built.So, this is the way to go (project tool -> solution and projects -> open solution in Visual Studio).
But if you instead open just one of the generated projects directly, Visual Studio will implicitly generate a solution for you, but it still lacks the framework projects and the build of the opened project will fail (error: unresolved symbols, i.e. function or class names normally provided by our frameworks and used in the plugins code can not be resolved).
I hope this makes it a bit easier to understand.