Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-26 Thread Hans-Christoph Steiner


The ProgramFiles var is still useful in a plain Cygwin or MinGW  
environment.  I just checked in an update for both Cygwin and MinGW.  
It should work now if you just define PROGRAMFILES in Eclipse.  There  
was a problem where $(PROGRAMFILES) was interpretted by make, so C: 
\Program Files turns into C:Program Files  since make uses / as the  
path separator.  So I replaced $(PROGRAMFILES) with $$PROGRAMFILES so  
that the var doesn't get evaluated by make but instead only the  
shell.  MinGW understands Windows paths, and for Cygwin, I fixed the  
use of 'cygpath' to generate a Cygwin path.


.hc

On Jul 26, 2011, at 6:08 AM, luca paganotti wrote:


... ok,  i'm not so fool ...

the build was running well in this case when I had this configuration:

PD_PATH ?= $(shell cd $(ProgramFiles)/pd  pwd)

BUT (gr ) I had a redefinition of PD_PATH inside eclipse as  
PD_PATH -- /c/programmi/pd in the project preferences/C/C++ Build/ 
Environment, making the presence of $(ProgramFiles) in the makefile  
totally meaningless !


sorry again ...




On Tue, Jul 26, 2011 at 4:12 AM, Hans-Christoph Steiner  
h...@at.or.at wrote:


Hey Luca,

Thanks for troubleshooting this.  I renamed $(PROGRAMFILES) to $ 
(ProgramFiles) in the template Makefile, following your second  
suggestion.  That seems to be the best solution, sound good to you?


http://pure-data.svn.sourceforge.net/viewvc/pure-data/trunk/externals/template/Makefile?r1=15153r2=15164

.hc

On Jul 18, 2011, at 6:12 AM, luca paganotti wrote:


Hi Hans,

the first option of setting environment/build variables has these  
effects:

Defining build variable PROGRAMFILES inside eclipse doesn't work.
It works if I change $(PROGRAMFILES) to $(ProgramFiles) in the make  
file.
Obviously it works also if I define PROGRAMFILES in the mingw block  
of the makefile.
It works defining PROGRAMFILES=${ProgramFiles} in eclipse project  
preferences/C/C++ Build/Environment.In mingw works as before.

For the second option you gave

changing PD_PATH = $(shell cd $(PROGRAMFILES)/pd  pwd) to  
PD_PATH ?= $(shell cd $(PROGRAMFILES)/pd  pwd)
works in eclipse defining an environment variable inside project  
preferences/C/C++ Build/Environment as PD_PATH = ${ProgramFiles}/pd.
And it works too running make PD_PATH=/c/Programmi/pd from the  
mingw shell.


Many thanks.

Ciao



On Fri, Jul 15, 2011 at 5:47 PM, Hans-Christoph Steiner h...@at.or.at 
 wrote:


Arg, that's really annoying.  Eclipse seems to strip the  
ProgramFiles env var from the environment when it runs the build.   
What if you set the ProgramFiles variable in Eclipse?  Another  
option might be that we change  the PD_PATH definition to be  
assigned with ?= then it can be overridden by setting an env var  
PD_PATH.  This should currently work in Eclipse and the cmd line:


make PD_PATH=/c/programmi/pd showsetup

.hc

On Jul 15, 2011, at 11:40 AM, luca paganotti wrote:


Hi Hans

running 'make showsetup' from eclipse gives:

 Build of configuration Default for project mycobject 

mingw32-make showsetup
/usr/bin/sh: line 0: cd: /pd: No such file or directory
/usr/bin/sh: line 0: cd: /pd: No such file or directory
/usr/bin/sh: line 0: cd: /pd: No such file or directory
/usr/bin/sh: line 0: cd: /pd: No such file or directory
CFLAGS: -IC:/Programmi/pd/src -Wall -W -g -DPD -DVERSION='0.0' - 
mms-bitfields -O3 -funroll-loops -fomit-frame-pointer

