Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    compiling for r20 new solution

    Cinema 4D SDK
    2
    4
    727
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Y
      Yaroslav
      last edited by

      Dear c4d fellows,
      I have the following question.
      I'm trying to compile my own (beginner) plugin (solution) in VS2019.
      I have c4d r20.

      I created a projectdefinition.txt

      Platform=Win64;OSX
       
      Type=Solution
      
      Solution=\
        plugins/architect4D;\
      
      
       APIS=\
        cinema.framework; \
        misc.framework; \
        image.framework; \
        core.framework
       
      C4D=true
      
      stylecheck.level=0
       
      ModuleId=com.streamline.architect4D
       
      INCLUDE=source/architect4D.cpp;
      INCLUDE=source/architect4D.h;
      

      Then I created minimal .cpp

      #include "maxon/parallelfor.h"
      #include "c4d.h"
      #include "c4d_symbols.h"
      #include "architect4D.h"
      //#include "commandlinerender.cpp"
      
      
      class architect4D : public CommandData
      {
      public:
      	virtual Bool Execute(BaseDocument* doc);
      };
      
      Bool architect4D::Execute(BaseDocument* doc)
      {
      	return true;
      }
      
      Bool Registerarchitect4D()
      {
      	// be sure to use a unique ID obtained from www.plugincafe.com
      	return RegisterCommandPlugin(1054040, GeLoadString(IDS_ARCHITECT4D), 0, AutoBitmap("architect4D.tif"_s), "arhitect4D Plugin"_s, NewObjClear(architect4D));
      }
      

      and .h

      #ifndef ARCHITECT4D_H__
      #define ARCHITECT4D_H__
      
      #include "ge_prepass.h"
      #include "c4d_plugin.h"
      
      class BaseDocument;
      //class AtomArray;
      
      Bool Registerarchitect4D();
      
      
      //void CommandLineRendering(C4DPL_CommandLineArgs* args);
      
      #endif // ARCHITECT4D_H__
      

      and c4d_symbols.h

      enum
      {
      	// string table definitions
      	IDS_ARCHITECT4D = 10000,
      	_DUMMY_ELEMENT_
      };
      #pragma once   
      

      When compiling I have the following errors from Linker:

      Error	LNK2019	unresolved external symbol "bool __cdecl PluginStart(void)" (?PluginStart@@YA_NXZ) referenced in function c4d_main	architect4d	C:\sdk20\plugins\architect4d\project\cinema.framework_Debug_64bit.lib(c4d_pmain.obj)	
      
      Error	LNK2019	unresolved external symbol "void __cdecl PluginEnd(void)" (?PluginEnd@@YAXXZ) referenced in function c4d_main	architect4d	C:\sdk20\plugins\architect4d\project\cinema.framework_Debug_64bit.lib(c4d_pmain.obj)	
      
      Error	LNK2019	unresolved external symbol "bool __cdecl PluginMessage(int,void *)" (?PluginMessage@@YA_NHPEAX@Z) referenced in function c4d_main	architect4d	C:\sdk20\plugins\architect4d\project\cinema.framework_Debug_64bit.lib(c4d_pmain.obj)		
      
      

      What do I do wrong? It seems some linker settings are wrong. Could you please help me with this?

      Yaroslav.

      1 Reply Last reply Reply Quote 0
      • P
        PluginStudent
        last edited by

        Hello,

        the recommended VS version for Cinema 4D R20 is VS 2015, see https://developers.maxon.net/docs/cpp/2023_2/page_maxonapi_dev_windows.html.

        Every plugin has to implement PluginStart(), PluginMessage(), and PluginEnd().

        You find an example here: https://github.com/PluginCafe/cinema4d_cpp_sdk_extended/blob/master/plugins/microsdk/source/main.cpp

        See also https://developers.maxon.net/docs/cpp/2023_2/page_manual_module_functions.html

        Y 2 Replies Last reply Reply Quote 1
        • Y
          Yaroslav @PluginStudent
          last edited by Yaroslav

          Thanks, for your comment!
          But:

          @PluginStudent said in compiling for r20 new solution:

          Every plugin has to implement PluginStart(), PluginMessage(), and PluginEnd().

          Well, is this really right?
          I mean, look at sdk menutest example.
          I simply copied it and changed the name.
          But probably, you are right!

          1 Reply Last reply Reply Quote 0
          • Y
            Yaroslav @PluginStudent
            last edited by

            @PluginStudent

            Thank you so much! It worked!
            Yaroslav.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post