[PD] Can't use standard C libraries on external compilation for windows using MINGW

Hans-Christoph Steiner hans at eds.org
Mon Jul 16 22:08:57 CEST 2007


If your MinGW DLLs are not in a standard UNIX path, then you'll need  
to add a -L/path/to/lib to your linking statement.  Also, you'll be  
better off using gcc rather than ld for linking.  gcc knows all the  
apps to call to link things.

If you follow these directions, then the MinGW libs will be located  
in /usr/local/lib, which is a standard UNIX path, then no special cmd  
line options are needed:

http://puredata.org/docs/developer/mingw



.hc

On Jul 14, 2007, at 1:37 PM, Isidro Gonzalez wrote:

>
> Hello:
> I followed Alberto Zin's instructions for compiling pd
> externals using Mingw and they worked OK.
> But:
> I modified de hello.c code adding the opening and
> closing of a file. Of course, the <stdio.h> header
> file must be added to the code.
> Attached to this message is the modified "hello.c".
> The code compiles Ok, and I get the hello.o using the
> following command line:
>
> C:\pd\isidro\hello>gcc -c hello.c -o hello.o
>
> But when I try to link to get the Dll file, I get the
> following message:
>
> C:\pd\isidro\hello>ld -export_dynamic -shared -o
> hello.dll hello.o c:/pd/bin/pd.dll
>
> hello.o(.text+0x16):hello.c: undefined reference to
> `fopen'
> hello.o(.text+0x30):hello.c: undefined reference to
> `fclose'
>
> The same I get if I use some Standard Library Function
> like <string.h> or other...
> Maybe I am doing something really stupid but if you
> know what's up it will save lots of time to me...
> Many thanks
> Isi
>
>
>
>
> ______________________________________________________________________ 
> ______________
> Get the free Yahoo! toolbar and rest assured with the added  
> security of spyware protection.
> http://new.toolbar.yahoo.com/toolbar/features/norton/ 
> index.php#include "m_pd.h"
> #include <stdio.h>
>
> static t_class *hello_class;
>
> typedef struct _hello{
>   t_object  x_obj;
> } t_hello;
>
> void hello_bang(t_hello *x)
> {
>   FILE *fil;
>
>   fil=fopen("any","rb");
>   post("File any opened");
>   fclose(fil);
> }
>
> void *hello_new(void)
> {
>   t_hello *x = (t_hello *)pd_new(hello_class);
>
>   return (void *)x;
> }
>
> void hello_setup(void) {
>   hello_class = class_new(gensym("hello"),
>         (t_newmethod)hello_new,
>         0, sizeof(t_hello),
>         CLASS_DEFAULT, 0);
>   class_addbang(hello_class, hello_bang);
> }
>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/ 
> listinfo/pd-list



------------------------------------------------------------------------ 
----

The arc of history bends towards justice.     - Dr. Martin Luther  
King, Jr.






More information about the Pd-list mailing list