LDFLAGS:  -s -shared -Wl,--enable-auto-import
LIBS:  -L/src/ -L/bin/ -lpd -lwsock32 -lkernel32 -luser32 -lgdi32
PD_INCLUDE: /include
PD_PATH:
objectsdir: /usr/local/lib/pd-externals
LIBRARY_NAME: mycobject
LIBRARY_VERSION: 0.0
SOURCES: mycobject.c
PDOBJECTS: mypdobject.pd
ALLSOURCES: mycobject.c
UNAME: MINGW32_NT-5.1
CPU: i686
pkglibdir: /usr/local/lib/pd-externals
DISTDIR: mycobject-0.0
ORIGDIR: pd-mycobject_0.0

Running from mingw shell gives:

Pag@XP-PAG /c/dev/c++/pd-externals/mycobject
$ make showsetup
CFLAGS: -IC:/Programmi/pd/src -Wall -W -g -DPD -DVERSION='0.0' - 
mms-bitfields -O

3 -funroll-loops -fomit-frame-pointer
LDFLAGS:  -s -shared -Wl,--enable-auto-import
LIBS:  -L/c/Programmi/pd/src/ -L/c/Programmi/pd/bin/ -lpd - 
lwsock32 -lkernel32 -

luser32 -lgdi32
PD_INCLUDE: /c/Programmi/pd/include
PD_PATH: /c/Programmi/pd
objectsdir: /usr/local/lib/pd-externals
LIBRARY_NAME: mycobject
LIBRARY_VERSION: 0.0
SOURCES: mycobject.c
PDOBJECTS: mypdobject.pd
ALLSOURCES: mycobject.c
UNAME: MINGW32_NT-5.1
CPU: i686
pkglibdir: /usr/local/lib/pd-externals
DISTDIR: mycobject-0.0
ORIGDIR: pd-mycobject_0.0

Pag@XP-PAG /c/dev/c++/pd-externals/mycobject
$

hope this helps.

ciao








On Fri, Jul 15, 2011 at 5:22 PM, Hans-Christoph Steiner h...@at.or.at 
 wrote:


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 = -IC:/Programmi/pd/src -Wall -W -g in place of CFLAGS =  
-I$(PD_INCLUDE)/pd -Wall -W 

Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-25 Thread Hans-Christoph Steiner


On Jul 18, 2011, at 4:28 AM, Lorenzo Sutton wrote:


Hans,

Hans-Christoph Steiner wrote:


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?
Honestly I'm not sure :-)... It does have 'projects' like many IDEs  
and
you can configure build options from within the gui. I'm not sure if  
it
would make sense to have some sample projects in SVN, maybe in the  
wiki

if there is interest in using that IDE (it is corss platform with more
of an less stable thing on macs).



On problem with Windows IIRC was having to use absolute paths for the
.lib and .dll files etc.


My guess is that you can use the Windows env vars like %ProgramFiles%  
and %CommonFiles% to help in this situation.




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~.


I think if the template works maybe it is better to have that as a
'standard'.


Does CodeBlocks work well using an external Makefile?  If so, then  
yes, its probably best if there was a wiki howto on how to setup  
CodeBlocks to use the Library Template.


.hc



Lorenzo



.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

 1. CDT Version: 7.0.2.201102110609
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


___
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










Looking at things from a more basic level, you can come up with a more  
direct solution... It may sound small in theory, but it in practice,  
it can change entire economies. - Amy Smith




___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-25 Thread Hans-Christoph Steiner


Hey Luca,

Thanks for troubleshooting this.  I renamed $(PROGRAMFILES) to $ 
(ProgramFiles) in the template Makefile, following your second  
suggestion.  That seems to be the best solution, sound good to you?


http://pure-data.svn.sourceforge.net/viewvc/pure-data/trunk/externals/template/Makefile?r1=15153r2=15164

