View Full Version : compiling maya plugin in eclipse?
03 March 2011, 06:24 AM
Hi, i'd like to use the eclipse IDE to develop my plugins and compile for Maya. There is no plugin wizard to get the environment setup. What environment variables do I need to set to get this to work? Has anyone done this before?
03 March 2011, 02:56 PM
I think it is not possible to compile Maya C++ Plugins with Eclipse. The reason behind this, is that you will need a Microsoft C++ Compiler to get this. The CDT Eclipse Plugin doesn't not support a working Microsoft Visual Studio toolchain, it uses open C++ compiler (eg. MinGW ) instead. There are several projects to get Microsoft compiler in Eclipse to work, but as far as I know far away from a working solution.
I don't know, if there is an "under the hood" solution, but if, I would strongly interested in. ;)
You can use Eclipse for MEL and Python (API) development. This works fine.
There are some free Microsoft Visual Studio Editions (Express), as an alternative to expensive Microsoft compiler. I think you can use these with Maya API without difficulty. Microsoft bring their own IDE with the free VS Edition, but you can use Codeblocks alternatively.
03 March 2011, 03:19 PM
Thanks ThePistolPete. Have you used Codeblocks? If it works with that application, I don't see why eclipse can't be used either as an alternative to compiling plugins. Im on a mac and have XCode, but would prefer to work in an enviroment that is cross platform. I can install eclipse on both windows and mac environments, and its free.
If all is needed is to configure the compiler in a way to find the include files and add certain flags, I don't see why this won't work. Unfortunately, I have had a hard time trying to find what needs to be configured since all the talk is about "use the plugin wizard" for visual studios or use XCode. I'd like to know what is happening under the hood. I know its not magic! :)
03 March 2011, 04:18 PM
Yes, I have used Codeblocks to compile Maya Plugins successfully . The difference between Codeblocks and Eclipse is, that Codeblocks is supporting a lot of different compiler, what CDT for Ecpilse doesn't. You can setup Codeblocks using Microsoft Compiler very easily.
On Windows I had no success the get another compiler beside Microsoft VC working. The problem is not just finding the right includes and libs, the problem is that the Maya API (on Windows) will need additional includes and libs, which are provided by Microsoft. Other packaged like MinGW does prividing some, I think not all, of these libs and includes too, but it seems to be not compatible with the Maya API.
I searched the web and asking some developers, but everybody is referencing to Visual Studio and the plugin wizard. Does any of this look familiar to you? ;) Yes, I also want to know how things working under the hood, so I decided and like to use "outsider solutions". ;) Now I am working with the free VS Edition within Codeblocks, it also supports 64Bit compiling. This works very well, on simple projects at the moment.
I would prefer coding with Ecplise too, because I like to use the same IDE for MEL, Python and C++. I hope CDT will become more flexible in the future.
I have no idea to get this on Mac working, I am not a Mac user, sorry.
Is CDT using the same compiler like XCode? I think CDT is just supporting the MacOSX GCC, does XCode also using gcc for Mac? Is this compiler compatible to Maya's API? Did you setup the MacOS toolchain in the toolchain editor of CDT?
After recognising that CDT isn't really usable with Microsoft VS, I didn't spend a lot of time with C++ Development in Eclipse, so I am not very familar with CDT itself. But I will have a look at CDT later this day ... perhaps I will find any idea.
03 March 2011, 04:30 PM
I posted the list of compile/link params a while back in this thread:
This was for Maya 2009, but I'm fairly certain it's the same apart from specifying the respective Maya directories and VC compiler directories to your Maya version. I'm not familiar with the Eclipse IDE, so I can't comment on that stuff.
Hope this helps.
04 April 2011, 06:48 PM
I ran across a post somewhere that Xcode and Eclipse will run the same compiler on OSX. If this is the case, there should be no reason why you can't get it to work in Eclipse. I tried it out and included all the proper libraries in eclipse and am compiling against gcc 4.0.0 but am still running into problems.
/Applications/Autodesk/maya2011/devkit/include/maya/MTypes.h:235: error: redeclaration of C++ built-in type ‘bool’
/Applications/Autodesk/maya2011/devkit/include/maya/MTypes.h:239: error: expected identifier before ‘false’
/Applications/Autodesk/maya2011/devkit/include/maya/MTypes.h:239: error: expected `}’ before ‘false’
/Applications/Autodesk/maya2011/devkit/include/maya/MTypes.h:239: error: expected unqualified-id before ‘false’
/Applications/Autodesk/maya2011/devkit/include/maya/MTypes.h:239: error: expected declaration before ‘}’ token
Has anyone tried this as well?
04 April 2011, 09:01 PM
I've read that Maya for MacOS was compiled with gcc, it should work with Eclipse on Mac.
Maybe gcc 4.0.0 is the wrong version. Maya 8.5 for Mac was compiled with gcc 4.0.2 (can be found in the docs), I think Maya 2011 was compiled with a newer version. On Linux it is gcc version 4.1.2, but i can not find any information what gcc version was used for Maya 2011 for MacOS, just Xcode 3.1.2!
04 April 2011, 09:01 PM
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.