View Full Version : Maya 5.0 C++ API and Visual Studio .Net 2003
mummey 09-13-2004, 06:41 PM Hello all,
I am trying out the Maya 5.0 C++ API and I need to know how to set it up to work with Visual Studio .Net 2003. I can't find too many sources on this. Any suggestions?
Thank you,
-b
|
|
I think you will need to compile the plugin wizard to work with visual studio .net. As far as I know the wizard as it ships only works with visual c++ 6.0
Robert Bateman
09-13-2004, 09:23 PM
Create a Win32 Application, choose Dynamic Link Library.
Make sure you add the Maya directories into Visual C++. From the main menu....
Tools->Options->Projects->VC++ Directories
add a line for both the include and lib directories of maya (make sure "show directories for" is set to includes and libs respectively when you do this)
In the project settings for your plugin,
1. C/C++ -> Code Generation -> Runtime Library
set this to Multi Threaded, or Multi-Threaded debug (you may get STL linker errors if you leave this on single threaded)
2. Linker->General -> OutputFile
change the extenson to mll (plugin is just a Win32 dll with a different extension)
3. linker->Command Line
add \export:initializePlugin \export:uninitializePlugin
or add __declspec(dllexport) before your initialize/uninitialize plugin function definitions, ie :
__declspec(dllexport) MStatus initializePlugin( MObject obj ) {
// func
}
4. C/C++ -> Preprocessor -> Preprocessor Definitions
add NT_PLUGIN; to the end of the value
Compile and it should work.
nurcc
09-14-2004, 12:47 AM
One other thing that I'd suggest about using Maya 5 with MSVC 7.1 (2003) is that in 7.1 they got rid of the old iostream library. This can be a bit of a problem, because Maya is compiled with the old iostream by default. This problem doesn't manifest itself unless you are trying to use an iostream given to you from the Maya API - such as in the MPxData save functions. If you try to use it, you'll segfault/throw an exception.
I've got a workaround, if you'd like me to post it..
Basically you define REQUIRE_IOSTREAM and then I have a library that does conversions between strings and the old iostream.
mummey
09-14-2004, 11:39 AM
Yes, I noticed that one too. In 7.1 Microsoft finally got the STL right... ;)
Thank you for the information. I'm surprised it hasn't come up more in this forum.
-b
CGTalk Moderation
01-19-2006, 05:00 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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.