.hc

On Jul 18, 2011, at 6:12 AM, luca paganotti wrote:


Hi Hans,

the first option of setting environment/build variables has these  
effects:

Defining build variable PROGRAMFILES inside eclipse doesn't work.
It works if I change $(PROGRAMFILES) to $(ProgramFiles) in the make  
file.
Obviously it works also if I define PROGRAMFILES in the mingw block  
of the makefile.
It works defining PROGRAMFILES=${ProgramFiles} in eclipse project  
preferences/C/C++ Build/Environment.In mingw works as before.

For the second option you gave

changing PD_PATH = $(shell cd $(PROGRAMFILES)/pd  pwd) to  
PD_PATH ?= $(shell cd $(PROGRAMFILES)/pd  pwd)
works in eclipse defining an environment variable inside project  
preferences/C/C++ Build/Environment as PD_PATH = ${ProgramFiles}/pd.
And it works too running make PD_PATH=/c/Programmi/pd from the mingw  
shell.


Many thanks.

Ciao



On Fri, Jul 15, 2011 at 5:47 PM, Hans-Christoph Steiner  
h...@at.or.at wrote:


Arg, that's really annoying.  Eclipse seems to strip the  
ProgramFiles env var from the environment when it runs the build.   
What if you set the ProgramFiles variable in Eclipse?  Another  
option might be that we change  the PD_PATH definition to be  
assigned with ?= then it can be overridden by setting an env var  
PD_PATH.  This should currently work in Eclipse and the cmd line:


make PD_PATH=/c/programmi/pd showsetup

.hc

On Jul 15, 2011, at 11:40 AM, luca paganotti wrote:


Hi Hans

running 'make showsetup' from eclipse gives:

 Build of configuration Default for project mycobject 

mingw32-make showsetup
/usr/bin/sh: line 0: cd: /pd: No such file or directory
/usr/bin/sh: line 0: cd: /pd: No such file or directory
/usr/bin/sh: line 0: cd: /pd: No such file or directory
/usr/bin/sh: line 0: cd: /pd: No such file or directory
CFLAGS: -IC:/Programmi/pd/src -Wall -W -g -DPD -DVERSION='0.0' -mms- 
bitfields -O3 -funroll-loops -fomit-frame-pointer

LDFLAGS:  -s -shared -Wl,--enable-auto-import
LIBS:  -L/src/ -L/bin/ -lpd -lwsock32 -lkernel32 -luser32 -lgdi32
PD_INCLUDE: /include
PD_PATH:
objectsdir: /usr/local/lib/pd-externals
LIBRARY_NAME: mycobject
LIBRARY_VERSION: 0.0
SOURCES: mycobject.c
PDOBJECTS: mypdobject.pd
ALLSOURCES: mycobject.c
UNAME: MINGW32_NT-5.1
CPU: i686
pkglibdir: /usr/local/lib/pd-externals
DISTDIR: mycobject-0.0
ORIGDIR: pd-mycobject_0.0

Running from mingw shell gives:

Pag@XP-PAG /c/dev/c++/pd-externals/mycobject
$ make showsetup
CFLAGS: -IC:/Programmi/pd/src -Wall -W -g -DPD -DVERSION='0.0' -mms- 
bitfields -O

3 -funroll-loops -fomit-frame-pointer
LDFLAGS:  -s -shared -Wl,--enable-auto-import
LIBS:  -L/c/Programmi/pd/src/ -L/c/Programmi/pd/bin/ -lpd -lwsock32  
-lkernel32 -

luser32 -lgdi32
PD_INCLUDE: /c/Programmi/pd/include
PD_PATH: /c/Programmi/pd
objectsdir: /usr/local/lib/pd-externals
LIBRARY_NAME: mycobject
LIBRARY_VERSION: 0.0
SOURCES: mycobject.c
PDOBJECTS: mypdobject.pd
ALLSOURCES: mycobject.c
UNAME: MINGW32_NT-5.1
CPU: i686
pkglibdir: /usr/local/lib/pd-externals
DISTDIR: mycobject-0.0
ORIGDIR: pd-mycobject_0.0

