Skip to main content
GameDev.net gamedev.net
🔒 Locked

Compiling Maya4.0 plugin w/ gnu

Started by sad_dc Apr 8, 2005 at 9:01 AM 4 replies 1.2k views
Original Post
sad_dc
sad_dc
Hi, I am trying to compile a plugin for Maya 4.0 with the gnu compiler, but the compiler spits out a bunch of errors about the Maya API itself. Since Maya 4.0 is an older version, and I'm using gnu-3.3.3, is it possible that I need an older gnu compiler? Or is this compiler fine, and I'm doing something else wrong? Thanks.
darklordsatan
darklordsatan
When you say with the GNU compiler, are you doing your own makefile or simply passing arguments on the command-line to gcc???
It would be useful if you showed your full compile log to see what those errors are...
sad_dc
sad_dc
Sure. The arguments I'm giving it I'm getting from this Maya tutorial I have. Here's what the compiler is complaining about:

$ cc -c -I /cygdrive/c/AW/Maya4.0/include -o helloWorld.o helloWorld.cpp
In file included from helloWorld.cpp:1:
/cygdrive/c/AW/Maya4.0/include/maya/MSimple.h:2:9: warning: #pragma once is obso
lete
In file included from /cygdrive/c/AW/Maya4.0/include/maya/MSimple.h:33,
from helloWorld.cpp:1:
/cygdrive/c/AW/Maya4.0/include/maya/MString.h:2:9: warning: #pragma once is obso
lete
In file included from /cygdrive/c/AW/Maya4.0/include/maya/MString.h:40,
from /cygdrive/c/AW/Maya4.0/include/maya/MSimple.h:33,
from helloWorld.cpp:1:
/cygdrive/c/AW/Maya4.0/include/maya/MTypes.h:2:9: warning: #pragma once is obsol
ete
In file included from /cygdrive/c/AW/Maya4.0/include/maya/MString.h:40,
from /cygdrive/c/AW/Maya4.0/include/maya/MSimple.h:33,
from helloWorld.cpp:1:
/cygdrive/c/AW/Maya4.0/include/maya/MTypes.h:208: error: redeclaration of C++
built-in type bool'
/cygdrive/c/AW/Maya4.0/include/maya/MTypes.h:212: error: parse error before

false'
/cygdrive/c/AW/Maya4.0/include/maya/MTypes.h:235: error: parse error before `:'

And this goes on for all of the Maya header files used. Any help would be appreciated.
darklordsatan
darklordsatan
Well, I might be wrong, but the pragma directive is likely vc-only. And the redeclaration of bool its complaining about... well
Likely, Ive had problems like these before with other sources, what I do is go to the files having the problems, and try to fix em myself, i.e replacing problems with linux-like solutions, and in most cases it aint that hard.
Hopefuly someone will come up with a professional solution :)

Good luck anyway dude

/edit
Maybe passing the -D_BOOL option to gcc would help in the "redeclaration of C++
built-in type `bool'" ???

Maybe you could replace the pragma once directive by using #include and then #ifndef/#endif in the headers????

I dont know if it would solve some issues (pragma once), but try passing "-W -Wall -pedantic" in the compile line

[Edited by - darklordsatan on April 8, 2005 10:28:41 AM]
sad_dc
sad_dc
Excellent, that worked and I got it to compile, thanks a lot.

I got another problem though (I know, I suck). I have to link the Maya library using cygwin, but the Maya library consists of .lib files, and not .a files which I think cygwin uses. Is there a way to get around this?
darklordsatan
darklordsatan
As a personal matter of taste, I like using devcpp rather than cygwin.
I dont know for it, but at least for mingw (bundled in devcpp) you can use plain .lib files and not need to use .a, however, theres a tool for converting from .lib to .a, dont recall the name rite now (maybe libtool - not sure)
Try to simply link the lib files and then see if an error arises. But seriously, devcpp is cool...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.