anafar

Hi,

I've installed VC++ express and Platform SDK for XP SP2.

I'm trying to compile a helloWorld plugin by using MayaPlugInWizard (that already seems to be set fine), but it give me an error:

1>------ Build started: Project: HelloWorld, Configuration: Debug Win32 ------

1>Compiling...

1>cl : Command line warning D9025 : overriding '/EHs' with '/EHa'

1>helloWorldCmd.cpp

1>c:\documents and settings\administrator\my documents\maya plugins\helloworld\helloworld\helloworldcmd.cpp : error C4335: Mac file format detected: please convert the source file to either DOS or UNIX format

1>c:\documents and settings\administrator\my documents\maya plugins\helloworld\helloworld\helloworldcmd.cpp(1) : warning C4067: unexpected tokens following preprocessor directive - expected a newline

1>c:\program files\autodesk\maya8.5\include\maya\mtypes.h(138) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory

1>Build log was saved at "file://c:\Documents and Settings\Administrator\My Documents\Maya Plugins\HelloWorld\HelloWorld\Debug\BuildLog.htm"

1>HelloWorld - 2 error(s), 2 warning(s)

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Does any body faced this problem..



Re: Visual C++ Express Edition Compiling Maya Plugins error

crescens2k

Well, the first problem is caused by the line endings, you can use advanced save options to change this. It is File->Advanced Save Options and change the line endings to either Windows (CR LF) or Unix (LF).

The second problem, have you installed the Windows Platform SDK and registered it with the IDE. Since it is not finding windows.h then it tells me you haven't done this.






Re: Visual C++ Express Edition Compiling Maya Plugins error

anafar

Thanks crescens2k

This helps...

Now i can build the plugin, with just one issue......when i use the following code ( that mentioned in Maya API help ) i got an error:

#include <maya/MSimple.h>

#include <maya/MIOStream.h>

DeclareSimpleCommand( helloWorld, "Autodesk", "8.5");

MStatus helloWorld:: doIt( const MArgList& )

{

cout << "Hello World\n" << endl;

return MS::kSuccess;

}

But when i use this code it works perfectly with maya..without any error:

#include <maya/MSimple.h>

DeclareSimpleCommand( helloWorld, "Autodesk", "8.5");

MStatus helloWorld:: doIt( const MArgList& args )

{

MStatus stat = MS::kSuccess;

setResult( "helloWorld command executed!\n" );

return stat;

}

I didn't understand the diffrence..





Re: Visual C++ Express Edition Compiling Maya Plugins error

Bite Qiu - MSFT

anafar wrote:

Now i can build the plugin, with just one issue......when i use the following code ( that mentioned in Maya API help ) i got an error:

you need to show us the error messages so that we can help.