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 in the dev section. Don't worry too much about formatting, mostly just get the info in there. http://puredata.info/docs/developer
As for Makefiles, if you use the the Library Template, then the Makefile will work on MinGW, Cygwin, Mac OS X, GNU/Linux, Android, iOS, etc. http://puredata.info/docs/developer/LibraryTemplate
.hc
On Thu, Jul 14, 2011 at 7:02 PM, Hans-Christoph Steiner hans@at.or.atwrote:
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 in the dev section. Don't worry too much about formatting, mostly just get the info in there. http://puredata.info/docs/developer
I think it's a very trivial thing for a wiki page, I mean is not such a great thing ....
As for Makefiles, if you use the the Library Template, then the Makefile will work on MinGW, Cygwin, Mac OS X, GNU/Linux, Android, iOS, etc. http://puredata.info/docs/developer/LibraryTemplate
.hc
ok, got the template from svn,
use it as it is trying to build a 'mycobject' as defined by the code ...
getting these results in eclipse console:
**** Build of configuration Default for project mycobject ****
make all Building target: mycobject Invoking: MinGW C++ Linker g++ -L"C:\Programmi\pd\bin" -o"mycobject" ./mycobject.o -l"C:/Programmi/pd/bin/pd.lib" c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lC:/Programmi/pd/bin/pd.lib collect2: ld returned 1 exit status make: *** [mycobject] Error 1
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
Anyway I then tryed the hard way from the mingw console issueing a 'make all' getting finally a usefull error message:
Pag@XP-PAG /c/dev/c++/pd-externals/mycobject $ make clean sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory rm -f -- mycobject.o rm -f -- mycobject.dll rm -f -- mycobject.o rm -f -- mycobject.dll
Pag@XP-PAG /c/dev/c++/pd-externals/mycobject $ make all sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory cc -I"/c/Programmi/pd/include/pd" -Wall -W -g -DPD -DVERSION='""' -mms-bitfields -O3 -funroll-loops -fomit-frame-pointer -o "mycobject.o" -c "mycobject.c" /bin/sh: cc: command not found make: *** [mycobject.o] Error 127
perhaps does it means that the compiler command is not defined in the makefile?
I added this line
CC = gcc
between the OS = windows and PD_PATH = $(shell cd "$(PROGRAMFILES)"/pd && pwd) lines
inside the ifeq (MINGW,$(findstring MINGW,$(UNAME))) ... endif block
and then got:
Pag@XP-PAG /c/dev/c++/pd-externals/mycobject $ make all sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory gcc -I"/c/Programmi/pd/include/pd" -Wall -W -g -DPD -DVERSION='""' -mms-bitfield s -O3 -funroll-loops -fomit-frame-pointer -o "mycobject.o" -c "mycobject.c" gcc -s -shared -Wl,--enable-auto-import -o "mycobject.dll" "mycobject.o" -L"/ c/Programmi/pd/src/" -L"/c/Programmi/pd/bin/" -lpd -lwsock32 -lkernel32 -luser32 -lgdi32 chmod a-x "mycobject.dll"
Pag@XP-PAG /c/dev/c++/pd-externals/mycobject $
I got the mycobject dll that runs fine under pd-extended on a windows box.
Still wondering why eclise doen't find my pd.lib
At least this is working now from the command line.
On Thu, 14 Jul 2011 20:15 +0200, "luca paganotti" luca.paganotti@gmail.com wrote:
On Thu, Jul 14, 2011 at 7:02 PM, Hans-Christoph Steiner hans@at.or.atwrote:
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 in the dev section. Don't worry too much about formatting, mostly just get the info in there. http://puredata.info/docs/developer
I think it's a very trivial thing for a wiki page, I mean is not such a great thing ....
As for Makefiles, if you use the the Library Template, then the Makefile will work on MinGW, Cygwin, Mac OS X, GNU/Linux, Android, iOS, etc. http://puredata.info/docs/developer/LibraryTemplate
.hc
ok, got the template from svn,
use it as it is trying to build a 'mycobject' as defined by the code ...
getting these results in eclipse console:
**** Build of configuration Default for project mycobject ****
make all Building target: mycobject Invoking: MinGW C++ Linker g++ -L"C:\Programmi\pd\bin" -o"mycobject" ./mycobject.o -l"C:/Programmi/pd/bin/pd.lib" c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lC:/Programmi/pd/bin/pd.lib collect2: ld returned 1 exit status make: *** [mycobject] Error 1
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
Anyway I then tryed the hard way from the mingw console issueing a 'make all' getting finally a usefull error message:
Pag@XP-PAG /c/dev/c++/pd-externals/mycobject $ make clean sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory rm -f -- mycobject.o rm -f -- mycobject.dll rm -f -- mycobject.o rm -f -- mycobject.dll
Pag@XP-PAG /c/dev/c++/pd-externals/mycobject $ make all sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory cc -I"/c/Programmi/pd/include/pd" -Wall -W -g -DPD -DVERSION='""' -mms-bitfields -O3 -funroll-loops -fomit-frame-pointer -o "mycobject.o" -c "mycobject.c" /bin/sh: cc: command not found make: *** [mycobject.o] Error 127
perhaps does it means that the compiler command is not defined in the makefile?
I added this line
CC = gcc
between the OS = windows and PD_PATH = $(shell cd "$(PROGRAMFILES)"/pd && pwd) lines
inside the ifeq (MINGW,$(findstring MINGW,$(UNAME))) ... endif block
and then got:
Pag@XP-PAG /c/dev/c++/pd-externals/mycobject $ make all sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory gcc -I"/c/Programmi/pd/include/pd" -Wall -W -g -DPD -DVERSION='""' -mms-bitfield s -O3 -funroll-loops -fomit-frame-pointer -o "mycobject.o" -c "mycobject.c" gcc -s -shared -Wl,--enable-auto-import -o "mycobject.dll" "mycobject.o" -L"/ c/Programmi/pd/src/" -L"/c/Programmi/pd/bin/" -lpd -lwsock32 -lkernel32 -luser32 -lgdi32 chmod a-x "mycobject.dll"
Pag@XP-PAG /c/dev/c++/pd-externals/mycobject $
I got the mycobject dll that runs fine under pd-extended on a windows box.
Still wondering why eclise doen't find my pd.lib
At least this is working now from the command line.
Perhaps Eclipse sets CFLAGS or LDFLAGS, which is overriding things in the Makefile?
About this template, it is oriented around making libraries, so that includes the meta file for marking the folder as a library. Setting it up is simple:
used for the folder
variable, LIBRARY_NAME
Now you can set library meta data in the meta file, things like version, authors, etc.
.hc
Hi Hans,
Perhaps Eclipse sets CFLAGS or LDFLAGS, which is overriding things in the Makefile?
I double check my eclipse configuration and this doesn't seem to be the case.
I must admit that I'm working with my development box which is rather confused, at the moment, and probably my environment is not so plain and simple as I have a lot of stuff on it, I should try with a fresh installation may be on a virtual machine if I have time to do it ...
Eclipse is really doing some strange things:
when I build the clean target this is the result:
**** Build of configuration Default for project mycobject ****
mingw32-make clean del ./mycobject.o ./mycobject.d mycobject process_begin: CreateProcess(NULL, del ./mycobject.o ./mycobject.d mycobject, ...) failed. make (e=2): Impossibile trovare il file specificato.
mingw32-make: [clean] Error 2 (ignored)
first, the del command tries to delete mycobject.d in place of mycobject.dll ????? second the CreateProcess call fails issueing a 'file not found' and this is right as i tried to issue the same command on the command prompt and I get almost the same result:
C:\dev\c++\pd-externals\mycobject>del ./mycobject.o ./mycobject.d mycobject Opzione non valida - "mycobject.o".
the previous command returns a not valid option message due to the fact that the forward slash is interpreted a switch selector for the command.
try then this
C:\dev\c++\pd-externals\mycobject>del "./mycobject.o ./mycobject.d mycobject" Impossibile trovare il percorso specificato.
--> file not found
If i run the same command as:
C:\dev\c++\pd-externals\mycobject>del "./mycobject.o" "./mycobject.d" "mycobject"
now myobject.o is deleted, the other two file do not exist.
About this template, it is oriented around making libraries, so that includes the meta file for marking the folder as a library. Setting it up is simple:
- rename the template folder to the name of your library
- rename template-meta.pd replacing 'template' with the name you just
used for the folder
- edit Makefile and put the library/folder/meta name in the first
variable, LIBRARY_NAME
Now you can set library meta data in the meta file, things like version, authors, etc.
.hc
To test it I have made minimal changes i.e. folder name, LIBRARY_NAME, and template-meta (all = mycobject) and it is working from mingw shell.
Perhaps Eclipse sets CFLAGS or LDFLAGS, which is overriding things in the Makefile?
I got it.
eclipse is joking ...and i'm trusting it ...
I added the pd library in the project properties in the Libraries tab using the Add... button and then the File system ... button and eclipse added this line in the list of libraries:
C:\Programmi\pd\bin\pd.lib
but then it calls mingw ld command passing to it exactly * -lC:/Programmi/pd/bin/pd.lib* and so ld complains saying:
... cannot find -lC:/Programmi/pd/bin/pd.lib ...
and ld is right as the -l switch should be -lpd.
Defining the library as *pd* and not as *C:/Programmi/pd/bin/pd.lib *allows eclipse to finish the build creating the mycobject.dll file ... sorry it was my mistake ....
Still having troubles with the *clean* target and with surprise also with the *showsetup* target --> eclipse complaining that there is no rule to make target 'showsetup' ....
About this template, it is oriented around making libraries, so that includes the meta file for marking the folder as a library. Setting it up is simple:
- rename the template folder to the name of your library
- rename template-meta.pd replacing 'template' with the name you just
used for the folder
- edit Makefile and put the library/folder/meta name in the first
variable, LIBRARY_NAME
Now you can set library meta data in the meta file, things like version, authors, etc.
.hc
mycobject.dll is created by eclipse at the price of defining:
*CFLAGS = -I"C:/Programmi/pd/src" -Wall -W -g* in place of *CFLAGS = -I"$(PD_INCLUDE)/pd" -Wall -W -g*
*PD_PATH = c:/programmi/pd* in place of *PD_PATH = $(shell cd "$(PROGRAMFILES)"/pd && pwd)*
and declaring *CC = gcc*
Perhaps Eclipse sets CFLAGS or LDFLAGS, which is overriding things in
the Makefile?
About this template, it is oriented around making libraries, so that includes the meta file for marking the folder as a library. Setting it up is simple:
- rename the template folder to the name of your library
- rename template-meta.pd replacing 'template' with the name you just
used for the folder
- edit Makefile and put the library/folder/meta name in the first
variable, LIBRARY_NAME
Now you can set library meta data in the meta file, things like version, authors, etc.
.hc
Ok, I checked in the CC=gcc for MinGW. For the other two issues,
unfortunately its more complicated:
On Jul 15, 2011, at 5:06 AM, luca paganotti wrote:
mycobject.dll is created by eclipse at the price of defining:
CFLAGS = -I"C:/Programmi/pd/src" -Wall -W -g in place of CFLAGS = - I"$(PD_INCLUDE)/pd" -Wall -W -g
The header arrangement has changed in 0.43, so now all of the headers
are included in $(PD_INCLUDE)/pd. We haven't quite figured out how to
handle that everywhere yet tho...
PD_PATH = c:/programmi/pd in place of PD_PATH = $(shell cd "$ (PROGRAMFILES)"/pd && pwd)
This little script to set PD_PATH works for me on my MinGW setup. Can
you put the old PD_PATH line back in the Makefile and run 'make
showsetup' and send me the result? You should see what its setting
PD_PATH to. I'd like to get that working automatically.
.hc
and declaring CC = gcc
Perhaps Eclipse sets CFLAGS or LDFLAGS, which is overriding things in the Makefile?
About this template, it is oriented around making libraries, so that includes the meta file for marking the folder as a library. Setting
it up is simple:
- rename the template folder to the name of your library
- rename template-meta.pd replacing 'template' with the name you just
used for the folder
- edit Makefile and put the library/folder/meta name in the first
variable, LIBRARY_NAME
Now you can set library meta data in the meta file, things like
version, authors, etc..hc
Terrorism is not an enemy. It cannot be defeated. It's a tactic.
It's about as sensible to say we declare war on night attacks and
expect we're going to win that war. We're not going to win the war on
terrorism. - retired U.S. Army general, William Odom
On Thu, 14 Jul 2011 20:15 +0200, "luca paganotti" luca.paganotti@gmail.com wrote:
On Thu, Jul 14, 2011 at 7:02 PM, Hans-Christoph Steiner hans@at.or.atwrote:
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 in the dev section. Don't worry too much about formatting, mostly just get the info in there. http://puredata.info/docs/developer
I think it's a very trivial thing for a wiki page, I mean is not such a great thing ....
As for Makefiles, if you use the the Library Template, then the Makefile will work on MinGW, Cygwin, Mac OS X, GNU/Linux, Android, iOS, etc. http://puredata.info/docs/developer/LibraryTemplate
.hc
ok, got the template from svn,
use it as it is trying to build a 'mycobject' as defined by the code ...
getting these results in eclipse console:
**** Build of configuration Default for project mycobject ****
make all Building target: mycobject Invoking: MinGW C++ Linker g++ -L"C:\Programmi\pd\bin" -o"mycobject" ./mycobject.o -l"C:/Programmi/pd/bin/pd.lib" c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lC:/Programmi/pd/bin/pd.lib collect2: ld returned 1 exit status make: *** [mycobject] Error 1
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
Anyway I then tryed the hard way from the mingw console issueing a 'make all' getting finally a usefull error message:
Pag@XP-PAG /c/dev/c++/pd-externals/mycobject $ make clean sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory rm -f -- mycobject.o rm -f -- mycobject.dll rm -f -- mycobject.o rm -f -- mycobject.dll
Pag@XP-PAG /c/dev/c++/pd-externals/mycobject $ make all sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory cc -I"/c/Programmi/pd/include/pd" -Wall -W -g -DPD -DVERSION='""' -mms-bitfields -O3 -funroll-loops -fomit-frame-pointer -o "mycobject.o" -c "mycobject.c" /bin/sh: cc: command not found make: *** [mycobject.o] Error 127
perhaps does it means that the compiler command is not defined in the makefile?
I added this line
CC = gcc
between the OS = windows and PD_PATH = $(shell cd "$(PROGRAMFILES)"/pd && pwd) lines
inside the ifeq (MINGW,$(findstring MINGW,$(UNAME))) ... endif block
and then got:
Pag@XP-PAG /c/dev/c++/pd-externals/mycobject $ make all sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory sed: can't read mycobject-meta.pd: No such file or directory gcc -I"/c/Programmi/pd/include/pd" -Wall -W -g -DPD -DVERSION='""' -mms-bitfield s -O3 -funroll-loops -fomit-frame-pointer -o "mycobject.o" -c "mycobject.c" gcc -s -shared -Wl,--enable-auto-import -o "mycobject.dll" "mycobject.o" -L"/ c/Programmi/pd/src/" -L"/c/Programmi/pd/bin/" -lpd -lwsock32 -lkernel32 -luser32 -lgdi32 chmod a-x "mycobject.dll"
Pag@XP-PAG /c/dev/c++/pd-externals/mycobject $
I got the mycobject dll that runs fine under pd-extended on a windows box.
Still wondering why eclise doen't find my pd.lib
At least this is working now from the command line.
I finally added some "getting started" instructions, hopefully this is useful:
https://puredata.info/docs/developer/LibraryTemplate
.hc
Great!
...
I finally added some "getting started" instructions, hopefully this is useful:
https://puredata.info/docs/developer/LibraryTemplate
.hc