Go Back   AC3D Forums > Technical > AC3D Developers
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 30th May 2006, 09:02 PM   #1
conzar
Member
Advanced member
 
conzar's Avatar
 
Join Date: May 2006
Posts: 36
Default Developing a Exporter/Importer

Hello. So I am looking at the following code found in this post

http://www.ac3d.org/forum/viewtopic.php?t=1367

What I would like to know is what you need to do in order to provide the exporter/importer to ac3d.

Meaning, do I need to compile that code w/ gcc and link in some ac3d library?
Or is this a script that ac3d can suck in and interpret? If so, where do you put the script - plugin's directory doesn't seem to work w/ the code provided on the link.

Thanks
conzar is offline   Reply With Quote
Old 31st May 2006, 12:09 PM   #2
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,452
Default

If you are using gcc, I assume you are using Linux (or Mac?)

You don't need to compile it against a library but you will need the AC3D headers. If you don't have these, send your license key to me and I'll email a copy.

For linux, link it with 'ld -shared' and call it a <plugin-name>.p so that AC3D picks it up as a shared library.
Andy is offline   Reply With Quote
Old 5th June 2006, 10:00 PM   #3
conzar
Member
Advanced member
 
conzar's Avatar
 
Join Date: May 2006
Posts: 36
Default

Hey,
So I do need to compile that code though right? Seems that I get a compile error which is listed below.

Code:
gcc testplugin.c
testplugin.c: In function `sv_output_surfaces':
testplugin.c:88: error: 'for' loop initial declaration used outside C99 mode
Any thoughts on what that is?
conzar is offline   Reply With Quote
Old 12th June 2006, 07:37 PM   #4
conzar
Member
Advanced member
 
conzar's Avatar
 
Join Date: May 2006
Posts: 36
Default Re: Developing a Exporter/Importer

Ok. I finally got this working.

Your code is C++ not C. So gcc is no help here. You gotta use g++ in linux.
The compile error above is complaining about declaring a variable in a for loop. You can't do that in C --- I should have spotted that earlier.

So here are the steps to compile, link, and load a plugin for Linux.
prog = your program name
Also, make sure the header files are in the same directory as your source.

Code:
g++ -c  prog.c
ld -shared prog.o -o prog.p
cp prog.p <ac3d_home>/plugins/.
start up ac3d and your done.

Last edited by conzar; 12th June 2006 at 08:19 PM.
conzar is offline   Reply With Quote
Old 12th June 2006, 07:57 PM   #5
conzar
Member
Advanced member
 
conzar's Avatar
 
Join Date: May 2006
Posts: 36
Default Re: Developing a Exporter/Importer

Also note, doxygen is a handy tool to convert the header information to html --- makes life easier when looking up functions (its like javadoc). The comments in the header aren't exactly javadoc style so it doesn't produce the best of comments; never-the-less, its still usefull.

Check it out here.
http://www.stack.nl/~dimitri/doxygen/
conzar is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 04:28 AM.


AC3D Forum
(C) Inivis Limited 2020