Pag@XP-PAG /c/dev/c++/pd-externals/mycobject
$

hope this helps.

ciao








On Fri, Jul 15, 2011 at 5:22 PM, Hans-Christoph Steiner h...@at.or.at 
 wrote:


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 = -IC:/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,


Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-18 Thread luca paganotti
Hi Hans,

the first option of setting environment/build variables has these effects:

   - Defining build variable PROGRAMFILES inside eclipse doesn't work.
   - It works if I change $(PROGRAMFILES) to $(ProgramFiles) in the make
   file.
   - Obviously it works also if I define PROGRAMFILES in the mingw block of
   the makefile.
   - It works defining PROGRAMFILES=${ProgramFiles} in eclipse project
   preferences/C/C++ Build/Environment.In mingw works as before.

For the second option you gave

changing PD_PATH = $(shell cd $(PROGRAMFILES)/pd  pwd) to PD_PATH ?=
$(shell cd $(PROGRAMFILES)/pd  pwd)
works in eclipse defining an environment variable inside project
preferences/C/C++ Build/Environment as PD_PATH = ${ProgramFiles}/pd.
And it works too running make PD_PATH=/c/Programmi/pd from the mingw shell.

Many thanks.

Ciao



On Fri, Jul 15, 2011 at 5:47 PM, Hans-Christoph Steiner h...@at.or.atwrote:


 Arg, that's really annoying.  Eclipse seems to strip the ProgramFiles env
 var from the environment when it runs the build.  What if you set the
 ProgramFiles variable in Eclipse?  Another option might be that we change
  the PD_PATH definition to be assigned with ?= then it can be overridden by
 setting an env var PD_PATH.  This should currently work in Eclipse and the
 cmd line:

 make PD_PATH=/c/programmi/pd showsetup

 .hc

 On Jul 15, 2011, at 11:40 AM, luca paganotti wrote:

 Hi Hans

 running 'make showsetup' from eclipse gives:

  Build of configuration Default for project mycobject 

 mingw32-make showsetup
 /usr/bin/sh: line 0: cd: /pd: No such file or directory
 /usr/bin/sh: line 0: cd: /pd: No such file or directory
 /usr/bin/sh: line 0: cd: /pd: No such file or directory
 /usr/bin/sh: line 0: cd: /pd: No such file or directory
 CFLAGS: -IC:/Programmi/pd/src -Wall -W -g -DPD -DVERSION='0.0'
 -mms-bitfields -O3 -funroll-loops -fomit-frame-pointer
 LDFLAGS:  -s -shared -Wl,--enable-auto-import
 LIBS:  -L/src/ -L/bin/ -lpd -lwsock32 -lkernel32 -luser32 -lgdi32
 PD_INCLUDE: /include
 PD_PATH:
 objectsdir: /usr/local/lib/pd-externals
 LIBRARY_NAME: mycobject
 LIBRARY_VERSION: 0.0
 SOURCES: mycobject.c
 PDOBJECTS: mypdobject.pd
 ALLSOURCES: mycobject.c
 UNAME: MINGW32_NT-5.1
 CPU: i686
 pkglibdir: /usr/local/lib/pd-externals
 DISTDIR: mycobject-0.0
 ORIGDIR: pd-mycobject_0.0

 Running from mingw shell gives:

 Pag@XP-PAG /c/dev/c++/pd-externals/mycobject
 $ make showsetup
 CFLAGS: -IC:/Programmi/pd/src -Wall -W -g -DPD -DVERSION='0.0'
 -mms-bitfields -O
 3 -funroll-loops -fomit-frame-pointer
 LDFLAGS:  -s -shared -Wl,--enable-auto-import
 LIBS:  -L/c/Programmi/pd/src/ -L/c/Programmi/pd/bin/ -lpd -lwsock32
 -lkernel32 -
 luser32 -lgdi32
 PD_INCLUDE: /c/Programmi/pd/include
 PD_PATH: /c/Programmi/pd
 objectsdir: /usr/local/lib/pd-externals
 LIBRARY_NAME: mycobject
 LIBRARY_VERSION: 0.0
 SOURCES: mycobject.c
 PDOBJECTS: mypdobject.pd
 ALLSOURCES: mycobject.c
 UNAME: MINGW32_NT-5.1
 CPU: i686
 pkglibdir: /usr/local/lib/pd-externals
 DISTDIR: mycobject-0.0
 ORIGDIR: pd-mycobject_0.0

 Pag@XP-PAG /c/dev/c++/pd-externals/mycobject
 $

 hope this helps.

 ciao








 On Fri, Jul 15, 2011 at 5:22 PM, Hans-Christoph Steiner h...@at.or.atwrote:


 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 = -IC:/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.
   

Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-15 Thread Lorenzo Sutton
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

