Hi all,
i'm beginning hacking pd externals, I'm trying to use Eclipse Helios (3.6) with
Build id: 201102110609 2. pd-extended 0.42.5 3. MingW installed using mingw-get so I think the last stable version (gnu make 3.82, gcc 4.2.5 etc ...)
So i made a simple c project in eclipse using the first tutorial files i found on the pd-extended source distribution (helloworld.c and the Makefile in the same folder)
I modified the Makefile to set the PDROOT path for my windows box, defined the targets clean, pd_nt in my eclipse project, setup the libraries, the include paths and the library path and I think i had done this coherently ...
but ... I get 'undefined reference' (s) for all the pd symbols that are used by helloworld.c i.e. pd_new, gensym, class_new, class_addbang, post
I really know that it should be a trivial path problem but I'm not able to understand my mistake so if anyone can drive me to correct it i will appreciate.
Thanks by now
P.S. please forgive my english
On Thu, 14 Jul 2011, luca paganotti wrote:
but ... I get 'undefined reference' (s) for all the pd symbols that are used by helloworld.c i.e. pd_new, gensym, class_new, class_addbang, post
You need to use the -shared option to produce a .so or .DLL file.
In addition, you need to link with PD.DLL (a Windows-only requirement... no such equivalent on other platforms).
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
On Thu, 14 Jul 2011 12:44 -0400, "Mathieu Bouchard" matju@artengine.ca wrote:
On Thu, 14 Jul 2011, luca paganotti wrote:
but ... I get 'undefined reference' (s) for all the pd symbols that are used by helloworld.c i.e. pd_new, gensym, class_new, class_addbang, post
You need to use the -shared option to produce a .so or .DLL file.
In addition, you need to link with PD.DLL (a Windows-only requirement... no such equivalent on other platforms).
Hey Luca,
This is great, that you got this far! Can you write up a wiki page
If you use the
Hi Hans,
I can read only part of your answer. I can read till you say:
...
If you use the
and then no more
Anyway I must say that I've no problem with the same example under a linux box running fedora 14.
Hi Mathieu,
thank you for the prompt answer, here it is the portion of my makefile that governs the windows build:
# ----------------------- NT ----------------------- pd_nt: $(TARGETS)
MINGWCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer
-Wall -W -Wshadow -Wstrict-prototypes -Werror
-Wno-unused -Wno-parentheses -Wno-switch -mms-bitfields
MINGWLDFLAGS = -shared -lm -lkernel32 -lcoldname -lcrtdll -L$(PDLIBDIR) -lpd
MINGWINCLUDE = -I$(PDSRCDIR)
CC = mingw32-gcc.exe
%.pd_nt: %.c $(CC) $(MINGWLDFLAGS) $(MINGWCFLAGS) $(MINGWINCLUDE) -o $*.dll $*.c
and these are the command lines eclipse issues:
mingw32-make pd_nt mingw32-gcc.exe -shared -lm -lkernel32 -lcoldname -lcrtdll -Lc:/Programmi/pd/bin -lpd -DPD -O2 -funroll-loops -fomit-frame-pointer -Wall -W -Wshadow -Wstrict-prototypes -Werror -Wno-unused -Wno-parentheses -Wno-switch -mms-bitfields -Ic:/Programmi/pd/src -o helloworld.dll helloworld.c
so I'm using the -shared linker option and -lpd dowsn't mean that I'm linking against the pd dll?
On Thu, 14 Jul 2011, luca paganotti wrote:
mingw32-make pd_nt mingw32-gcc.exe -shared -lm -lkernel32 -lcoldname -lcrtdll -Lc:/Programmi/pd/bin -lpd -DPD -O2 -funroll-loops -fomit-frame-pointer -Wall -W -Wshadow -Wstrict-prototypes -Werror -Wno-unused -Wno-parentheses -Wno-switch -mms-bitfields -Ic:/Programmi/pd/src -o helloworld.dll helloworld.c
so I'm using the -shared linker option and -lpd dowsn't mean that I'm linking against the pd dll?
Well, yes you are, but there's something else that I don't know about, probably about the visibility of the names you are supposed to get from PD.DLL ...
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
On 2011-07-14 13:15, Mathieu Bouchard wrote:
On Thu, 14 Jul 2011, luca paganotti wrote:
mingw32-make pd_nt mingw32-gcc.exe -shared -lm -lkernel32 -lcoldname -lcrtdll -Lc:/Programmi/pd/bin -lpd -DPD -O2 -funroll-loops -fomit-frame-pointer -Wall -W -Wshadow -Wstrict-prototypes -Werror -Wno-unused -Wno-parentheses -Wno-switch -mms-bitfields -Ic:/Programmi/pd/src -o helloworld.dll helloworld.c
so I'm using the -shared linker option and -lpd dowsn't mean that I'm linking against the pd dll?
Well, yes you are, but there's something else that I don't know about, probably about the visibility of the names you are supposed to get from PD.DLL ...
Maybe adding "-Wl,--enable-auto-import" to LDFLAGS is necessary as well. It's in the template makefile. See auto-import here:
http://gnuwin32.sourceforge.net/compile.html
It should be possible to import from either pd.lib or pd.dll. On MSVC you need the pd.lib.
Also add -L"path/to/pdlib" to LIBS.
Martin
On Thu, 14 Jul 2011 15:44 -0400, "Martin Peach" martin.peach@sympatico.ca wrote:
On 2011-07-14 13:15, Mathieu Bouchard wrote:
On Thu, 14 Jul 2011, luca paganotti wrote:
mingw32-make pd_nt mingw32-gcc.exe -shared -lm -lkernel32 -lcoldname -lcrtdll -Lc:/Programmi/pd/bin -lpd -DPD -O2 -funroll-loops -fomit-frame-pointer -Wall -W -Wshadow -Wstrict-prototypes -Werror -Wno-unused -Wno-parentheses -Wno-switch -mms-bitfields -Ic:/Programmi/pd/src -o helloworld.dll helloworld.c
so I'm using the -shared linker option and -lpd dowsn't mean that I'm linking against the pd dll?
Well, yes you are, but there's something else that I don't know about, probably about the visibility of the names you are supposed to get from PD.DLL ...
Maybe adding "-Wl,--enable-auto-import" to LDFLAGS is necessary as well. It's in the template makefile. See auto-import here:
http://gnuwin32.sourceforge.net/compile.html
It should be possible to import from either pd.lib or pd.dll. On MSVC you need the pd.lib.
Also add -L"path/to/pdlib" to LIBS.
Except for CC=gcc, the current template Makefile is used directly to build the libraries included in Pd-extended. So as far as I know, as long as the right files are in place, then the template file should 'just work' on MinGW.
I supposed we should add CC=gcc in the MinGW config section of the template Makefile.
.hc
Hi,
Sorry to drift the topic slightly... but I guess it might be of interest: when having to compile a 1-source-file external in windows I successfully managed with Codeblocks IDE and MinGW. If anyone is interested I have an example 'project' somewhere.
Lorenzo.
luca paganotti wrote:
Hi all,
i'm beginning hacking pd externals, I'm trying to use Eclipse Helios (3.6) with
- CDT Version: 7.0.2.201102110609 Build id: 201102110609
- pd-extended 0.42.5
- MingW installed using mingw-get so I think the last stable version (gnu make 3.82, gcc 4.2.5 etc ...)
So i made a simple c project in eclipse using the first tutorial files i found on the pd-extended source distribution (helloworld.c and the Makefile in the same folder)
I modified the Makefile to set the PDROOT path for my windows box, defined the targets clean, pd_nt in my eclipse project, setup the libraries, the include paths and the library path and I think i had done this coherently ...
but ... I get 'undefined reference' (s) for all the pd symbols that are used by helloworld.c i.e. pd_new, gensym, class_new, class_addbang, post
I really know that it should be a trivial path problem but I'm not able to understand my mistake so if anyone can drive me to correct it i will appreciate.
Thanks by now
P.S. please forgive my english
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hey Lorenzo,
It would be great to have your codeblocks setup as part of the
standard template. I've never used Codeblocks, so I don't know
anything about it. Does it use a simple file that can be checked into
SVN? Does it use the Makefile or have its own build system?
FYI, the template also handles one-source-file externals, and wraps
all the needed files (binary, source file, help file, meta file) into
a single easy-to-manage folder. For examples, check out bassemu~,
plugin~, freeverb~.
.hc
On Jul 15, 2011, at 3:21 AM, Lorenzo Sutton wrote:
Hi,
Sorry to drift the topic slightly... but I guess it might be of interest: when having to compile a 1-source-file external in windows I successfully managed with Codeblocks IDE and MinGW. If anyone is interested I have an example 'project' somewhere.
Lorenzo.
luca paganotti wrote:
Hi all,
i'm beginning hacking pd externals, I'm trying to use Eclipse Helios (3.6) with
- CDT Version: 7.0.2.201102110609 Build id: 201102110609
- pd-extended 0.42.5
- MingW installed using mingw-get so I think the last stable version (gnu make 3.82, gcc 4.2.5 etc ...)
So i made a simple c project in eclipse using the first tutorial
files i found on the pd-extended source distribution (helloworld.c and the Makefile in the same folder)I modified the Makefile to set the PDROOT path for my windows box, defined the targets clean, pd_nt in my eclipse project, setup the libraries, the include paths and the library path and I think i had done this coherently ...
but ... I get 'undefined reference' (s) for all the pd symbols that are used by helloworld.c i.e. pd_new, gensym, class_new, class_addbang, post
I really know that it should be a trivial path problem but I'm not able to understand my mistake so if anyone can drive me to correct it i will appreciate.
Thanks by now
P.S. please forgive my english
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Access to computers should be unlimited and total. - the hacker ethic