Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: andrew_o on August 26, 2011, 01:31:46 am

Title: Maya Plug-in Dev on win 64 machine
Post by: andrew_o on August 26, 2011, 01:31:46 am

Hi,

I'm trying to set up Codeblocks as an alternate to MVS for Maya Plug-in Development on Windows.  This requires a 64 bit complier and linker, which I have( minGW64 ).  I'm have trouble finding out what setting I need to be using and wondering if i got it right.  I looked on the forum, the wiki, and the internet in general.  It seems that it is possible, but nobody has explained how in any great detail.  I'm new to Code Blocks IDE, so I'll need a precise and complete set of instructions. 

I have added the Maya include directory in the Globals Compiler Settings, and that seems to be working fine.  I've also set the Compiler's Installation directory to point 64bit compiler, ( in my case, C:/MinGW64 ).  I'm not certain that working or if that everything I need to do.

When I compile the basic helloworld Plugin, I get a fatal error because it can't find <crtassem.h>

My first thought here is that I'm compiling 32 bit mode because the error occurs after what I think is a 32 bit dirrective.
Code snippet where error occurs follows: ( error colored red)

#ifdef _WIN32
#if _MSC_VER < 1500
   // When  external code is compiling, MLIBRARY_DONTUSE_MFC_MANIFEST
   // will not be defined.  This will force the manifest on
   // x86 and amd64 to mfc80.dll.  We do not force the manifest
   // to mfc80d.dll for a Debug build since a released version of
   //  Maya does not use Debug libraries.
   #if !defined(MLIBRARY_DONTUSE_MFC_MANIFEST)
      #include <crtassem.h>

I'm not certain if this error is because CodeBlocks is configured incorrectly or if it's something else.  Any help would be welcome.
Title: Re: Maya Plug-in Dev on win 64 machine
Post by: killerbot on August 26, 2011, 07:36:00 am
I allready see 2 issues :

* it seems a WIN32 directive is defined (who did this) [check which defines the ming64 sets]
* second ensure it can be compiled with ming, since the next thing visible is MSVC directives
* question : which source file contained the snippet ?
Title: Re: Maya Plug-in Dev on win 64 machine
Post by: andrew_o on August 26, 2011, 08:58:15 am

Thanks for your Response.  I thought it was a WIN32 directive, but I didn't know what to do about it.  I'm pretty new to C++, and didn't know if the directive could be nullified or erased without affecting some other part of the code. The snippet comes from MLibrary.h which is part of the include Dir in the Maya 64 bit install.  The helloworld.cpp is part of their devkit samples.  I'm not sure I can 'ensure' it can be compiled with ming, beyond what I've already done.  I would need to know more info before I could do that.  However, it was my hope to try to use ming over MVS.  I will see if I can find some more info on compiling 64 bit plug-ins.
Title: Re: Maya Plug-in Dev on win 64 machine
Post by: oBFusCATed on August 26, 2011, 09:38:15 am
andrew_o:
Check the help of Maya for the required compiler and install and use only this compiler (express editions works perfectly).
If you don't use the correct compiler you'll have many issues - no loading plugin, strange crashes, etc.

C::B supports compilation with Visual C++, so you'll be able to compile the plugin, the debugging will be tougher unfortunately.
If you want to use GCC install linux (the correct compiler still matters!) and develop your plugin there.
Title: Re: Maya Plug-in Dev on win 64 machine
Post by: andrew_o on August 26, 2011, 05:47:17 pm

Thanks for the response.  I suspected that Visual Studio might be required for a windows build in regards to Maya.  I was just hoping it were possible.  I'll give it a try on the MVS side, but expect to still use C::B for other projects - Those that involve Qt for example.  It's really a great IDE.
Title: Re: Maya Plug-in Dev on win 64 machine
Post by: oBFusCATed on August 26, 2011, 06:05:11 pm
andrew_o: As I've said you can use Visual C++ (the compiler) with C::B, no problem.
Title: Re: Maya Plug-in Dev on win 64 machine
Post by: andrew_o on August 26, 2011, 06:21:33 pm
That sounds great.  What about compiler settings?  Where can I find info on what needs to be set for a 64 bit build?