1. CDT Version: 7.0.2.201102110609
   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


 ___
 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


Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-15 Thread luca paganotti
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\mycobjectdel  ./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\mycobjectdel  ./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\mycobjectdel  ./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.
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-15 Thread luca paganotti
Great!


...
 I finally added some getting started instructions, hopefully this is
 useful:

 https://puredata.info/docs/developer/LibraryTemplate

 .hc


___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-15 Thread luca paganotti
 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

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-15 Thread luca paganotti
mycobject.dll is created by eclipse at the price of defining:

*CFLAGS = -IC:/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

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-15 Thread Hans-Christoph Steiner


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

  1. CDT Version: 7.0.2.201102110609
 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


___
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



___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-15 Thread Hans-Christoph Steiner


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 = -IC:/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



___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-15 Thread Hans-Christoph Steiner


Arg, that's really annoying.  Eclipse seems to strip the ProgramFiles  
env var from the environment when it runs the build.  What if you set  
the ProgramFiles variable in Eclipse?  Another option might be that we  
change  the PD_PATH definition to be assigned with ?= then it can be  
overridden by setting an env var PD_PATH.  This should currently work  
in Eclipse and the cmd line:


make PD_PATH=/c/programmi/pd showsetup

.hc

On Jul 15, 2011, at 11:40 AM, luca paganotti wrote:


Hi Hans

running 'make showsetup' from eclipse gives:

 Build of configuration Default for project mycobject 

mingw32-make showsetup
/usr/bin/sh: line 0: cd: /pd: No such file or directory
/usr/bin/sh: line 0: cd: /pd: No such file or directory
/usr/bin/sh: line 0: cd: /pd: No such file or directory
/usr/bin/sh: line 0: cd: /pd: No such file or directory
CFLAGS: -IC:/Programmi/pd/src -Wall -W -g -DPD -DVERSION='0.0' -mms- 
bitfields -O3 -funroll-loops -fomit-frame-pointer

LDFLAGS:  -s -shared -Wl,--enable-auto-import
LIBS:  -L/src/ -L/bin/ -lpd -lwsock32 -lkernel32 -luser32 -lgdi32
PD_INCLUDE: /include
PD_PATH:
objectsdir: /usr/local/lib/pd-externals
LIBRARY_NAME: mycobject
LIBRARY_VERSION: 0.0
SOURCES: mycobject.c
PDOBJECTS: mypdobject.pd
ALLSOURCES: mycobject.c
UNAME: MINGW32_NT-5.1
CPU: i686
pkglibdir: /usr/local/lib/pd-externals
DISTDIR: mycobject-0.0
ORIGDIR: pd-mycobject_0.0

Running from mingw shell gives:

