30th May 2006, 09:02 PM | #1 |
Member
Advanced member
Join Date: May 2006
Posts: 36
|
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 |
31st May 2006, 12:09 PM | #2 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,565
|
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. |
5th June 2006, 10:00 PM | #3 |
Member
Advanced member
Join Date: May 2006
Posts: 36
|
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 |
12th June 2006, 07:37 PM | #4 |
Member
Advanced member
Join Date: May 2006
Posts: 36
|
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/. Last edited by conzar; 12th June 2006 at 08:19 PM. |
12th June 2006, 07:57 PM | #5 |
Member
Advanced member
Join Date: May 2006
Posts: 36
|
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/ |
|
|