OK, I’m kind of new to C++ and was just trying to make the simple helloWorld plugin for Maya to see if it would work. But when I try to compile it, with the Borland 5.5 compiler, it gives me errors for the MTypes header file. I’m probably doing something stupid, but I can’t seem to find it.
Here’s the source:
#include <maya/MSimple.h>
DeclareSimpleCommand( hello, “Alias|Wavefront”, “4.0”);
MStatus hello::doIt( const MArgList& args )
{
printf("Hello %s
", args.asString( 0 ).asChar() );
return MS::kSuccess;
}
Here’s the error Borland gives me:
C:\Borland\BCC55\Bin>bcc32 -ehelloworld.mll helloWorld.cpp
Borland C++ 5.5.1 for Win32 Copyright © 1993, 2000 Borland
helloWorld.cpp:
Error E2176 c:\Borland\Bcc55\include\maya/MTypes.h 208: Too many types in declar
ation
Error E2176 c:\Borland\Bcc55\include\maya/MTypes.h 208: Too many types in declar
ation
Error E2146 c:\Borland\Bcc55\include\maya/MTypes.h 208: Need an identifier to de
clare
Error E2184 c:\Borland\Bcc55\include\maya/MTypes.h 212: Enum syntax error
Error E2040 c:\Borland\Bcc55\include\maya/MTypes.h 212: Declaration terminated i
ncorrectly
Error E2190 c:\Borland\Bcc55\include\maya/MTypes.h 212: Unexpected }
Error E2190 c:\Borland\Bcc55\include\maya/MTypes.h 212: Unexpected }
*** 7 errors in Compile ***
C:\Borland\BCC55\Bin>
Here’s lines 207-213 of MTypes.h:
207: #ifndef _BOOL
208: typedef unsigned char bool;
209: #if !defined(true) && !defined(false)
210: #ifndef TRUE_AND_FALSE_DEFINED
211: #define TRUE_AND_FALSE_DEFINED
212: enum {false,true};
213: #endif // TRUE_AND_FALSE_DEFINED
Looks fine to me.:hmm:
I still want to write a bunch more console programs before I get into Maya’s API, but I just thought I’d give it a go. I’ve been using Bloodshed, so it may just be me not knowing Borland’s compiler.