Visual C++ 6.0 is the ticket IMHO
dont be silly, VC6 can’t compile maya6 plugins. vc6 is definately NOT the ticket. You could use the VC 2003 toolkit with the VC6 IDE, but, err… the vc6 IDE is nasty. I’m using the free VC2005 beta IDE, it’s a lot less bloaty than the full 2002 IDE, and with the 2003 compiler underneath it optimises things quite nicely…
Right then, to you lot who are moaning about STL being in-compatible with the maya API, you are all wrong (or doing something really wrong?). This occurs because you have compiled your plugin (or a lib it is using) with the single threaded runtime libs. Change all of them to multi-threaded and the linker problems go away. (do this in the project settings->C/C+±>Code Generation settings).
The older versions of maya used to use the old non-conformant <iostream.h> headers, but other than a few depreceated warnings this never caused me any problems (well, been using the API for 6 years and i’ve never had an STL problem? ).
you can use VisualC++ 2002, 2003 Toolkit, Visual C++ 2005 express beta, or codewarrior to compile maya plugins. The process is always the same, ensure they are compiled as a dll, change the output extension to mll, make sure you are using the multi-threaded libs, and ensure that you export the initializePlugin and uninitializePlugin methods (either put, __declspec(dllexport) infront of the funcs, or use the linker options /export:initializePlugin /export:uninitializePlugin.
Under linux, compile the plugins with the -shared flag, and output a .so file. that should be it…
Quote:
Originally Posted by Goon
And another question. I was looking through the Maya API docs last night, and one of the requirements for compiling is linking to the STL files, something that is apparently easy to do with the VC++ IDE, just drag and drop. But in the command line version of the compiler, no such option exists. Is there anyway to include these files, or am I just going to have to give up and spring the $$$ for VC++?
not necessary, you just have to find a free implementation of the STL. Link to it’s headers and library files as options for the compiler and you should be all set.
err? Visual C++ 2003 comes with the latest version of STL? I think your problem here has nothing to do with STL, what you basically seem to be asking is how to link and compile using the VC++ command line.
The answer is, not easily. Basically you have 2 options,
-
install cygwin and use make to call cl.exe (compiler) to compile each source file, and then use link.exe to link the plugins. (nmake is not included in VC 2003 toolkit)
-
Use visual C++ 2005 beta (free download) and download the microsoft Platform SDK, set the paths up to the VC++ compiler’s libs / includes and exe’s, and your away. Could even use the VC2005 compiler (it does the job - though you may still need the platform SDK for a few bits and bobs like OpenGL). I’m using the beta at the moment and it seems fine (one or two minor glitches in it, but they are only minor…)
The second thing to fix is that if you’re handed an iostream pointer, it’ll be an old (iostream.h) pointer, not a new (std::iostream) pointer. But your program will think it’s a new one, and will segfault when it tries to do anything with it. This only really happens when you’re saving something to a file or reading from a file, and the file handle is passed to you from maya. I’ve got a workaround for this, where the basic idea is to convert from old streams to new strings, and compile that as a library using a version of vc++ that has the old iostream.h. I’d post it now, but I don’t have it handy… let me know if you’re interested.
pardon? err, surely this can only occur if you do something like
using namespace std;
within your code to re-introduce the naming clashes that std:: was supposed to remove?. The answer might be, don’t remove the std:: ? I cannot honestly see any other reason why you are segmenting there? since the istream && std::istream classes are different, the compiler should prevent you doing this at compile time (well, it always has for me anyway…)