<br><br><br><div class="gmail_quote">On Thu, Jul 14, 2011 at 7:02 PM, Hans-Christoph Steiner <span dir="ltr">&lt;<a href="mailto:hans@at.or.at">hans@at.or.at</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5"><br>
On Thu, 14 Jul 2011 12:44 -0400, &quot;Mathieu Bouchard&quot; &lt;<a href="mailto:matju@artengine.ca">matju@artengine.ca</a>&gt;<br>
wrote:<br>
&gt; On Thu, 14 Jul 2011, luca paganotti wrote:<br>
&gt;<br>
&gt; &gt; but ... I get &#39;undefined reference&#39; (s) for all the pd symbols that are<br>
&gt; &gt; used by helloworld.c i.e. pd_new, gensym, class_new, class_addbang, post<br>
&gt;<br>
&gt; You need to use the -shared option to produce a .so or .DLL file.<br>
&gt;<br>
&gt; In addition, you need to link with PD.DLL (a Windows-only requirement...<br>
&gt; no such equivalent on other platforms).<br>
<br>
Hey Luca,<br>
<br>
</div></div>This is great, that you got this far!  Can you write up a wiki page in<br>
the dev section. Don&#39;t worry too much about formatting, mostly just get<br>
the info in there.<br>
<a href="http://puredata.info/docs/developer" target="_blank">http://puredata.info/docs/developer</a><br></blockquote><div><br>I think it&#39;s a very trivial thing for a wiki page, I mean is not such a great thing ....<br>
 </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
As for Makefiles, if you use the the Library Template, then the Makefile<br>
will work on MinGW, Cygwin, Mac OS X, GNU/Linux, Android, iOS, etc.<br>
<a href="http://puredata.info/docs/developer/LibraryTemplate" target="_blank">http://puredata.info/docs/developer/LibraryTemplate</a><br>
<font color="#888888"><br>
.hc<br></font></blockquote><div><br>ok, got the template from svn,<br><br>use it as it is trying to build a &#39;mycobject&#39; as defined by the code ...<br><br>getting these results in eclipse console:<br><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">**** Build of configuration Default for project mycobject ****</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">make all </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Building target: mycobject</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Invoking: MinGW C++ Linker</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">g++ -L&quot;C:\Programmi\pd\bin&quot; -o&quot;mycobject&quot;  ./mycobject.o   -l&quot;C:/Programmi/pd/bin/pd.lib&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lC:/Programmi/pd/bin/pd.lib</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">collect2: ld returned 1 exit status</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">make: *** [mycobject] Error 1</span><br><br>what I really do not understand is that I have my pd.lib file exactly in the folder were ld on bhalf eclipse searches for it, i.e. C:\Programmi\pd\bin\pd.lib<br>
<br>Anyway I then tryed the hard way from the mingw console issueing a &#39;make all&#39; getting finally a usefull error message:<br><br><span style="font-family: courier new,monospace;">Pag@XP-PAG /c/dev/c++/pd-externals/mycobject</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">$ make clean</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">sed: can&#39;t read mycobject-meta.pd: No such file or directory</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">sed: can&#39;t read mycobject-meta.pd: No such file or directory</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">sed: can&#39;t read mycobject-meta.pd: No such file or directory</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">sed: can&#39;t read mycobject-meta.pd: No such file or directory</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">sed: can&#39;t read mycobject-meta.pd: No such file or directory</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">rm -f -- mycobject.o</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">rm -f -- mycobject.dll</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">rm -f -- mycobject.o</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">rm -f -- mycobject.dll</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Pag@XP-PAG /c/dev/c++/pd-externals/mycobject</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">$ make all</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">sed: can&#39;t read mycobject-meta.pd: No such file or directory</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">sed: can&#39;t read mycobject-meta.pd: No such file or directory</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">sed: can&#39;t read mycobject-meta.pd: No such file or directory</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">sed: can&#39;t read mycobject-meta.pd: No such file or directory</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">sed: can&#39;t read mycobject-meta.pd: No such file or directory</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">sed: can&#39;t read mycobject-meta.pd: No such file or directory</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">cc -I&quot;/c/Programmi/pd/include/pd&quot; -Wall -W -g -DPD -DVERSION=&#39;&quot;&quot;&#39; -mms-bitfields</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> -O3 -funroll-loops -fomit-frame-pointer -o &quot;mycobject.o&quot; -c &quot;mycobject.c&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace; background-color: rgb(255, 255, 0);">/bin/sh: cc: command not found</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">make: *** [mycobject.o] Error 127</span><br>
<br><font face="arial,helvetica,sans-serif">perhaps does it means that the compiler command is not defined in the makefile?<br><br>I added this line <br><br><span style="font-family: courier new,monospace;">CC = gcc</span><br>
<br>between the <span style="font-family: courier new,monospace;">OS = windows</span> and <span style="font-family: courier new,monospace;">PD_PATH = $(shell cd &quot;$(PROGRAMFILES)&quot;/pd &amp;&amp; pwd) </span>lines<br>
</font><br>inside the <span style="font-family: courier new,monospace;">ifeq (MINGW,$(findstring MINGW,$(UNAME))) ... endif</span>  block   <br><br>and then got:<br><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Pag@XP-PAG /c/dev/c++/pd-externals/mycobject</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">$ make all</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">sed: can&#39;t read mycobject-meta.pd: No such file or directory</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">sed: can&#39;t read mycobject-meta.pd: No such file or directory</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">sed: can&#39;t read mycobject-meta.pd: No such file or directory</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">sed: can&#39;t read mycobject-meta.pd: No such file or directory</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">sed: can&#39;t read mycobject-meta.pd: No such file or directory</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">sed: can&#39;t read mycobject-meta.pd: No such file or directory</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">gcc -I&quot;/c/Programmi/pd/include/pd&quot; -Wall -W -g -DPD -DVERSION=&#39;&quot;&quot;&#39; -mms-bitfield</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">s -O3 -funroll-loops -fomit-frame-pointer -o &quot;mycobject.o&quot; -c &quot;mycobject.c&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">gcc  -s -shared -Wl,--enable-auto-import -o &quot;mycobject.dll&quot; &quot;mycobject.o&quot;   -L&quot;/</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">c/Programmi/pd/src/&quot; -L&quot;/c/Programmi/pd/bin/&quot; -lpd -lwsock32 -lkernel32 -luser32</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> -lgdi32</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">chmod a-x &quot;mycobject.dll&quot;</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Pag@XP-PAG /c/dev/c++/pd-externals/mycobject</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">$</span><br><br>I got the mycobject dll that runs fine under pd-extended on a windows box.<br><br>Still wondering why eclise doen&#39;t find my pd.lib<br><br>At least this is working now from the command line.<br>
<br><br><br><br><br><br><br><br><br><br> <br></div></div><br>