Just for the sake of completeness, I followed your suggestion and checked which linker flags are actually passed for Windows. In my case it's:
gcc -static-libgcc -shared -Wl,--enable-auto-import "/c/...pd path.../bin/pd.dll" -o foo.dll foo.o I tried to link manually with them and it works! > Gesendet: Donnerstag, 07. April 2016 um 21:26 Uhr > Von: "Christof Ressi" <[email protected]> > An: "Fred Jan Kraan" <[email protected]> > Cc: [email protected] > Betreff: Re: [PD] Externals built with MSYS2/MinGW won't load > > Thanks a lot, pd-lib-builder was exactly the tool I was looking for!!! It > works perfectly and it's easy to use :-). > > > > Gesendet: Donnerstag, 07. April 2016 um 20:00 Uhr > > Von: "Fred Jan Kraan" <[email protected]> > > An: "Christof Ressi" <[email protected]> > > Cc: [email protected] > > Betreff: Re: Aw: Re: [PD] Externals built with MSYS2/MinGW won't load > > > > Hi Christof, > > > > > Hi Jan, > > > > > > thanks for your thoughts! > > > > > > There are no spaces in my path. I'm doing everything within a folder > > > called C:/pd_externals. > > > Also, I'm actually compiling for 32-bits, at least that's what I thought > > > mingw32 is supposed to do... > > > It's only the overall MSYS2 release that is 64bit. > > > > > > Anyway, if there's anyone who has compiled simple externals for Windows > > > using MINGW recently, please let me know and show me how you did it! > > > > > You might want to look on the MinGW compiler options as > > Makefile.pdlibbuilder uses them for Windows systems > > (https://github.com/pure-data/pd-lib-builder). > > A relative simple example that compiled only a few days before: > > https://github.com/electrickery/pd-maxlib > > > > Fred Jan > > > > >> Gesendet: Donnerstag, 07. April 2016 um 17:20 Uhr > > >> Von: "Fred Jan Kraan" <[email protected]> > > >> An: [email protected] > > >> Betreff: Re: [PD] Externals built with MSYS2/MinGW won't load > > >> > > >> Hi Christof, > > >> > > >>> I should add that I followed the steps given here: > > >>> > > >>> https://lists.puredata.info/pipermail/pd-list/2007-06/051560.html > > >> > > >> 2007 is quite a long time ago. I have success with this description: > > >> http://puredata.info/docs/developer/WindowsMinGW, but this is 32-bits. > > >> Is there a special reason for compiling for 64-bits? I noticed 32-bits > > >> excutables works ok on a 64-bits Windows. And all externals at deken are > > >> 32-bits... > > >>> > > >>> However, "-export_dynamic" gave me: > > >>> > > >>> C:\msys64\mingw32\bin\ld.exe: warning: cannot find entry symbol > > >>> xport_dynamic; defaulting to 10001000 > > >>> > > >>> trying "-E" and "--export-dynamic": > > >> > > >> Some time ago the gmu compiler switched to '--export-dynamic' for this > > >> option. > > >>> > > >>> C:\msys64\mingw32\bin\ld.exe: warning: --export-dynamic is not > > >>> supported for PE targets, did you mean --export-all-symbols? > > >>> > > >>> > > >>> so I tried with "--export-all-symbols" and this worked for obj1.c and > > >>> obj2.c. I can't, however, see why it doesn't work for obj3.c as the > > >>> difference to obj2.c is rather marginal (adds an outlet and a state > > >>> variable). > > >>> > > >>> Any hints are greatly appreciated! > > >> > > >> About the previous errors; make really dislikes spaces in paths. Try it > > >> with paths without spaces. > > >> > > >> Greetings & success, > > >> > > >> Fred Jan > > >>> > > >>> > > >>>> Gesendet: Donnerstag, 07. April 2016 um 02:22 Uhr > > >>>> Von: "Christof Ressi" <[email protected]> > > >>>> An: Pd-List <[email protected]> > > >>>> Betreff: [PD] Externals built with MSYS2/MinGW won't load > > >>>> > > >>>> Dear list, > > >>>> > > >>>> I tried to compile the test externals in doc/6.externs on Windows 7 > > >>>> from the command line using MSYS2/MinGW. > > >>>> I put everything (source files, m_pd.h and pd.dll) in one folder for > > >>>> the sake of convenience. > > >>>> > > >>>> I compile with > > >>>> $ gcc -c obj1.c -o obj1.o > > >>>> and link with > > >>>> $ ld --export-all-symbols -shared -o test-obj3.dll obj3.o pd.dll > > >>>> > > >>>> compiling and linking works without any errors or warnings. > > >>>> test-obj1 and test-obj2 seem to load and work fine in Pd, but for > > >>>> test-obj3 Pd console tells me: > > >>>> > > >>>> "C:\\Program Files (x86)\\pd vanilla\\extra\\stuff\\test-obj3.dll: > > >>>> couldn't load" > > >>>> > > >>>> The same thing happens when I try to build test-obj4, test-obj5 and > > >>>> test-dspobj~. > > >>>> What could be the problem? I took the source files as they were and > > >>>> built all objects the exact same way... > > >>>> > > >>>> Many thanks in advance! > > >>>> > > >>>> > > >>>> _______________________________________________ > > >>>> [email protected] mailing list > > >>>> UNSUBSCRIBE and account-management -> > > >>>> https://lists.puredata.info/listinfo/pd-list > > >>>> > > >>> > > >>> _______________________________________________ > > >>> [email protected] mailing list > > >>> UNSUBSCRIBE and account-management -> > > >>> https://lists.puredata.info/listinfo/pd-list > > >>> > > >> > > >> _______________________________________________ > > >> [email protected] mailing list > > >> UNSUBSCRIBE and account-management -> > > >> https://lists.puredata.info/listinfo/pd-list > > >> > > > > > > > _______________________________________________ > [email protected] mailing list > UNSUBSCRIBE and account-management -> > https://lists.puredata.info/listinfo/pd-list > _______________________________________________ [email protected] mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
