maya API programming


#1

Hi,
Does anyone use Dev C++ for compiling maya plugins?
I tried to compile a hello world plugin, but it wouldnt compile because Dev C++ cant find the header files.
I dont know how to get Dev C++ to point at the maya include dir. I keep getting this error:

In file included from c:\hellow~1\hellow~1.cpp:1:
C:\DEV-C_~1\Include\MPxCommand.h:62: maya\MStatus.h: No such file or directory
C:\DEV-C_~1\Include\MPxCommand.h:63: maya\MTypes.h: No such file or directory
C:\DEV-C_~1\Include\MPxCommand.h:64: maya\MString.h: No such file or directory
c:\hellow~1\hellow~1.cpp:2: MGlobal.h: No such file or directory
c:\hellow~1\hellow~1.cpp:3: MFnPlugin.h: No such file or directory

I’ve tried putting the header files in the Dev include dir and also copied the includes to my root hdd and pointing to them, like so;

#include “C:\maya\MPxCommand”
#include <C:\maya\MPxCommand> and so on…

I can’t afford Visual C++, which is what the maya documentation recommends. I’m sure there is a solution to using Dev C++, but I just don’t know enough about my compiler, and I can’t find how to point to the directives in the docs.

I hope someone can help

Cheers


#2

Hi,
I went through the toolkit compiler help and figured out how to compile a dll. So I went about setting my Maya path, header and library variables:


Set PATH=C:\Program Files\Alias\Maya6.0\bin;%PATH%
Set INCLUDE=C:\Program Files\Alias\Maya6.0\include;%INCLUDE%
Set LIB=C:\Program Files\Alias\Maya6.0\lib;%LIB%

Then I compiled the hello world source code from the api guide in the Maya docs:


#include <maya/MSimple>
DeclareSimpleCommand( helloWorld, "Alias", "6.0");
MStatus helloWorld::doIt( const MArgList& )
{
    printf("Hello World
");
    return MS::kSuccess;
};

And I get the following errors:


C:\helloWorld>cl /LD helloworld.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

helloworld.cpp
helloWorld.cpp(1) : fatal error C1083: Cannot open include file: 'maya/MSimple':
 No such file or directory

I hope someone can help me figure out this problem!!!
It’s driving me nuts!
Cheers :slight_smile:

OH, visual c++ is the free toolkit version which can be downloaded from the microsoft site !!!


#3

This may help.

Also, should it be in the form:

#include <maya/MSimple.h>
As of Maya 5.0 the dev kit assumed the VS version was 6. I’m not sure if they changed that for Maya 6.


#4

hi mummey,
yeah i did compile it as both
#include <maya/MSimple>

and

#include <maya/MSimple.h>

but still doesnt work. Seems i have to instal the SDK and other fixes???
I dunno really :frowning:
and, i am compiling for maya 6.0
that shouldnt matter since visual toolkit 2003 is version 7.1 am i right???
anyway, thanks for hte reply :slight_smile:


#5

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.