Type UCHAR question [SOLVED]

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

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.

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

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.

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.

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.

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

Thanks!

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