[flext] Building Flext on Windows... anyone got it working?

Jamie Bullock jamie at jamiebullock.com
Wed May 24 12:42:25 CEST 2017


Right, and the flext build system is what I’m using here. Current master branch tip. In fact I reversed the order of -lflext-pd_s -lpd so that flext links first, otherwise I get a *lot* more linker errors.

I’ll investigate that import library concept.

Jame



> On 24 May 2017, at 10:38, Thomas Grill <gr at grrrr.org> wrote:
> 
> My memory with Windows is vanishing, but as for as i remember, there is a way to generate an "import library" from the exported pd symbols, which can then be used for linking.
> I thought that this is actually integrated in the flext build system.
> best, Thomas
>  
>> Am 24.05.2017 um 11:34 schrieb Jamie Bullock <jamie at jamiebullock.com <mailto:jamie at jamiebullock.com>>:
>> 
>> 
>> Hi all…
>> 
>> I’m still having problems with this. I can get Flext to compile and produce a static library “.a” file under both MSYS and from the DOS command prompt using MINGW32…
>> 
>> 
>> However, whatever I try I always end up at the same place which is a bunch of linker errors relating to undefined Pd references:
>> 
>> c:\flext\tutorial\simple1>g++ -shared  -Wl,-S -L"c:/Program Files (x86)/pd"/bin -L"c:/Program Files (x86)/pd"/bin -L"c:/Program Files (x86)/pd"/flext -L"c:/Program Files (x86)/pd"/bin -o pd-mingw\release-single\simple1.dll   pd-mingw\release-single\main.opp  -lflext-pd_s -lpd
>> c:/Program Files (x86)/pd/flext/libflext-pd_s.a(pd-mingw/release-single/flsupport.opp):flsupport.cpp:(.text+0x1b): undefined reference to `_imp__s_'
>> c:/Program Files (x86)/pd/flext/libflext-pd_s.a(pd-mingw/release-single/flsupport.opp):flsupport.cpp:(.text+0x25): undefined reference to `_imp__s_anything'
>> c:/Program Files (x86)/pd/flext/libflext-pd_s.a(pd-mingw/release-single/flsupport.opp):flsupport.cpp:(.text+0x2f): undefined reference to `_imp__s_pointer'
>> c:/Program Files (x86)/pd/flext/libflext-pd_s.a(pd-mingw/release-single/flsupport.opp):flsupport.cpp:(.text+0x39): undefined reference to `_imp__s_float'
>> c:/Program Files (x86)/pd/flext/libflext-pd_s.a(pd-mingw/release-single/flsupport.opp):flsupport.cpp:(.text+0x43): undefined reference to `_imp__s_symbol'
>> c:/Program Files (x86)/pd/flext/libflext-pd_s.a(pd-mingw/release-single/flsupport.opp):flsupport.cpp:(.text+0x4d): undefined reference to `_imp__s_bang'
>> c:/Program Files (x86)/pd/flext/libflext-pd_s.a(pd-mingw/release-single/flsupport.opp):flsupport.cpp:(.text+0x57): undefined reference to `_imp__s_list'
>> c:/Program Files (x86)/pd/flext/libflext-pd_s.a(pd-mingw/release-single/flsupport.opp):flsupport.cpp:(.text+0x61): undefined reference to `_imp__s_signal'
>> c:/Program Files (x86)/pd/flext/libflext-pd_s.a(pd-mingw/release-single/flbuf.opp):flbuf.cpp:(.text+0x6b): undefined reference to `_imp__garray_class'
>> c:/Program Files (x86)/pd/flext/libflext-pd_s.a(pd-mingw/release-single/flbuf.opp):flbuf.cpp:(.text+0x18e): undefined reference to `_imp__garray_class'
>> collect2.exe: error: ld returned 1 exit status
>> 
>> I remember there was a linker flag to suppress these on Linux, but I don’t think it’s available on Windows…
>> 
>> Any clues?
>> 
>> Jamie
>> 
>> 
>> 
>> 
>>> On 16 May 2017, at 12:02, Jamie Bullock <jamie at jamiebullock.com <mailto:jamie at jamiebullock.com>> wrote:
>>> 
>>> 
>>> Yeah, I’m also using MinGW under MSYS, sorry if that wasn’t clear.
>>> 
>>> I couldn’t get it to build under Visual Studio either although I find VS very hard work and if you’re coming from a *n*x or Mac background MSYS is actually easier IMO.
>>> 
>>> I’m tempted to suggest any attempt to support VS is removed from Flext and MSYS/MinGW becomes the “official” way.
>>> 
>>> Will definitely post back here with instructions and possibly some binaries.
>>> 
>>> Jamie
>>> 
>>> 
>>>> On 16 May 2017, at 11:56, Cárthach Ó Nuanáin <carthach.onuanain at upf.edu <mailto:carthach.onuanain at upf.edu>> wrote:
>>>> 
>>>> Good stuff...
>>>> 
>>>> What version of MSVC are you using btw? Because I could only compile with MingW...
>>>> 
>>>> Would be good to see your instructions in any case and post them to the github...
>>>> 
>>>> C
>>>> 
>>>> On 16 May 2017 at 12:51, Jamie Bullock <jamie at jamiebullock.com <mailto:jamie at jamiebullock.com>> wrote:
>>>> Hi Cárthach,
>>>> 
>>>> Actually it seems not! I was on 32bbbbf4 which is from November last year, so I have must have missed a merge at some point.
>>>> 
>>>> Pulling in the latest HEAD, it builds under MSYS without issue, so no need for another PR.
>>>> 
>>>> Many thanks,
>>>> 
>>>> Jamie
>>>> 
>>>> 
>>>>> On 16 May 2017, at 11:01, Cárthach Ó Nuanáin <carthach.onuanain at upf.edu <mailto:carthach.onuanain at upf.edu>> wrote:
>>>>> 
>>>>> Hey Jamie,
>>>>> 
>>>>> Just so you know, those were the changes I made to get flext working on Windows with mingw a while back, in this commit:
>>>>> 
>>>>> https://github.com/grrrr/flext/commit/793392df98444adef99596d4b5e895efae9e546b <https://github.com/grrrr/flext/commit/793392df98444adef99596d4b5e895efae9e546b>
>>>>> 
>>>>> Are you on the latest commit?
>>>>> 
>>>>> C
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> On 16 May 2017 at 11:52, Thomas Grill <gr at grrrr.org <mailto:gr at grrrr.org>> wrote:
>>>>> Hi Jamie,
>>>>> great!
>>>>> A pull request is always good. It helps to try out things.
>>>>> I will try to find a general solution.
>>>>> best, Thomas
>>>>> 
>>>>>> Am 16.05.2017 um 11:50 schrieb Jamie Bullock <jamie at jamiebullock.com <mailto:jamie at jamiebullock.com>>:
>>>>>> 
>>>>>> 
>>>>>> HI again,
>>>>>> 
>>>>>> I’ve now got this building and linking on Windows. 
>>>>>> 
>>>>>> I’ll post some instructions at some point as I had to generate a VS config file and then rename it to config-win-pd-gcc.txt otherwise the build system (under MSYS) generates something more like a Mac config file.
>>>>>> 
>>>>>> Regarding the error below, I had to replace TimerVars<>::perffrq with TimerVars::perffrq and in some places perffrq with TimerVars::perffrq. I can send a pull request for this if you like? However, I think this will break builds on Windows when FLEXT_INLINE is defined. A better solution would be to either remove FLEXT_INLINE entirely or use the FLEXT_TEMPLATE macros, but I couldn’t really understand those or get them to work.
>>>>>> 
>>>>>> best,
>>>>>> 
>>>>>> Jamie
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>>> On 10 May 2017, at 23:03, Jamie Bullock <jamie at jamiebullock.com <mailto:jamie at jamiebullock.com>> wrote:
>>>>>>> 
>>>>>>> 
>>>>>>> Thanks Thomas for the quick reply.
>>>>>>> 
>>>>>>> Compiling with MSYS, I get a bit further, but it fails with:
>>>>>>> 
>>>>>>> g++ -c  -O3  -DFLEXT_USE_SIMD -DNDEBUG -DFLEXT_EXPORTS -DFLEXT_SYS=2 -DPD -D_WIN32_WINNT=0x500 -I pd-msvc/release-single -I"/c/Program Files (x86)/Pd"\src -I"/c/Program Files (x86)/Pd"/src -I"/c/Program Files (x86)/Pd"/include -I"/c/Program Files (x86)/Pd"/include/pd -I"/c/Program Files (x86)/Pd"\flext\source\lockfree  source/fltimer.cpp -o pd-msvc/release-single/fltimer.opp
>>>>>>> source/fltimer.cpp: In function 'double getstarttime()':
>>>>>>> source/fltimer.cpp:51:41: error: 'TimerVars' is not a template
>>>>>>>      if(QueryPerformanceFrequency(&frq)) TimerVars<>::perffrq = (double)frq.QuadPart;
>>>>>>>                                          ^
>>>>>>> source/fltimer.cpp:51:62: error: qualified-id in declaration before '=' token
>>>>>>>      if(QueryPerformanceFrequency(&frq)) TimerVars<>::perffrq = (double)frq.QuadPart;
>>>>>>>                                                               ^
>>>>>>> source/fltimer.cpp: In static member function 'static double flext_single::GetOSTime()':
>>>>>>> source/fltimer.cpp:64:8: error: 'perffrq' was not declared in this scope
>>>>>>>      if(perffrq && QueryPerformanceCounter(&cnt))
>>>>>>>         ^
>>>>>>> source/fltimer.cpp:65:27: error: 'TimerVars' is not a template
>>>>>>>          tm = cnt.QuadPart/TimerVars<>::perffrq;
>>>>>>>                            ^
>>>>>>> source/fltimer.cpp: In static member function 'static void flext_single::Sleep(double)':
>>>>>>> source/fltimer.cpp:109:8: error: 'perffrq' was not declared in this scope
>>>>>>>      if(perffrq && QueryPerformanceCounter(&cnt)) {
>>>>>>>         ^
>>>>>>> make[1]: *** [pd-msvc/release-single/fltimer.opp] Error 1
>>>>>>> make[1]: Leaving directory `/c/flext'
>>>>>>> make: *** [build-release-single] Error 2
>>>>>>> 
>>>>>>> 
>>>>>>> Any ideas?
>>>>>>> 
>>>>>>> 
>>>>>>>> On 10 May 2017, at 22:29, Thomas Grill <gr at grrrr.org <mailto:gr at grrrr.org>> wrote:
>>>>>>>> 
>>>>>>>> Hi Jamie,
>>>>>>>> i suggest to use a linux-like environment such as mingw, also providing gcc and other tools.
>>>>>>>> I am pretty sure that the Visual Studio or whatever it is called these days has changed enough to be incompatible with the project files that some objects provide.
>>>>>>>> best, Thomas
>>>>>>>> 
>>>>>>>> --
>>>>>>>> Thomas Grill
>>>>>>>> http://grrrr.org <http://grrrr.org/>
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>>> Am 10.05.2017 um 23:25 schrieb Jamie Bullock <jamie at jamiebullock.com <mailto:jamie at jamiebullock.com>>:
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> Hi list,
>>>>>>>>> 
>>>>>>>>> I asked about this a few years ago and didn’t manage to get Flext building on Windows, and now I’m trying again…
>>>>>>>>> 
>>>>>>>>> My first approach is to use nmake and the command line. This fails immediately compiling flbase with:
>>>>>>>>> 
>>>>>>>>>> c:\flext\source\flstdc.h(24): fatal error C1083: Cannot open include file: 'cmath': No such file or directory
>>>>>>>>> 
>>>>>>>>> Has anyone managed to compile Flext on Windows in recent years? If so, what’s the best approach? What extra steps are needed?
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> Jamie
>>>>>>>>> 
>>>>>>>>> _______________________________________________
>>>>>>>>> http://grrrr.org/ext/flext <http://grrrr.org/ext/flext>
>>>>>>>>> 
>>>>>>>>> flext mailing list
>>>>>>>>> flext at grrrr.org <mailto:flext at grrrr.org>
>>>>>>>>> http://grrrr.org/cgi-bin/mailman/listinfo/flext <http://grrrr.org/cgi-bin/mailman/listinfo/flext>
>>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> http://grrrr.org/ext/flext <http://grrrr.org/ext/flext>
>>>>> 
>>>>> flext mailing list
>>>>> flext at grrrr.org <mailto:flext at grrrr.org>
>>>>> http://grrrr.org/cgi-bin/mailman/listinfo/flext <http://grrrr.org/cgi-bin/mailman/listinfo/flext>
>>>>> 
>>>> 
>>>> 
>>> 
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://grrrr.org/pipermail/flext/attachments/20170524/e2314fbf/attachment-0001.html>


More information about the flext mailing list