PDA

View Full Version : Compiling Plugings for Mac



AntonyScerri
02-24-2006, 07:12 AM
Hi

I just posted on the LW - Mac discussion group about the same topic, but thought i would put it in here too. My previous post is below. I have since been told that the only ways to compile the plugin would either be with Code Warrior (which im not about to buy just to compile this plugin, sorry to all those that want my plugin), or MPW which is now defunct, and been superseeded by two different tool sets from Apple now. So if anyone has any further info please let me know, as currently im going to try getting MPW to work.

Thanks

Tony

============PREVIOUS POST=================

Hi

Im trying to get a version of my UVImaginator plugin out for the Mac. I have finally got some access to a Mac with Mac OS X 10.2.8 but im not sure what i can use to compile it with. I installed the Developers Tools which has gcc 3.1 but im struggling to work out if i can compile my plugin using that or not. I have read something about the binary format being different. Also the SDK docs say to build a shared library but with gcc 3.1 it doesnt support the -shared flag. I dont know if i can use MPW on this version of Mac OS X. Not knowing Macs very well im running round in circles trying to work out exactly what kind of library i need to build for LW. Also what different settings are needed for OS 9 and OS X versions of my plugin.

Can anyone help?

Thanks

Tony

ercaxus
02-24-2006, 01:21 PM
Apple says they use it,
http://developer.apple.com/tools/gcc_overview.html
good luck.

AntonyScerri
02-25-2006, 04:55 AM
Well I got MPW installed and finally worked out why it wouldnt create the makefile. It was an issue with running it within Classic under Mac OS X. All the files i had copied onto the Mac didnt have any creator/type info as Mac OS X doesnt use it, but classic needs it to work out what kind of file it is dealing with. So i had to modify all the file types, which took a while, but im very close to building the plugin.

Tony

ercaxus
02-26-2006, 12:03 AM
I hope it all goes well. You should also try a linux/gcc based community when you have gcc related questions. You will get more useful answers from people who know it very well, not dumb sleepless people like me :)
Good luck :D

AntonyScerri
02-26-2006, 04:31 PM
Yeah I gave up on gcc because it will not compile the correct binary format from what i have read. I have now managed to build something, and have given it to someone with Lightwave on a Mac to try. Took a lot of fiddling around with MPW to compile it in the end, but finally got there. Having come from a windows background, with unix experience i have to say that programming on the mac has to be the most complicated, confusing, and unfriendly environment i have had to deal with. I would really like to see how easy it would have been using XCode and will probably have to go through that when LW is compiled against it as well.

Fingers crossed the thing i have compiled is the right binary format, the right object type and anything else that might be wrong.

One thing someone on here might be able to clear up for me. Is there any difference in compiling a plugin for Mac OS X and Mac OS 9? Do i need to build it for Mac OS 9 still? I ask because from my basic understanding i have noted that file paths have changed between classic and X, from HFS(?) to Unix style. So im not sure whether i need to compile one for each using a different path separator or not.

Thanks again

Tony

AntonyScerri
02-27-2006, 03:56 AM
Right I managed to build my plugin using MPW as per instructions with the SDK. However it will not work, Lightwave says 'Could not load external plugin file [file location]', followed by '0 plugins found in 1 file.'.

Anyone out there able to suggest what the cause of this might be, and what steps i could try to take to fix it.

Thanks

Tony

AntonyScerri
02-27-2006, 10:04 AM
To update on my last post, i have switched to using the Carbon libraries as per some instructions posted a long time ago but still no luck.

T

LSlugger
02-28-2006, 12:06 AM
Right I managed to build my plugin using MPW as per instructions with the SDK. However it will not work, Lightwave says 'Could not load external plugin file [file location]', followed by '0 plugins found in 1 file.'.

I played around with plugins in MPW a while back, and I remember seeing that error message more than once. I believe my particular problem had to do with not exporting _mod_descrip properly. Sorry I can't be more specific--I can't find my notes, and I haven't got Classic installed anymore, let alone MPW.

AntonyScerri
02-28-2006, 05:26 AM
Thanks for that, but i definitely have exported that one :)

We managed to get a version that can be detected as a plugin now, but when you try to use it you get the message :

Custom Operation Failed
Plugin UVImaginator.p will not operate in this application

Hopefully once i work this out and get a working version I should be able to write up the tutorial on how this can actually be done using MPW. The stage im at now doesnt take a lot to do, in fact its simply selecting a few more options and thats it. It could be a problem with SDK versioning now, although on Windows i can run my 6.5b compiled plugin on LW 6.x, 7.x and 8.x so i kind of thought it should be the same deal on the Mac. The only other cause is something within my code which isnt behaving properly on the Mac. I have tried getting it to write to a file as it goes along but that apparently causes LW to crash out now, but that may be because im trying to open the file with the wrong path or something. This isnt helped by the fact i cannot run LW on the Mac i use to develop on so im rely on two very helpful people at the moment to test it.

Anyone at Newtek care to comment, or provide some form of test harness to check plugins out,at least as far as loading them on a Mac?

Thanks

Tony