Pag@XP-PAG /c/dev/c++/pd-externals/mycobject
$ make showsetup
CFLAGS: -IC:/Programmi/pd/src -Wall -W -g -DPD -DVERSION='0.0' -mms- 
bitfields -O

3 -funroll-loops -fomit-frame-pointer
LDFLAGS:  -s -shared -Wl,--enable-auto-import
LIBS:  -L/c/Programmi/pd/src/ -L/c/Programmi/pd/bin/ -lpd -lwsock32 - 
lkernel32 -

luser32 -lgdi32
PD_INCLUDE: /c/Programmi/pd/include
PD_PATH: /c/Programmi/pd
objectsdir: /usr/local/lib/pd-externals
LIBRARY_NAME: mycobject
LIBRARY_VERSION: 0.0
SOURCES: mycobject.c
PDOBJECTS: mypdobject.pd
ALLSOURCES: mycobject.c
UNAME: MINGW32_NT-5.1
CPU: i686
pkglibdir: /usr/local/lib/pd-externals
DISTDIR: mycobject-0.0
ORIGDIR: pd-mycobject_0.0

Pag@XP-PAG /c/dev/c++/pd-externals/mycobject
$

hope this helps.

ciao








On Fri, Jul 15, 2011 at 5:22 PM, Hans-Christoph Steiner  
h...@at.or.at wrote:


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 = -IC:/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










Making boring techno music is really easy with modern tools, but with  
live coding, boring techno is much harder. - Chris McCormick





___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


[PD] MinGW + Eclipse + MSWIN helloworld

2011-07-14 Thread luca paganotti
Hi all,

i'm beginning hacking pd externals, I'm trying to use Eclipse Helios (3.6)
with

   1. CDT Version: 7.0.2.201102110609
   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
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-14 Thread Mathieu Bouchard

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
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-14 Thread Hans-Christoph Steiner

On Thu, 14 Jul 2011 12:44 -0400, Mathieu Bouchard ma...@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

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-14 Thread luca paganotti
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?
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-14 Thread luca paganotti
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.
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-14 Thread Hans-Christoph Steiner

On Thu, 14 Jul 2011 12:44 -0400, Mathieu Bouchard ma...@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

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-14 Thread Mathieu Bouchard

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
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-14 Thread luca paganotti
On Thu, Jul 14, 2011 at 7:02 PM, Hans-Christoph Steiner h...@at.or.atwrote:


 On Thu, 14 Jul 2011 12:44 -0400, Mathieu Bouchard ma...@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++ -LC:\Programmi\pd\bin -omycobject  ./mycobject.o
-lC:/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.
___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-14 Thread Martin Peach

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 -Lpath/to/pdlib to LIBS.


Martin

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-14 Thread Hans-Christoph Steiner
On Thu, 14 Jul 2011 15:44 -0400, Martin Peach
martin.pe...@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 -Lpath/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

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-14 Thread Hans-Christoph Steiner
On Thu, 14 Jul 2011 20:15 +0200, luca paganotti
luca.pagano...@gmail.com wrote:
 On Thu, Jul 14, 2011 at 7:02 PM, Hans-Christoph Steiner
 h...@at.or.atwrote:
 
 
  On Thu, 14 Jul 2011 12:44 -0400, Mathieu Bouchard ma...@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++ -LC:\Programmi\pd\bin -omycobject  ./mycobject.o
 -lC:/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:

- 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, 

Re: [PD] MinGW + Eclipse + MSWIN helloworld

2011-07-14 Thread Hans-Christoph Steiner
On Thu, 14 Jul 2011 20:15 +0200, luca paganotti
luca.pagano...@gmail.com wrote:
 On Thu, Jul 14, 2011 at 7:02 PM, Hans-Christoph Steiner
 h...@at.or.atwrote:
 
 
  On Thu, 14 Jul 2011 12:44 -0400, Mathieu Bouchard ma...@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++ -LC:\Programmi\pd\bin -omycobject  ./mycobject.o
 -lC:/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


___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list