View Full Version : compile API

10-20-2006, 01:45 PM
I am working in maya 6.5 .... I know I need to upgrade .... I want to compile some plugins with the API how can I do this? Where can I look online for this information?

10-20-2006, 02:00 PM

If I am correct, for compiling programs, u need a application like VC++ and you might need to set some stuff in VC++ to get you codes into plugins with files *.mll format... For Those details, I think you can ck out maya docs...

- - a nice site which has some info reg api, mel, etc..

- Maya 6.5 API Help Documentation which comes bundled with the Application(I guess)

I just googled the links below...


10-20-2006, 02:55 PM
the 6.5 api does not work with the 2005 version of the microsoft visual C++ compiler I need to get the 2003 version does any one know where I can get an out dated version of the compiler or is there a way to make it work in 2005?

Robert Bateman
10-20-2006, 04:21 PM
it is compatible?

10-23-2006, 05:20 AM
This is my first plugin with the maya api so thank you for you help in advance.

Ok I think I've got every thing set up right. I used the instructions on david gould's website and it all seems right. However, I keep getting this error when I compile.

c:\documents and settings\frank\desktop\curveinfo1\curveinfo1cmd.cpp(9) : fatal error C1083: Cannot open include file: 'maya/MGlobal': No such file or directory

I know this directory is right and I know that this file is in that directory.

Can any one think of any reason why I am getting this error.

thanks a bunch.

Robert Bateman
10-23-2006, 10:32 AM
shouldn't it be :

#include <maya/MGlobal.h>

10-23-2006, 01:11 PM
thanks for the help I fixed that but i'm having some other trouble now.

this is the error

c:\program files\alias\maya6.5\include\maya\mtypes.h(127) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory

this is the code i'm trying to compile.

// This file accompanies the book "Complete Maya Programming (Volume 2)"
// For further information visit
// Copyright (C) 2004 David Gould
// All rights reserved.
#include <maya/MSimple.h>
#include <maya/MGlobal.h>
#include <maya/MItSelectionList.h>
#include <maya/MPoint.h>
#include <maya/MFnNurbsCurve.h>
#include <maya/MDagPath.h>

DeclareSimpleCommand( curveInfo1, "David Gould", "1.0" );

MStatus curveInfo1::doIt( const MArgList& args )
MStatus stat = MS::kSuccess;

MSelectionList selection;
MGlobal::getActiveSelectionList( selection );

MDagPath dagPath;
MObject component;

const char *formTxt[] = { "Invalid", "Open", "Closed", "Periodic", "Last" };
double start, end;
int i, nCVs, nKnots;
MPoint pt;
double knot;

MString txt;
MItSelectionList iter( selection );
for ( ; !iter.isDone(); )
iter.getDagPath( dagPath, component );

MFnNurbsCurve curveFn( dagPath, &stat );
if( stat )
txt += dagPath.fullPathName() + "\n";

txt += MString("Length: ") + curveFn.length() + "\n";
txt += MString("Degree: ") + + "\n";
txt += MString("Form: ") + formTxt[ curveFn.form() ] + "\n";
txt += MString("Spans: ") + curveFn.numSpans() + "\n";

curveFn.getKnotDomain( start, end );
txt += MString("MinValue: ") + start + " MaxValue: " + end + "\n";

nCVs = curveFn.numCVs();
txt += MString("CVs: ") + nCVs + "\n";
for( i=0; i < nCVs; i++ )
curveFn.getCV( i, pt, MSpace::kWorld );
txt += MString(" (") + pt.x + ", " + pt.y + ", " + pt.z + ")";
txt += "\n";

nKnots = curveFn.numKnots();
txt += MString("Knots: ") + nKnots + "\n";
for( i=0; i < nKnots; i++ )
knot = curveFn.knot( i );
txt += MString(" ") + knot;
txt += "\n";

MGlobal::displayInfo( txt );

return MS::kSuccess;

Robert Bateman
10-23-2006, 03:34 PM
If you are using the Express Edition, have you installed the windows platform sdk (

10-24-2006, 02:48 AM
I am having a difficult time installing it is extreamly slow and I keep getting a error near the end of the install sequence. Does any one know what the problem might be. I am using windows xp should I download something else?

10-24-2006, 04:47 AM
ok i've installed the sdk and i'm still getting the same error. i'm stumped does any one have any ideas?

10-24-2006, 05:16 AM
Ok i've got it working. I found it on this site.

CGTalk Moderation
10-24-2006, 05:16 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.