Hi Steven. Let's continue this discussion on the dev list...
On Sat, Feb 21, 2004 at 04:50:49PM -0800, stevenyi wrote:
You can use cygwin to compile without requiring cygwin.dll by using the commandline flag -mno-cygwin. This ends up using native libraries, similarly to how mingw does.
That's good news, but first I need to compile flext (0.4.5). I hope you or Thomas can help. Here's the problem:
$ make -f makefile.pd-cygwin g++ -c -O6 -DFLEXT_SYS=2 -mcpu=pentium4 -msse -I/cygdrive/c/pd/src -Isource source/flbase.cpp -o pd-cygwin/flbase.o In file included from /usr/include/c++/3.3.1/i686-pc-cygwin/bits/gthr-default.h:37, from /usr/include/c++/3.3.1/i686-pc-cygwin/bits/gthr.h:98, from /usr/include/c++/3.3.1/i686-pc-cygwin/bits/c++io.h:37, from /usr/include/c++/3.3.1/bits/fpos.h:44, from /usr/include/c++/3.3.1/iosfwd:49, from /usr/include/c++/3.3.1/bits/stl_algobase.h:70, from /usr/include/c++/3.3.1/bits/stl_tree.h:86, from /usr/include/c++/3.3.1/map:66, from source/flclass.h:23, from source/flext.h:66, from source/flbase.cpp:17: /cygdrive/c/pd/src/pthread.h:260: error: redefinition of `struct timespec' /usr/include/sys/types.h:100: error: previous definition of `struct timespec' /cygdrive/c/pd/src/pthread.h:482: error: conflicting types for `typedef struct pthread_t_*pthread_t'
etc...
So there's a conflict between the pthread definitions of Cygwin and PD. How can I fix this problem?
B.T.W., I run the Gnome desktop under Cygwin, this is very cool! -- Marc
Hi Marc,
Sorry if you mentioned this already as I haven't been following the discussion all that closely, but what version of pd's sources are you using? I downloaded Miller Puckette's pd-0.37-0 from his site just now and there was no pthread.h in the src directory, and also no pthread.h in the src directory on the pure-data.sf.net's cvs (browsing cvs web online). Maybe this is the problem?
steven
On Sat, 2004-02-21 at 19:13, Marc Lavallée wrote:
Hi Steven. Let's continue this discussion on the dev list...
On Sat, Feb 21, 2004 at 04:50:49PM -0800, stevenyi wrote:
You can use cygwin to compile without requiring cygwin.dll by using the commandline flag -mno-cygwin. This ends up using native libraries, similarly to how mingw does.
That's good news, but first I need to compile flext (0.4.5). I hope you or Thomas can help. Here's the problem:
$ make -f makefile.pd-cygwin g++ -c -O6 -DFLEXT_SYS=2 -mcpu=pentium4 -msse -I/cygdrive/c/pd/src -Isource source/flbase.cpp -o pd-cygwin/flbase.o In file included from /usr/include/c++/3.3.1/i686-pc-cygwin/bits/gthr-default.h:37, from /usr/include/c++/3.3.1/i686-pc-cygwin/bits/gthr.h:98, from /usr/include/c++/3.3.1/i686-pc-cygwin/bits/c++io.h:37, from /usr/include/c++/3.3.1/bits/fpos.h:44, from /usr/include/c++/3.3.1/iosfwd:49, from /usr/include/c++/3.3.1/bits/stl_algobase.h:70, from /usr/include/c++/3.3.1/bits/stl_tree.h:86, from /usr/include/c++/3.3.1/map:66, from source/flclass.h:23, from source/flext.h:66, from source/flbase.cpp:17: /cygdrive/c/pd/src/pthread.h:260: error: redefinition of `struct timespec' /usr/include/sys/types.h:100: error: previous definition of `struct timespec' /cygdrive/c/pd/src/pthread.h:482: error: conflicting types for `typedef struct pthread_t_*pthread_t'
etc...
So there's a conflict between the pthread definitions of Cygwin and PD. How can I fix this problem?
B.T.W., I run the Gnome desktop under Cygwin, this is very cool!
Marc
PD-dev mailing list PD-dev@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-dev
On Sat, Feb 21, 2004 at 07:45:38PM -0800, stevenyi wrote:
I downloaded Miller Puckette's pd-0.37-0 from his site just now and there was no pthread.h in the src directory, and also no pthread.h in the src directory on the pure-data.sf.net's cvs (browsing cvs web online). Maybe this is the problem?
That was one of the problem; I removed pthread.h from the source of pd-0.37-1test6 and it compiled. When I added "-mno-cygwin" to CFLAGS it complained that it was not possible to determine the operating system, so I added "#define FLEXT_OS FLEXT_OS_WIN" in flext.h and it compiled (there must be a better way).
Now I'd like to build a DLL instead of static libraries, but I can't replace "CFLAGS_T=-DFLEXT_THREADS" with "CFLAGS_T=-DFLEXT_SHARED", as instructed by Thomas, because this flag is for the msvc makefile, not the cygwin makefile. There's special tools included with Cygin to create DLLs, but I don't understand (yet) how to use them. Any help would be appreciated.
If I eventually succeed, I should be able to cross compile externals for Windows (and maybe MacOSX) directly from Linux. Am I too ambitious? -- Marc
Hi Marc,
That was one of the problem; I removed pthread.h from the source of pd-0.37-1test6 and it compiled. When I added "-mno-cygwin" to CFLAGS it complained that it was not possible to determine the operating system, so I added "#define FLEXT_OS FLEXT_OS_WIN" in flext.h and it compiled (there must be a better way).
I don't have this problem (the OS is detected correctly) but -mno-cygwin doesn't work for threaded externals (and therefore also a flext dynamic library) because pthread definitions don't get included in the relevant cygwin header files (as __CYGWIN__ is not defined then). Without that flag all static versions of flext compile ok here.
MinGW works ok. I added makefiles etc. to the flext cvs folder. (working versions to check out by tomorrow morning)
Now I'd like to build a DLL instead of static libraries, but I can't replace "CFLAGS_T=-DFLEXT_THREADS" with "CFLAGS_T=-DFLEXT_SHARED", as instructed by Thomas, because this flag is for the msvc makefile, not the cygwin makefile.
Hmmm, i don't understand. However, have a look at tomorrow's cvs makefile.
There's special tools included with Cygin to create DLLs, but I don't understand (yet) how to use them. Any help would be appreciated.
Without special tools (which ones?) linking a flext.dll currently fails because the linker can't cope with the variables (garray_class etc.) exported by pd.lib . I'm happy about any ideas how to solve this
greetings, Thomas
On Sun, Feb 22, 2004 at 02:15:26PM +0100, Thomas Grill wrote:
I don't have this problem (the OS is detected correctly)
No problem either with your new cvs version.
MinGW works ok. I added makefiles etc. to the flext cvs folder. (working versions to check out by tomorrow morning)
But only for the debug version. I uncommented the other targets in the makefile and it stopped because "gettimeofday" is not defined in MinGW.
Without special tools (which ones?)
"dllwrap.exe" and "dlltool.exe", but I don't how to use them.
-- Marc
MinGW works ok. I added makefiles etc. to the flext cvs folder. (working versions to check out by tomorrow morning)
But only for the debug version. I uncommented the other targets in the makefile and it stopped because "gettimeofday" is not defined in MinGW.
Please wait until tomorrow until the server mirrors today's work...
greetings, Thomas
On Sun, 22 Feb 2004, Thomas Grill wrote:
Without special tools (which ones?) linking a flext.dll currently fails because the linker can't cope with the variables (garray_class etc.) exported by pd.lib . I'm happy about any ideas how to solve this
Yes, so would I. I had exactly the same problem when I tried to create an external with mingw. Really strange.
Guenter
greetings, Thomas
PD-dev mailing list PD-dev@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-dev
Hi all,
Taking a look at m_pd.h in the pd/src, it looks like if you're going to import from pd you need to have MSW defined and PD_INTERNAL not defined, or else you won't get the __declspec(dllimport) enabled for the functions marked EXTERN. So, maybe try adding -DMSW to CFLAGS will do the trick. (I always get confused when it comes to library building on windows, so a good chance this might not help).
steven
On Sun, 2004-02-22 at 07:15, guenter geiger wrote:
On Sun, 22 Feb 2004, Thomas Grill wrote:
Without special tools (which ones?) linking a flext.dll currently fails because the linker can't cope with the variables (garray_class etc.) exported by pd.lib . I'm happy about any ideas how to solve this
Yes, so would I. I had exactly the same problem when I tried to create an external with mingw. Really strange.
Guenter
greetings, Thomas
PD-dev mailing list PD-dev@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-dev
PD-dev mailing list PD-dev@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-dev
Without special tools (which ones?) linking a flext.dll currently fails because the linker can't cope with the variables (garray_class etc.) exported by pd.lib . I'm happy about any ideas how to solve this
Yes, so would I. I had exactly the same problem when I tried to create an external with mingw. Really strange.
The answer is surprisingly easy: include the dlls (and not the libs!) into the the list of input files to the linker.....
best greetings, Thomas
/cygdrive/c/pd/src/pthread.h:260: error: redefinition of `struct timespec' /usr/include/sys/types.h:100: error: previous definition of `struct timespec' /cygdrive/c/pd/src/pthread.h:482: error: conflicting types for `typedef struct pthread_t_*pthread_t'
etc...
So there's a conflict between the pthread definitions of Cygwin and PD. How can I fix this problem?
Hi Marc, this seems to be caused by the fact that PDs pthread definitions are found prior to the cygwin ones. Simply have -I/usr/include before -I/usr/local/pd/src
best greetings, Thomas