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

    Type UCHAR question [SOLVED]

    SDK Help
    0
    8
    663
    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.
    • H
      Helper
      last edited by

      On 29/05/2015 at 16:12, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R16 
      Platform:      Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
         Hi
      Pardon my noob-ness. In some plugin code examples i find in here and on the net theres sometimes variables of type UCHAR. In the sdk theres a UChar. If i change to "UChar" i still get an error: "Unexpected type name 'UChar'"
      I can find the definition in "ge_sys_math.h" but i still get errors even if this one is included.

      Any help appreciated.

      Cheers
      Bonsak

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 29/05/2015 at 17:28, xxxxxxxx wrote:

        UCHAR has been deprecated and replaced with UChar in R16.  Real is now Float, INT is now Int32, LONG is now Int64, etc.  If you are building for R16, this should not be happening.  Make sure that you are referencing the proper version resource in your project.

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 29/05/2015 at 17:42, xxxxxxxx wrote:

          Thanks a lot! I'll look into it in the morning. I'm probably doing something wrong as i can "Jump to definition" in xcode so it knows where the file is but i still get an error with "Unexpected type name 'UChar': expected expression".

          -b

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 29/05/2015 at 20:30, xxxxxxxx wrote:

            Sometimes this can be related to include orders or where the include is.  I've been spending my day updating R13 code to R16 and also trying to avoid including in include files.  VS really didn't like much of that (even in the includes that were in the cpp file ahead of said include).   It may just be an include issue or order of include issue.  Make sure that you are getting your c4d.h include referenced before use of its types.

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

              On 30/05/2015 at 01:31, xxxxxxxx wrote:

              Thanks Robert. The UChar error was related to GeAllocType. It turned out the there was a "GeAllocType()" statement in the code, that's now supposed to be "NewMemClear" instead.There wasn't any reference to GeAllocType in the SDK, not even a deprecated entry, so i thought that GeAllocType was maybe a typo. But i found a post here that cleared that up.

              1 Reply Last reply Reply Quote 0
              • H
                Helper
                last edited by

                On 30/05/2015 at 05:11, xxxxxxxx wrote:

                Originally posted by xxxxxxxx

                UCHAR has been deprecated and replaced with UChar in R16.  Real is now Float, INT is now Int32, LONG is now Int64, etc.  If you are building for R16, this should not be happening.  Make sure that you are referencing the proper version resource in your project.

                This is only partially right.
                UCHAR and Co. are already deprecated in R15.
                Here is how common types need to be changed for this:

                  
                // new type                 old type  
                    
                    
                    typedef Char		CHAR;
                    typedef UChar		UCHAR;
                    typedef Int16		SWORD;
                    typedef UInt16		UWORD;
                     
                    typedef Int32		LONG;
                    typedef UInt32		ULONG;
                     
                    typedef Int64		LLONG;
                    typedef UInt64		LULONG;
                    typedef Int		VLONG;
                    typedef UInt		VULONG;
                     
                    typedef Float		Real;
                    typedef Float32		SReal;
                    typedef Float64		LReal;
                     
                    typedef Vector32	SVector;
                    typedef Vector64	LVector;
                     
                    typedef Matrix32	SMatrix;
                    typedef Matrix64	LMatrix;
                     
                    typedef Vector4d32	SVector4;
                    typedef Vector4d64	LVector4;
                    typedef Vector4d	Vector4;
                     
                    typedef Matrix4d32	SMatrix4;
                    typedef Matrix4d64	LMatrix4;
                    typedef Matrix4d	Matrix4;
                

                More information can be found in "_api/legacy.h" file.

                1 Reply Last reply Reply Quote 0
                • H
                  Helper
                  last edited by

                  On 30/05/2015 at 07:01, xxxxxxxx wrote:

                  Thanks!

                  1 Reply Last reply Reply Quote 0
                  • H
                    Helper
                    last edited by

                    On 08/06/2015 at 08:13, xxxxxxxx wrote:

                    Hi,

                    Since it appears that the issue has been solved, and it's been over a week since the last post, I'm adding the solved tag to this topic.

                    Joey Gaspe
                    SDK Support Engineer

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