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

    std compile error

    Cinema 4D SDK
    r19 c++
    3
    6
    912
    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.
    • J
      Jmelon
      last edited by

      hi,
      i meet compile error when use std in r19, the specific error prompts and simple test codes are as follows

      //main.cpp
      #include "c4d.h"
      #include "main.h"
      #include <string>
      
      Bool PluginStart()
      {
         std::string test;
              ...
      }
      
      

      errors:

      Error	C2784	'const _Ty &std::_Max_value(const _Ty &,const _Ty &) noexcept': could not deduce template argument for 'const 
                      _Ty &' from 'unsigned __int64'    
                      e:\visualstudio2017\vc\tools\msvc\14.16.27023\include\xmemory0	45	
      Error	C2782	'const _Ty &std::_Max_value(const _Ty &,const _Ty &) noexcept': template parameter '_Ty' is ambiguous		 
                      e:\visualstudio2017\vc\tools\msvc\14.16.27023\include\xmemory0	45	
      Error	C2672	'_Max_value': no matching overloaded function found	 
                      e:\visualstudio2017\vc\tools\msvc\14.16.27023\include\xmemory0	43	
      
      

      it no errors in r20, and if any additional considerations in r19 when use std?

      hope your help!

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by Manuel

        hello,

        I've marked your thread as a question, feel free to mark it as solved when you think it is, see this thread for information : Q&A New Functionality.

        Regarding your issue, i couldn't reproduce it using both visual studio 2015 and 2017.

        You should probably stick to this recommendation regarding the visual studio to use :
        [URL-REMOVED]

        About string you should use our builtin String class. We have a manual with lot of information

        Are you trying this with the Cinema4D SDK example or your own project ?
        Does this project is coming from r19 or an older version ?

        Cheers
        Manuel


        [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

        MAXON SDK Specialist

        MAXON Registered Developer

        J 1 Reply Last reply Reply Quote 0
        • J
          Jmelon @Manuel
          last edited by

          @m_magalhaes use r19 sdk , not change any thing, just add two line in main.cpp:

          ...//other head file
          #include <string>
          Bool PluginStart()
          {
          	VERSIONTYPE versionType = GeGetVersionType();
          
          	std::string test;
                  ...
          }
          

          it will case same error. not only std::string, other like std::vector, std::set also fail. looks like something conflict with std in r19.

          1 Reply Last reply Reply Quote 0
          • ManuelM
            Manuel
            last edited by

            Ok, could reproduce it.

            That's because of the platform toolset. (using a different Visual Studio)

            In your project properties, Configuration Properties -> General -> Platform Toolset you should have Visual Studio 2015 (v140).

            If you don't have it, you have to install it.

            Cheers
            Manuel

            MAXON SDK Specialist

            MAXON Registered Developer

            J 1 Reply Last reply Reply Quote 1
            • J
              Jmelon @Manuel
              last edited by

              @m_magalhaes thank you! switch to 2015(v140) is all right : )

              1 Reply Last reply Reply Quote 0
              • M
                Mohamed Sakr
                last edited by

                I know this is quite an old topic, @m_magalhaes @Jmelon it would compile if you put c4d.h at the end of all other STL includes

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