I'm having trouble getting the helloworld external to compile properly on Windows.
The main resource is apparently this: HOWTO write an External for puredata, and some previous posts on this topic are here: Compiling new external, Max/MSP microtuning externals to convert to pd
Bear with me, because working with the C compiler is still rather mysterious to me, so I may be making some obvious mistakes. I've installed the djgpp compiler, and followed all the instructions as best as I could. I'm working on XP. I put "m_pd.h" (from the pd/src/ folder) and "helloworld.c" in the same folder and from that directory on the command line (in a DOS "Command Prompt" window) typed:
gcc -c helloworld.c -o helloworld.o
As far as I can tell, this successfully produced the "helloworld.o" object file in the same directory as the "helloworld.c" file. Then I typed:
ld -export_dynamic -shared -o helloworld.dll helloworld.o -lc -lm
Which, as I understand, is the "linking" step, and the only difference between this command and the command for linux is that ".pd_linux" is replaced with ".dll". Anyway, the compiler responded with:
c:/progra~1/djgpp/bin/ld.exe: -shared not supported
So, not having any other ideas, I tried omitting the -shared flag:
ld -export_dynamic -o helloworld.dll helloworld.o -lc -lm
That produced this response:
c:/progra~1/djgpp/bin/ld.exe: warning: cannot find entry symbol xport_dynamic; defaulting to 000018d0
helloworld.o:helloworld.c:(.text+0x1e): undefined reference to `post'
helloworld.o:helloworld.c:(.text+0x37): undefined reference to `pd_new'
helloworld.o:helloworld.c:(.text+0x60): undefined reference to `gensym'
helloworld.o:helloworld.c:(.text+0x79): undefined reference to `class_new'
helloworld.o:helloworld.c:(.text+0x96): undefined reference to `class_addbang'
Why is -shared not supported and what can I do to fix that? I tried Microsoft Visual C++ Express Edition, but found the interface bewildering. I don't think I could even find the words "compile" and "link" in any menu...
Then I looked in the "0.README" file located in the pd/doc/6.externs/ directory, and found this line (in reference to the 3 example enternals in that folder):
To compile, type "make pd_linux", "nmake pd_nt", "make pd_irix5" or "make pd_irix6".
If I wanted to compile these, where would I even type this? Is "nmake" an actual command?
Then I tried poking around the GNU info files, and saw some vague information about "binutils" and "dlltool" but it is so beyond me right now that I'm turning here. Could someone please enumerate the steps required to take the C source file "helloworld.c" and make it into a usable object in pd without skipping any steps? I (and I'm sure many others) would greatly appreciate that.
Thanks in advance!