Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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

    Lots of "unresolved external symbol" errors

    Cinema 4D SDK
    c++ windows r20
    4
    9
    1.6k
    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.
    • R
      rui_mac
      last edited by

      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.
      Errors like:

      Error LNK2001 unresolved external symbol "public: static struct maxon::StringInterface::MTable maxon::StringInterface::MTable::_instance" (?_instance@MTable@StringInterface@maxon@@2U123@A) 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 &)" (?GePrint@@YAXAEBVString@maxon@@@Z) referenced in function "bool __cdecl PluginStart(void)" (?PluginStart@@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)" (?GeGetPluginPath@@YA?BVFilename@@XZ) referenced in function "bool __cdecl PluginStart(void)" (?PluginStart@@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" (?g_resource@@3VGeResource@@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?

      1 Reply Last reply Reply Quote 0
      • M
        mp5gosu
        last edited by

        How does your projectdefinition.txt look like?
        Also, which project did you open in VS?

        1 Reply Last reply Reply Quote 1
        • R
          rui_mac
          last edited by

          The project I opened is the one selected here:

          alt text

          And the content of my projectdefinition.txt is:

          // Supported platforms - can be [Win64;OSX]
          Platform=Win64;OSX

          // Type of project - can be [Lib;DLL;App]
          Type=DLL

          // API dependencies
          APIS=image.framework;cinema.framework;mesh_misc.framework;math.framework;crypt.framework;python.framework;core.framework;command.framework

          // C4D component
          C4D=true

          stylecheck.level=3 // must be set after c4d=true

          // Custom ID
          ModuleId=com.ruimac.cmyk

          1 Reply Last reply Reply Quote 0
          • r_giganteR
            r_gigante
            last edited by r_gigante

            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.

            Best, Riccardo

            1 Reply Last reply Reply Quote 1
            • M
              mp5gosu
              last edited by

              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.

              1 Reply Last reply Reply Quote 1
              • R
                rui_mac
                last edited by

                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?

                1 Reply Last reply Reply Quote 0
                • R
                  rui_mac
                  last edited by

                  I went to the Build menu and selected "Build Solution" and I still got the same errors.

                  1 Reply Last reply Reply Quote 0
                  • R
                    rui_mac
                    last edited by rui_mac

                    Ok, just to let you all know that it is finally working 😃

                    1 Reply Last reply Reply Quote 0
                    • a_blockA
                      a_block
                      last edited by

                      Hi,

                      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.

                      1. Projects, which is basically a set of files plus a bunch of configuration options and instructions for the tool chain (compiler, linker,...) to build a binary (in our case here always a plugin library).
                      2. Solutions, which are collections of above projects plus some additional global configuration data and more important, information on dependencies of the contained projects.

                      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.

                      Cheers,
                      Andreas

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