Csound Csound-dev Csound-tekno Search About

[Csnd-dev] MSYS2 - Failing to build portmidi driver

Date2017-06-01 04:08
FromSteven Yi
Subject[Csnd-dev] MSYS2 - Failing to build portmidi driver
Hi All,

I pulled the latest from develop and am getting errors building with
msys2. The build errors out on rtpmidi (errors pasted below). Seems
like a linking issue, but I haven't quite found what's the fix. (I'm
also travelling for the next few weeks and am intermittently looking
at Csound dev.)

Any help appreciated!
steven

[ 78%] Linking C shared module ../pmidi.dll
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x38):
undefined reference to `__imp_midiInStop'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x4e):
undefined reference to `__imp_midiInReset'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x5d):
undefined reference to `__imp_midiInClose'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x92):
undefined reference to `__imp_midiInReset'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x9b):
undefined reference to `__imp_midiInClose'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa3):
undefined reference to `__imp_midiInClose'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcf):
undefined reference to `__imp_midiInGetErrorTextA'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x17a):
undefined reference to `__imp_midiInUnprepareHeader'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x213):
undefined reference to `__imp_midiInPrepareHeader'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x225):
undefined reference to `__imp_midiInAddBuffer'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x24c):
undefined reference to `__imp_midiStreamStop'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2a2):
undefined reference to `__imp_midiOutUnprepareHeader'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2e1):
undefined reference to `__imp_midiOutPrepareHeader'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x326):
undefined reference to `__imp_midiStreamOut'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x368):
undefined reference to `__imp_midiOutLongMsg'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x3b7):
undefined reference to `__imp_midiStreamPosition'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x600):
undefined reference to `__imp_midiOutGetErrorTextA'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x646):
undefined reference to `__imp_midiInGetErrorTextA'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x734):
undefined reference to `__imp_midiInOpen'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x755):
undefined reference to `__imp_midiInPrepareHeader'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x78e):
undefined reference to `__imp_midiInAddBuffer'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x815):
undefined reference to `__imp_midiInClose'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x855):
undefined reference to `__imp_midiInStart'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x865):
undefined reference to `__imp_midiInReset'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x884):
undefined reference to `__imp_midiInGetErrorTextA'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x97a):
undefined reference to `__imp_midiStreamOpen'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa9b):
undefined reference to `__imp_midiOutClose'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xaeb):
undefined reference to `__imp_midiOutOpen'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb0f):
undefined reference to `__imp_midiOutGetErrorTextA'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb4d):
undefined reference to `__imp_midiStreamProperty'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xbc5):
undefined reference to `__imp_midiStreamRestart'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xc11):
undefined reference to `__imp_midiStreamClose'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcb2):
undefined reference to `__imp_midiOutClose'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcd5):
undefined reference to `__imp_midiOutGetErrorTextA'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd27):
undefined reference to `__imp_midiOutPrepareHeader'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd66):
undefined reference to `__imp_midiStreamOut'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xdc9):
undefined reference to `__imp_midiOutLongMsg'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe56):
undefined reference to `__imp_midiOutPrepareHeader'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe88):
undefined reference to `__imp_midiOutLongMsg'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xefb):
undefined reference to `__imp_midiStreamOut'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1038):
undefined reference to `__imp_midiOutPrepareHeader'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1066):
undefined reference to `__imp_midiOutLongMsg'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x108a):
undefined reference to `__imp_midiOutShortMsg'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x10cb):
undefined reference to `__imp_midiStreamOut'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x110f):
undefined reference to `__imp_midiInGetDevCapsA'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x115a):
undefined reference to `__imp_midiOutGetDevCapsA'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x118f):
undefined reference to `__imp_midiInGetNumDevs'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1244):
undefined reference to `__imp_midiOutGetNumDevs'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x12):
undefined reference to `__imp_timeGetTime'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x50):
undefined reference to `__imp_timeBeginPeriod'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x5c):
undefined reference to `__imp_timeGetTime'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x97):
undefined reference to `__imp_timeSetEvent'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0xf4):
undefined reference to `__imp_timeEndPeriod'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x102):
undefined reference to `__imp_timeKillEvent'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x146):
undefined reference to `__imp_timeGetTime'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [InOut/CMakeFiles/pmidi.dir/build.make:98: pmidi.dll] Error 1
make[1]: *** [CMakeFiles/Makefile2:1728: InOut/CMakeFiles/pmidi.dir/all] Error 2

Date2017-06-01 08:37
FromVictor Lazzarini
SubjectRe: [Csnd-dev] MSYS2 - Failing to build portmidi driver
Looks like you might be missing the winmm.dll (or whatever it is called), the windows MM library.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 1 Jun 2017, at 04:08, Steven Yi  wrote:
> 
> Hi All,
> 
> I pulled the latest from develop and am getting errors building with
> msys2. The build errors out on rtpmidi (errors pasted below). Seems
> like a linking issue, but I haven't quite found what's the fix. (I'm
> also travelling for the next few weeks and am intermittently looking
> at Csound dev.)
> 
> Any help appreciated!
> steven
> 
> [ 78%] Linking C shared module ../pmidi.dll
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x38):
> undefined reference to `__imp_midiInStop'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x4e):
> undefined reference to `__imp_midiInReset'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x5d):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x92):
> undefined reference to `__imp_midiInReset'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x9b):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa3):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcf):
> undefined reference to `__imp_midiInGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x17a):
> undefined reference to `__imp_midiInUnprepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x213):
> undefined reference to `__imp_midiInPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x225):
> undefined reference to `__imp_midiInAddBuffer'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x24c):
> undefined reference to `__imp_midiStreamStop'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2a2):
> undefined reference to `__imp_midiOutUnprepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2e1):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x326):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x368):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x3b7):
> undefined reference to `__imp_midiStreamPosition'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x600):
> undefined reference to `__imp_midiOutGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x646):
> undefined reference to `__imp_midiInGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x734):
> undefined reference to `__imp_midiInOpen'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x755):
> undefined reference to `__imp_midiInPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x78e):
> undefined reference to `__imp_midiInAddBuffer'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x815):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x855):
> undefined reference to `__imp_midiInStart'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x865):
> undefined reference to `__imp_midiInReset'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x884):
> undefined reference to `__imp_midiInGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x97a):
> undefined reference to `__imp_midiStreamOpen'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa9b):
> undefined reference to `__imp_midiOutClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xaeb):
> undefined reference to `__imp_midiOutOpen'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb0f):
> undefined reference to `__imp_midiOutGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb4d):
> undefined reference to `__imp_midiStreamProperty'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xbc5):
> undefined reference to `__imp_midiStreamRestart'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xc11):
> undefined reference to `__imp_midiStreamClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcb2):
> undefined reference to `__imp_midiOutClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcd5):
> undefined reference to `__imp_midiOutGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd27):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd66):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xdc9):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe56):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe88):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xefb):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1038):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1066):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x108a):
> undefined reference to `__imp_midiOutShortMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x10cb):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x110f):
> undefined reference to `__imp_midiInGetDevCapsA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x115a):
> undefined reference to `__imp_midiOutGetDevCapsA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x118f):
> undefined reference to `__imp_midiInGetNumDevs'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1244):
> undefined reference to `__imp_midiOutGetNumDevs'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x12):
> undefined reference to `__imp_timeGetTime'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x50):
> undefined reference to `__imp_timeBeginPeriod'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x5c):
> undefined reference to `__imp_timeGetTime'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x97):
> undefined reference to `__imp_timeSetEvent'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0xf4):
> undefined reference to `__imp_timeEndPeriod'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x102):
> undefined reference to `__imp_timeKillEvent'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x146):
> undefined reference to `__imp_timeGetTime'
> collect2.exe: error: ld returned 1 exit status
> make[2]: *** [InOut/CMakeFiles/pmidi.dir/build.make:98: pmidi.dll] Error 1
> make[1]: *** [CMakeFiles/Makefile2:1728: InOut/CMakeFiles/pmidi.dir/all] Error 2

Date2017-06-01 09:18
FromStephen Kyne
SubjectRe: [Csnd-dev] MSYS2 - Failing to build portmidi driver

Looks like it's missing the Winmm.lib?

https://msdn.microsoft.com/en-us/library/windows/desktop/dd798464(v=vs.85).aspx


Stephen


From: Csound-developers <CSOUND-DEV@LISTSERV.HEANET.IE> on behalf of Steven Yi <stevenyi@GMAIL.COM>
Sent: 01 June 2017 04:08
To: CSOUND-DEV@LISTSERV.HEANET.IE
Subject: [Csnd-dev] MSYS2 - Failing to build portmidi driver
 
Hi All,

I pulled the latest from develop and am getting errors building with
msys2. The build errors out on rtpmidi (errors pasted below). Seems
like a linking issue, but I haven't quite found what's the fix. (I'm
also travelling for the next few weeks and am intermittently looking
at Csound dev.)

Any help appreciated!
steven

[ 78%] Linking C shared module ../pmidi.dll
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x38):
undefined reference to `__imp_midiInStop'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x4e):
undefined reference to `__imp_midiInReset'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x5d):
undefined reference to `__imp_midiInClose'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x92):
undefined reference to `__imp_midiInReset'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x9b):
undefined reference to `__imp_midiInClose'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa3):
undefined reference to `__imp_midiInClose'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcf):
undefined reference to `__imp_midiInGetErrorTextA'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x17a):
undefined reference to `__imp_midiInUnprepareHeader'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x213):
undefined reference to `__imp_midiInPrepareHeader'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x225):
undefined reference to `__imp_midiInAddBuffer'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x24c):
undefined reference to `__imp_midiStreamStop'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2a2):
undefined reference to `__imp_midiOutUnprepareHeader'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2e1):
undefined reference to `__imp_midiOutPrepareHeader'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x326):
undefined reference to `__imp_midiStreamOut'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x368):
undefined reference to `__imp_midiOutLongMsg'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x3b7):
undefined reference to `__imp_midiStreamPosition'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x600):
undefined reference to `__imp_midiOutGetErrorTextA'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x646):
undefined reference to `__imp_midiInGetErrorTextA'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x734):
undefined reference to `__imp_midiInOpen'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x755):
undefined reference to `__imp_midiInPrepareHeader'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x78e):
undefined reference to `__imp_midiInAddBuffer'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x815):
undefined reference to `__imp_midiInClose'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x855):
undefined reference to `__imp_midiInStart'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x865):
undefined reference to `__imp_midiInReset'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x884):
undefined reference to `__imp_midiInGetErrorTextA'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x97a):
undefined reference to `__imp_midiStreamOpen'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa9b):
undefined reference to `__imp_midiOutClose'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xaeb):
undefined reference to `__imp_midiOutOpen'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb0f):
undefined reference to `__imp_midiOutGetErrorTextA'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb4d):
undefined reference to `__imp_midiStreamProperty'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xbc5):
undefined reference to `__imp_midiStreamRestart'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xc11):
undefined reference to `__imp_midiStreamClose'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcb2):
undefined reference to `__imp_midiOutClose'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcd5):
undefined reference to `__imp_midiOutGetErrorTextA'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd27):
undefined reference to `__imp_midiOutPrepareHeader'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd66):
undefined reference to `__imp_midiStreamOut'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xdc9):
undefined reference to `__imp_midiOutLongMsg'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe56):
undefined reference to `__imp_midiOutPrepareHeader'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe88):
undefined reference to `__imp_midiOutLongMsg'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xefb):
undefined reference to `__imp_midiStreamOut'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1038):
undefined reference to `__imp_midiOutPrepareHeader'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1066):
undefined reference to `__imp_midiOutLongMsg'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x108a):
undefined reference to `__imp_midiOutShortMsg'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x10cb):
undefined reference to `__imp_midiStreamOut'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x110f):
undefined reference to `__imp_midiInGetDevCapsA'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x115a):
undefined reference to `__imp_midiOutGetDevCapsA'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x118f):
undefined reference to `__imp_midiInGetNumDevs'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1244):
undefined reference to `__imp_midiOutGetNumDevs'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x12):
undefined reference to `__imp_timeGetTime'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x50):
undefined reference to `__imp_timeBeginPeriod'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x5c):
undefined reference to `__imp_timeGetTime'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x97):
undefined reference to `__imp_timeSetEvent'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0xf4):
undefined reference to `__imp_timeEndPeriod'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x102):
undefined reference to `__imp_timeKillEvent'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x146):
undefined reference to `__imp_timeGetTime'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [InOut/CMakeFiles/pmidi.dir/build.make:98: pmidi.dll] Error 1
make[1]: *** [CMakeFiles/Makefile2:1728: InOut/CMakeFiles/pmidi.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

Date2017-06-01 17:28
FromSteven Yi
SubjectRe: [Csnd-dev] MSYS2 - Failing to build portmidi driver
The flags had -lwinmm.  However, even worse, I deleted my
CMakeCache.txt and retried a build using ./build.sh and the build is a
mess now. I get linker problems for both fluidOpcodes and csound64
(the latter pasted below).  I feel like these were problems that were
solved a while ago but reintroduced.

Could someone else building with MSYS2 do a clean build and let me
know if you're also getting errors?

[Link command]

/C/msys64/mingw64/bin/gcc.exe   -mfpmath=sse -msse2
-fomit-frame-pointer -mstackrealign -static-libgcc -static
-fvisibility=hidden -DHAVE_PTHREAD -O2 -g -DNDEBUG  -static-libstdc++
-static-libgcc -static -shared -o csound64.dll
-Wl,--out-implib,libcsound64.dll.a
-Wl,--major-image-version,0,--minor-image-version,0
-Wl,--whole-archive CMakeFiles/csound64.dir/objects.a
-Wl,--no-whole-archive ../../msvc/deps/lib/libsndfile.dll.a
/C/msys64/usr/lib/libpthread.a -ladvapi32 -lcomctl32 -lcomdlg32
-lglu32 -lkernel32 -lmsvcrt -lodbc32 -lodbccp32 -lole32 -loleaut32
-lshell32 -luser32 -luuid -lwinmm -lwinspool -lws2_32 -lwsock32
-ladvapi32 -lcomctl32 -lcomdlg32 -lglu32 -lkernel32 -lodbc32
-lodbccp32 -lole32 -loleaut32 -lshell32 -luser32 -luuid -lwinmm
-lwinspool -lws2_32 -lwsock32 -lvorbis -lvorbisenc -lspeex -lFLAC
-logg -lcurl -lmsvcrt -lvorbis -lvorbisenc -lspeex -lFLAC -logg -lcurl
-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32
-luuid -lcomdlg32 -ladvapi32

[output]

[ 35%] Built target csound64-static
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x80):
multiple definition of `pthread_mutex_lock'
C:/msys64/usr/lib/libpthread.a(t-d001062.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x350):
multiple definition of `pthread_mutex_unlock'
C:/msys64/usr/lib/libpthread.a(t-d001065.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x410):
multiple definition of `pthread_mutex_trylock'
C:/msys64/usr/lib/libpthread.a(t-d001064.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x4a0):
multiple definition of `pthread_mutex_init'
C:/msys64/usr/lib/libpthread.a(t-d001061.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x4f0):
multiple definition of `pthread_mutex_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001059.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x530):
multiple definition of `pthread_mutexattr_init'
C:/msys64/usr/lib/libpthread.a(t-d001071.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x540):
multiple definition of `pthread_mutexattr_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001066.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x570):
multiple definition of `pthread_mutexattr_settype'
C:/msys64/usr/lib/libpthread.a(t-d001075.o):fake:(.text+0x0): first defined here
C:/msys64/usr/lib/libpthread.a(t-d001023.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_barrier_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001024.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_barrier_init'
C:/msys64/usr/lib/libpthread.a(t-d001025.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_barrier_wait'
C:/msys64/usr/lib/libpthread.a(t-d001033.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_cond_init'
C:/msys64/usr/lib/libpthread.a(t-d001034.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_cond_signal'
C:/msys64/usr/lib/libpthread.a(t-d001036.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_cond_wait'
C:/msys64/usr/lib/libpthread.a(t-d001044.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_create'
C:/msys64/usr/lib/libpthread.a(t-d001046.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_equal'
C:/msys64/usr/lib/libpthread.a(t-d001055.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_join'
C:/msys64/usr/lib/libpthread.a(t-d001059.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001061.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_init'
C:/msys64/usr/lib/libpthread.a(t-d001062.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_lock'
C:/msys64/usr/lib/libpthread.a(t-d001064.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_trylock'
C:/msys64/usr/lib/libpthread.a(t-d001065.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_unlock'
C:/msys64/usr/lib/libpthread.a(t-d001066.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutexattr_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001071.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutexattr_init'
C:/msys64/usr/lib/libpthread.a(t-d001075.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutexattr_settype'
C:/msys64/usr/lib/libpthread.a(t-d001088.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_self'
C:/msys64/usr/lib/libpthread.a(t-d001099.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_spin_init'
C:/msys64/usr/lib/libpthread.a(t-d001100.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_spin_lock'
C:/msys64/usr/lib/libpthread.a(t-d001102.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_spin_unlock'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/csound64.dir/build.make:5954: csound64.dll] Error 1
make[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/csound64.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
Failed to run make.

On Thu, Jun 1, 2017 at 2:18 AM, Stephen Kyne  wrote:
> Looks like it's missing the Winmm.lib?
>
> https://msdn.microsoft.com/en-us/library/windows/desktop/dd798464(v=vs.85).aspx
>
>
> Stephen
>
> ________________________________
> From: Csound-developers  on behalf of Steven
> Yi 
> Sent: 01 June 2017 04:08
> To: CSOUND-DEV@LISTSERV.HEANET.IE
> Subject: [Csnd-dev] MSYS2 - Failing to build portmidi driver
>
> Hi All,
>
> I pulled the latest from develop and am getting errors building with
> msys2. The build errors out on rtpmidi (errors pasted below). Seems
> like a linking issue, but I haven't quite found what's the fix. (I'm
> also travelling for the next few weeks and am intermittently looking
> at Csound dev.)
>
> Any help appreciated!
> steven
>
> [ 78%] Linking C shared module ../pmidi.dll
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x38):
> undefined reference to `__imp_midiInStop'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x4e):
> undefined reference to `__imp_midiInReset'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x5d):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x92):
> undefined reference to `__imp_midiInReset'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x9b):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa3):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcf):
> undefined reference to `__imp_midiInGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x17a):
> undefined reference to `__imp_midiInUnprepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x213):
> undefined reference to `__imp_midiInPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x225):
> undefined reference to `__imp_midiInAddBuffer'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x24c):
> undefined reference to `__imp_midiStreamStop'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2a2):
> undefined reference to `__imp_midiOutUnprepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2e1):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x326):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x368):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x3b7):
> undefined reference to `__imp_midiStreamPosition'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x600):
> undefined reference to `__imp_midiOutGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x646):
> undefined reference to `__imp_midiInGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x734):
> undefined reference to `__imp_midiInOpen'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x755):
> undefined reference to `__imp_midiInPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x78e):
> undefined reference to `__imp_midiInAddBuffer'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x815):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x855):
> undefined reference to `__imp_midiInStart'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x865):
> undefined reference to `__imp_midiInReset'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x884):
> undefined reference to `__imp_midiInGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x97a):
> undefined reference to `__imp_midiStreamOpen'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa9b):
> undefined reference to `__imp_midiOutClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xaeb):
> undefined reference to `__imp_midiOutOpen'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb0f):
> undefined reference to `__imp_midiOutGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb4d):
> undefined reference to `__imp_midiStreamProperty'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xbc5):
> undefined reference to `__imp_midiStreamRestart'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xc11):
> undefined reference to `__imp_midiStreamClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcb2):
> undefined reference to `__imp_midiOutClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcd5):
> undefined reference to `__imp_midiOutGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd27):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd66):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xdc9):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe56):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe88):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xefb):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1038):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1066):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x108a):
> undefined reference to `__imp_midiOutShortMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x10cb):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x110f):
> undefined reference to `__imp_midiInGetDevCapsA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x115a):
> undefined reference to `__imp_midiOutGetDevCapsA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x118f):
> undefined reference to `__imp_midiInGetNumDevs'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1244):
> undefined reference to `__imp_midiOutGetNumDevs'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x12):
> undefined reference to `__imp_timeGetTime'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x50):
> undefined reference to `__imp_timeBeginPeriod'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x5c):
> undefined reference to `__imp_timeGetTime'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x97):
> undefined reference to `__imp_timeSetEvent'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0xf4):
> undefined reference to `__imp_timeEndPeriod'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x102):
> undefined reference to `__imp_timeKillEvent'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x146):
> undefined reference to `__imp_timeGetTime'
> collect2.exe: error: ld returned 1 exit status
> make[2]: *** [InOut/CMakeFiles/pmidi.dir/build.make:98: pmidi.dll] Error 1
> make[1]: *** [CMakeFiles/Makefile2:1728: InOut/CMakeFiles/pmidi.dir/all]
> Error 2

Date2017-06-01 17:46
FromRory Walsh
SubjectRe: [Csnd-dev] MSYS2 - Failing to build portmidi driver
I haven't been able to build with msys in quite a while so I can't be of much use.

On 1 Jun 2017 5:28 p.m., "Steven Yi" <stevenyi@gmail.com> wrote:
The flags had -lwinmm.  However, even worse, I deleted my
CMakeCache.txt and retried a build using ./build.sh and the build is a
mess now. I get linker problems for both fluidOpcodes and csound64
(the latter pasted below).  I feel like these were problems that were
solved a while ago but reintroduced.

Could someone else building with MSYS2 do a clean build and let me
know if you're also getting errors?

[Link command]

/C/msys64/mingw64/bin/gcc.exe   -mfpmath=sse -msse2
-fomit-frame-pointer -mstackrealign -static-libgcc -static
-fvisibility=hidden -DHAVE_PTHREAD -O2 -g -DNDEBUG  -static-libstdc++
-static-libgcc -static -shared -o csound64.dll
-Wl,--out-implib,libcsound64.dll.a
-Wl,--major-image-version,0,--minor-image-version,0
-Wl,--whole-archive CMakeFiles/csound64.dir/objects.a
-Wl,--no-whole-archive ../../msvc/deps/lib/libsndfile.dll.a
/C/msys64/usr/lib/libpthread.a -ladvapi32 -lcomctl32 -lcomdlg32
-lglu32 -lkernel32 -lmsvcrt -lodbc32 -lodbccp32 -lole32 -loleaut32
-lshell32 -luser32 -luuid -lwinmm -lwinspool -lws2_32 -lwsock32
-ladvapi32 -lcomctl32 -lcomdlg32 -lglu32 -lkernel32 -lodbc32
-lodbccp32 -lole32 -loleaut32 -lshell32 -luser32 -luuid -lwinmm
-lwinspool -lws2_32 -lwsock32 -lvorbis -lvorbisenc -lspeex -lFLAC
-logg -lcurl -lmsvcrt -lvorbis -lvorbisenc -lspeex -lFLAC -logg -lcurl
-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32
-luuid -lcomdlg32 -ladvapi32

[output]

[ 35%] Built target csound64-static
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x80):
multiple definition of `pthread_mutex_lock'
C:/msys64/usr/lib/libpthread.a(t-d001062.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x350):
multiple definition of `pthread_mutex_unlock'
C:/msys64/usr/lib/libpthread.a(t-d001065.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x410):
multiple definition of `pthread_mutex_trylock'
C:/msys64/usr/lib/libpthread.a(t-d001064.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x4a0):
multiple definition of `pthread_mutex_init'
C:/msys64/usr/lib/libpthread.a(t-d001061.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x4f0):
multiple definition of `pthread_mutex_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001059.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x530):
multiple definition of `pthread_mutexattr_init'
C:/msys64/usr/lib/libpthread.a(t-d001071.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x540):
multiple definition of `pthread_mutexattr_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001066.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x570):
multiple definition of `pthread_mutexattr_settype'
C:/msys64/usr/lib/libpthread.a(t-d001075.o):fake:(.text+0x0): first defined here
C:/msys64/usr/lib/libpthread.a(t-d001023.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_barrier_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001024.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_barrier_init'
C:/msys64/usr/lib/libpthread.a(t-d001025.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_barrier_wait'
C:/msys64/usr/lib/libpthread.a(t-d001033.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_cond_init'
C:/msys64/usr/lib/libpthread.a(t-d001034.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_cond_signal'
C:/msys64/usr/lib/libpthread.a(t-d001036.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_cond_wait'
C:/msys64/usr/lib/libpthread.a(t-d001044.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_create'
C:/msys64/usr/lib/libpthread.a(t-d001046.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_equal'
C:/msys64/usr/lib/libpthread.a(t-d001055.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_join'
C:/msys64/usr/lib/libpthread.a(t-d001059.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001061.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_init'
C:/msys64/usr/lib/libpthread.a(t-d001062.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_lock'
C:/msys64/usr/lib/libpthread.a(t-d001064.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_trylock'
C:/msys64/usr/lib/libpthread.a(t-d001065.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_unlock'
C:/msys64/usr/lib/libpthread.a(t-d001066.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutexattr_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001071.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutexattr_init'
C:/msys64/usr/lib/libpthread.a(t-d001075.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutexattr_settype'
C:/msys64/usr/lib/libpthread.a(t-d001088.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_self'
C:/msys64/usr/lib/libpthread.a(t-d001099.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_spin_init'
C:/msys64/usr/lib/libpthread.a(t-d001100.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_spin_lock'
C:/msys64/usr/lib/libpthread.a(t-d001102.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_spin_unlock'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/csound64.dir/build.make:5954: csound64.dll] Error 1
make[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/csound64.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
Failed to run make.

On Thu, Jun 1, 2017 at 2:18 AM, Stephen Kyne <stevek@outlook.ie> wrote:
> Looks like it's missing the Winmm.lib?
>
> https://msdn.microsoft.com/en-us/library/windows/desktop/dd798464(v=vs.85).aspx
>
>
> Stephen
>
> ________________________________
> From: Csound-developers <CSOUND-DEV@LISTSERV.HEANET.IE> on behalf of Steven
> Yi <stevenyi@GMAIL.COM>
> Sent: 01 June 2017 04:08
> To: CSOUND-DEV@LISTSERV.HEANET.IE
> Subject: [Csnd-dev] MSYS2 - Failing to build portmidi driver
>
> Hi All,
>
> I pulled the latest from develop and am getting errors building with
> msys2. The build errors out on rtpmidi (errors pasted below). Seems
> like a linking issue, but I haven't quite found what's the fix. (I'm
> also travelling for the next few weeks and am intermittently looking
> at Csound dev.)
>
> Any help appreciated!
> steven
>
> [ 78%] Linking C shared module ../pmidi.dll
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x38):
> undefined reference to `__imp_midiInStop'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x4e):
> undefined reference to `__imp_midiInReset'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x5d):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x92):
> undefined reference to `__imp_midiInReset'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x9b):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa3):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcf):
> undefined reference to `__imp_midiInGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x17a):
> undefined reference to `__imp_midiInUnprepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x213):
> undefined reference to `__imp_midiInPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x225):
> undefined reference to `__imp_midiInAddBuffer'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x24c):
> undefined reference to `__imp_midiStreamStop'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2a2):
> undefined reference to `__imp_midiOutUnprepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2e1):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x326):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x368):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x3b7):
> undefined reference to `__imp_midiStreamPosition'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x600):
> undefined reference to `__imp_midiOutGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x646):
> undefined reference to `__imp_midiInGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x734):
> undefined reference to `__imp_midiInOpen'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x755):
> undefined reference to `__imp_midiInPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x78e):
> undefined reference to `__imp_midiInAddBuffer'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x815):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x855):
> undefined reference to `__imp_midiInStart'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x865):
> undefined reference to `__imp_midiInReset'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x884):
> undefined reference to `__imp_midiInGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x97a):
> undefined reference to `__imp_midiStreamOpen'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa9b):
> undefined reference to `__imp_midiOutClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xaeb):
> undefined reference to `__imp_midiOutOpen'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb0f):
> undefined reference to `__imp_midiOutGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb4d):
> undefined reference to `__imp_midiStreamProperty'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xbc5):
> undefined reference to `__imp_midiStreamRestart'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xc11):
> undefined reference to `__imp_midiStreamClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcb2):
> undefined reference to `__imp_midiOutClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcd5):
> undefined reference to `__imp_midiOutGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd27):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd66):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xdc9):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe56):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe88):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xefb):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1038):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1066):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x108a):
> undefined reference to `__imp_midiOutShortMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x10cb):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x110f):
> undefined reference to `__imp_midiInGetDevCapsA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x115a):
> undefined reference to `__imp_midiOutGetDevCapsA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x118f):
> undefined reference to `__imp_midiInGetNumDevs'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1244):
> undefined reference to `__imp_midiOutGetNumDevs'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x12):
> undefined reference to `__imp_timeGetTime'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x50):
> undefined reference to `__imp_timeBeginPeriod'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x5c):
> undefined reference to `__imp_timeGetTime'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x97):
> undefined reference to `__imp_timeSetEvent'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0xf4):
> undefined reference to `__imp_timeEndPeriod'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x102):
> undefined reference to `__imp_timeKillEvent'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x146):
> undefined reference to `__imp_timeGetTime'
> collect2.exe: error: ld returned 1 exit status
> make[2]: *** [InOut/CMakeFiles/pmidi.dir/build.make:98: pmidi.dll] Error 1
> make[1]: *** [CMakeFiles/Makefile2:1728: InOut/CMakeFiles/pmidi.dir/all]
> Error 2
> make: *** [Makefile:163: all] Error 2

Date2017-06-01 22:23
FromMichael Gogins
SubjectRe: [Csnd-dev] MSYS2 - Failing to build portmidi driver
See if you need the porttime library now.

On Jun 1, 2017 12:28, "Steven Yi" <stevenyi@gmail.com> wrote:
The flags had -lwinmm.  However, even worse, I deleted my
CMakeCache.txt and retried a build using ./build.sh and the build is a
mess now. I get linker problems for both fluidOpcodes and csound64
(the latter pasted below).  I feel like these were problems that were
solved a while ago but reintroduced.

Could someone else building with MSYS2 do a clean build and let me
know if you're also getting errors?

[Link command]

/C/msys64/mingw64/bin/gcc.exe   -mfpmath=sse -msse2
-fomit-frame-pointer -mstackrealign -static-libgcc -static
-fvisibility=hidden -DHAVE_PTHREAD -O2 -g -DNDEBUG  -static-libstdc++
-static-libgcc -static -shared -o csound64.dll
-Wl,--out-implib,libcsound64.dll.a
-Wl,--major-image-version,0,--minor-image-version,0
-Wl,--whole-archive CMakeFiles/csound64.dir/objects.a
-Wl,--no-whole-archive ../../msvc/deps/lib/libsndfile.dll.a
/C/msys64/usr/lib/libpthread.a -ladvapi32 -lcomctl32 -lcomdlg32
-lglu32 -lkernel32 -lmsvcrt -lodbc32 -lodbccp32 -lole32 -loleaut32
-lshell32 -luser32 -luuid -lwinmm -lwinspool -lws2_32 -lwsock32
-ladvapi32 -lcomctl32 -lcomdlg32 -lglu32 -lkernel32 -lodbc32
-lodbccp32 -lole32 -loleaut32 -lshell32 -luser32 -luuid -lwinmm
-lwinspool -lws2_32 -lwsock32 -lvorbis -lvorbisenc -lspeex -lFLAC
-logg -lcurl -lmsvcrt -lvorbis -lvorbisenc -lspeex -lFLAC -logg -lcurl
-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32
-luuid -lcomdlg32 -ladvapi32

[output]

[ 35%] Built target csound64-static
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x80):
multiple definition of `pthread_mutex_lock'
C:/msys64/usr/lib/libpthread.a(t-d001062.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x350):
multiple definition of `pthread_mutex_unlock'
C:/msys64/usr/lib/libpthread.a(t-d001065.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x410):
multiple definition of `pthread_mutex_trylock'
C:/msys64/usr/lib/libpthread.a(t-d001064.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x4a0):
multiple definition of `pthread_mutex_init'
C:/msys64/usr/lib/libpthread.a(t-d001061.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x4f0):
multiple definition of `pthread_mutex_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001059.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x530):
multiple definition of `pthread_mutexattr_init'
C:/msys64/usr/lib/libpthread.a(t-d001071.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x540):
multiple definition of `pthread_mutexattr_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001066.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x570):
multiple definition of `pthread_mutexattr_settype'
C:/msys64/usr/lib/libpthread.a(t-d001075.o):fake:(.text+0x0): first defined here
C:/msys64/usr/lib/libpthread.a(t-d001023.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_barrier_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001024.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_barrier_init'
C:/msys64/usr/lib/libpthread.a(t-d001025.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_barrier_wait'
C:/msys64/usr/lib/libpthread.a(t-d001033.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_cond_init'
C:/msys64/usr/lib/libpthread.a(t-d001034.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_cond_signal'
C:/msys64/usr/lib/libpthread.a(t-d001036.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_cond_wait'
C:/msys64/usr/lib/libpthread.a(t-d001044.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_create'
C:/msys64/usr/lib/libpthread.a(t-d001046.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_equal'
C:/msys64/usr/lib/libpthread.a(t-d001055.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_join'
C:/msys64/usr/lib/libpthread.a(t-d001059.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001061.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_init'
C:/msys64/usr/lib/libpthread.a(t-d001062.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_lock'
C:/msys64/usr/lib/libpthread.a(t-d001064.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_trylock'
C:/msys64/usr/lib/libpthread.a(t-d001065.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_unlock'
C:/msys64/usr/lib/libpthread.a(t-d001066.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutexattr_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001071.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutexattr_init'
C:/msys64/usr/lib/libpthread.a(t-d001075.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutexattr_settype'
C:/msys64/usr/lib/libpthread.a(t-d001088.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_self'
C:/msys64/usr/lib/libpthread.a(t-d001099.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_spin_init'
C:/msys64/usr/lib/libpthread.a(t-d001100.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_spin_lock'
C:/msys64/usr/lib/libpthread.a(t-d001102.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_spin_unlock'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/csound64.dir/build.make:5954: csound64.dll] Error 1
make[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/csound64.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
Failed to run make.

On Thu, Jun 1, 2017 at 2:18 AM, Stephen Kyne <stevek@outlook.ie> wrote:
> Looks like it's missing the Winmm.lib?
>
> https://msdn.microsoft.com/en-us/library/windows/desktop/dd798464(v=vs.85).aspx
>
>
> Stephen
>
> ________________________________
> From: Csound-developers <CSOUND-DEV@LISTSERV.HEANET.IE> on behalf of Steven
> Yi <stevenyi@GMAIL.COM>
> Sent: 01 June 2017 04:08
> To: CSOUND-DEV@LISTSERV.HEANET.IE
> Subject: [Csnd-dev] MSYS2 - Failing to build portmidi driver
>
> Hi All,
>
> I pulled the latest from develop and am getting errors building with
> msys2. The build errors out on rtpmidi (errors pasted below). Seems
> like a linking issue, but I haven't quite found what's the fix. (I'm
> also travelling for the next few weeks and am intermittently looking
> at Csound dev.)
>
> Any help appreciated!
> steven
>
> [ 78%] Linking C shared module ../pmidi.dll
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x38):
> undefined reference to `__imp_midiInStop'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x4e):
> undefined reference to `__imp_midiInReset'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x5d):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x92):
> undefined reference to `__imp_midiInReset'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x9b):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa3):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcf):
> undefined reference to `__imp_midiInGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x17a):
> undefined reference to `__imp_midiInUnprepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x213):
> undefined reference to `__imp_midiInPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x225):
> undefined reference to `__imp_midiInAddBuffer'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x24c):
> undefined reference to `__imp_midiStreamStop'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2a2):
> undefined reference to `__imp_midiOutUnprepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2e1):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x326):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x368):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x3b7):
> undefined reference to `__imp_midiStreamPosition'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x600):
> undefined reference to `__imp_midiOutGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x646):
> undefined reference to `__imp_midiInGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x734):
> undefined reference to `__imp_midiInOpen'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x755):
> undefined reference to `__imp_midiInPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x78e):
> undefined reference to `__imp_midiInAddBuffer'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x815):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x855):
> undefined reference to `__imp_midiInStart'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x865):
> undefined reference to `__imp_midiInReset'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x884):
> undefined reference to `__imp_midiInGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x97a):
> undefined reference to `__imp_midiStreamOpen'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa9b):
> undefined reference to `__imp_midiOutClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xaeb):
> undefined reference to `__imp_midiOutOpen'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb0f):
> undefined reference to `__imp_midiOutGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb4d):
> undefined reference to `__imp_midiStreamProperty'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xbc5):
> undefined reference to `__imp_midiStreamRestart'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xc11):
> undefined reference to `__imp_midiStreamClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcb2):
> undefined reference to `__imp_midiOutClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcd5):
> undefined reference to `__imp_midiOutGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd27):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd66):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xdc9):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe56):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe88):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xefb):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1038):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1066):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x108a):
> undefined reference to `__imp_midiOutShortMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x10cb):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x110f):
> undefined reference to `__imp_midiInGetDevCapsA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x115a):
> undefined reference to `__imp_midiOutGetDevCapsA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x118f):
> undefined reference to `__imp_midiInGetNumDevs'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1244):
> undefined reference to `__imp_midiOutGetNumDevs'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x12):
> undefined reference to `__imp_timeGetTime'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x50):
> undefined reference to `__imp_timeBeginPeriod'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x5c):
> undefined reference to `__imp_timeGetTime'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x97):
> undefined reference to `__imp_timeSetEvent'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0xf4):
> undefined reference to `__imp_timeEndPeriod'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x102):
> undefined reference to `__imp_timeKillEvent'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x146):
> undefined reference to `__imp_timeGetTime'
> collect2.exe: error: ld returned 1 exit status
> make[2]: *** [InOut/CMakeFiles/pmidi.dir/build.make:98: pmidi.dll] Error 1
> make[1]: *** [CMakeFiles/Makefile2:1728: InOut/CMakeFiles/pmidi.dir/all]
> Error 2
> make: *** [Makefile:163: all] Error 2

Date2017-06-02 00:07
FromSteven Yi
SubjectRe: [Csnd-dev] MSYS2 - Failing to build portmidi driver

I tried that yesterday but it didn't have any effect. It doesn't matter at the moment anyways as I can't even get far enough to compile the portmidi driver.


On Thu, Jun 1, 2017, 3:23 PM Michael Gogins <michael.gogins@gmail.com> wrote:
See if you need the porttime library now.

On Jun 1, 2017 12:28, "Steven Yi" <stevenyi@gmail.com> wrote:
The flags had -lwinmm.  However, even worse, I deleted my
CMakeCache.txt and retried a build using ./build.sh and the build is a
mess now. I get linker problems for both fluidOpcodes and csound64
(the latter pasted below).  I feel like these were problems that were
solved a while ago but reintroduced.

Could someone else building with MSYS2 do a clean build and let me
know if you're also getting errors?

[Link command]

/C/msys64/mingw64/bin/gcc.exe   -mfpmath=sse -msse2
-fomit-frame-pointer -mstackrealign -static-libgcc -static
-fvisibility=hidden -DHAVE_PTHREAD -O2 -g -DNDEBUG  -static-libstdc++
-static-libgcc -static -shared -o csound64.dll
-Wl,--out-implib,libcsound64.dll.a
-Wl,--major-image-version,0,--minor-image-version,0
-Wl,--whole-archive CMakeFiles/csound64.dir/objects.a
-Wl,--no-whole-archive ../../msvc/deps/lib/libsndfile.dll.a
/C/msys64/usr/lib/libpthread.a -ladvapi32 -lcomctl32 -lcomdlg32
-lglu32 -lkernel32 -lmsvcrt -lodbc32 -lodbccp32 -lole32 -loleaut32
-lshell32 -luser32 -luuid -lwinmm -lwinspool -lws2_32 -lwsock32
-ladvapi32 -lcomctl32 -lcomdlg32 -lglu32 -lkernel32 -lodbc32
-lodbccp32 -lole32 -loleaut32 -lshell32 -luser32 -luuid -lwinmm
-lwinspool -lws2_32 -lwsock32 -lvorbis -lvorbisenc -lspeex -lFLAC
-logg -lcurl -lmsvcrt -lvorbis -lvorbisenc -lspeex -lFLAC -logg -lcurl
-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32
-luuid -lcomdlg32 -ladvapi32

[output]

[ 35%] Built target csound64-static
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x80):
multiple definition of `pthread_mutex_lock'
C:/msys64/usr/lib/libpthread.a(t-d001062.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x350):
multiple definition of `pthread_mutex_unlock'
C:/msys64/usr/lib/libpthread.a(t-d001065.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x410):
multiple definition of `pthread_mutex_trylock'
C:/msys64/usr/lib/libpthread.a(t-d001064.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x4a0):
multiple definition of `pthread_mutex_init'
C:/msys64/usr/lib/libpthread.a(t-d001061.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x4f0):
multiple definition of `pthread_mutex_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001059.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x530):
multiple definition of `pthread_mutexattr_init'
C:/msys64/usr/lib/libpthread.a(t-d001071.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x540):
multiple definition of `pthread_mutexattr_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001066.o):fake:(.text+0x0): first defined here
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x570):
multiple definition of `pthread_mutexattr_settype'
C:/msys64/usr/lib/libpthread.a(t-d001075.o):fake:(.text+0x0): first defined here
C:/msys64/usr/lib/libpthread.a(t-d001023.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_barrier_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001024.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_barrier_init'
C:/msys64/usr/lib/libpthread.a(t-d001025.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_barrier_wait'
C:/msys64/usr/lib/libpthread.a(t-d001033.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_cond_init'
C:/msys64/usr/lib/libpthread.a(t-d001034.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_cond_signal'
C:/msys64/usr/lib/libpthread.a(t-d001036.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_cond_wait'
C:/msys64/usr/lib/libpthread.a(t-d001044.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_create'
C:/msys64/usr/lib/libpthread.a(t-d001046.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_equal'
C:/msys64/usr/lib/libpthread.a(t-d001055.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_join'
C:/msys64/usr/lib/libpthread.a(t-d001059.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001061.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_init'
C:/msys64/usr/lib/libpthread.a(t-d001062.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_lock'
C:/msys64/usr/lib/libpthread.a(t-d001064.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_trylock'
C:/msys64/usr/lib/libpthread.a(t-d001065.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutex_unlock'
C:/msys64/usr/lib/libpthread.a(t-d001066.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutexattr_destroy'
C:/msys64/usr/lib/libpthread.a(t-d001071.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutexattr_init'
C:/msys64/usr/lib/libpthread.a(t-d001075.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_mutexattr_settype'
C:/msys64/usr/lib/libpthread.a(t-d001088.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_self'
C:/msys64/usr/lib/libpthread.a(t-d001099.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_spin_init'
C:/msys64/usr/lib/libpthread.a(t-d001100.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_spin_lock'
C:/msys64/usr/lib/libpthread.a(t-d001102.o):fake:(.text+0x2):
undefined reference to `__imp_pthread_spin_unlock'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/csound64.dir/build.make:5954: csound64.dll] Error 1
make[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/csound64.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
Failed to run make.

On Thu, Jun 1, 2017 at 2:18 AM, Stephen Kyne <stevek@outlook.ie> wrote:
> Looks like it's missing the Winmm.lib?
>
> https://msdn.microsoft.com/en-us/library/windows/desktop/dd798464(v=vs.85).aspx
>
>
> Stephen
>
> ________________________________
> From: Csound-developers <CSOUND-DEV@LISTSERV.HEANET.IE> on behalf of Steven
> Yi <stevenyi@GMAIL.COM>
> Sent: 01 June 2017 04:08
> To: CSOUND-DEV@LISTSERV.HEANET.IE
> Subject: [Csnd-dev] MSYS2 - Failing to build portmidi driver
>
> Hi All,
>
> I pulled the latest from develop and am getting errors building with
> msys2. The build errors out on rtpmidi (errors pasted below). Seems
> like a linking issue, but I haven't quite found what's the fix. (I'm
> also travelling for the next few weeks and am intermittently looking
> at Csound dev.)
>
> Any help appreciated!
> steven
>
> [ 78%] Linking C shared module ../pmidi.dll
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x38):
> undefined reference to `__imp_midiInStop'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x4e):
> undefined reference to `__imp_midiInReset'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x5d):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x92):
> undefined reference to `__imp_midiInReset'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x9b):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa3):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcf):
> undefined reference to `__imp_midiInGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x17a):
> undefined reference to `__imp_midiInUnprepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x213):
> undefined reference to `__imp_midiInPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x225):
> undefined reference to `__imp_midiInAddBuffer'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x24c):
> undefined reference to `__imp_midiStreamStop'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2a2):
> undefined reference to `__imp_midiOutUnprepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2e1):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x326):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x368):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x3b7):
> undefined reference to `__imp_midiStreamPosition'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x600):
> undefined reference to `__imp_midiOutGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x646):
> undefined reference to `__imp_midiInGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x734):
> undefined reference to `__imp_midiInOpen'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x755):
> undefined reference to `__imp_midiInPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x78e):
> undefined reference to `__imp_midiInAddBuffer'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x815):
> undefined reference to `__imp_midiInClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x855):
> undefined reference to `__imp_midiInStart'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x865):
> undefined reference to `__imp_midiInReset'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x884):
> undefined reference to `__imp_midiInGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x97a):
> undefined reference to `__imp_midiStreamOpen'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa9b):
> undefined reference to `__imp_midiOutClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xaeb):
> undefined reference to `__imp_midiOutOpen'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb0f):
> undefined reference to `__imp_midiOutGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb4d):
> undefined reference to `__imp_midiStreamProperty'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xbc5):
> undefined reference to `__imp_midiStreamRestart'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xc11):
> undefined reference to `__imp_midiStreamClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcb2):
> undefined reference to `__imp_midiOutClose'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcd5):
> undefined reference to `__imp_midiOutGetErrorTextA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd27):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd66):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xdc9):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe56):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe88):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xefb):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1038):
> undefined reference to `__imp_midiOutPrepareHeader'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1066):
> undefined reference to `__imp_midiOutLongMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x108a):
> undefined reference to `__imp_midiOutShortMsg'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x10cb):
> undefined reference to `__imp_midiStreamOut'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x110f):
> undefined reference to `__imp_midiInGetDevCapsA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x115a):
> undefined reference to `__imp_midiOutGetDevCapsA'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x118f):
> undefined reference to `__imp_midiInGetNumDevs'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1244):
> undefined reference to `__imp_midiOutGetNumDevs'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x12):
> undefined reference to `__imp_timeGetTime'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x50):
> undefined reference to `__imp_timeBeginPeriod'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x5c):
> undefined reference to `__imp_timeGetTime'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x97):
> undefined reference to `__imp_timeSetEvent'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0xf4):
> undefined reference to `__imp_timeEndPeriod'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x102):
> undefined reference to `__imp_timeKillEvent'
> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x146):
> undefined reference to `__imp_timeGetTime'
> collect2.exe: error: ld returned 1 exit status
> make[2]: *** [InOut/CMakeFiles/pmidi.dir/build.make:98: pmidi.dll] Error 1
> make[1]: *** [CMakeFiles/Makefile2:1728: InOut/CMakeFiles/pmidi.dir/all]
> Error 2
> make: *** [Makefile:163: all] Error 2

Date2017-06-02 01:16
FromMichael Gogins
SubjectRe: [Csnd-dev] MSYS2 - Failing to build portmidi driver
I don't use a custom cmake file. I use a script. I just pull the repo,
build the packages, and then run this:

#!/bin/bash
echo "Overrides for Csound's CMake build system, for building Csound
for the Windows x64 installer."
echo
echo "Building Csound..."
mkdir csound-mingw64
cd csound-mingw64
pwd
rm -rf dist

# -DFIND_CMAKE_SYSTEM_PATH=//mingw64 \
# --trace-expand \

cmake ../.. -G "MSYS Makefiles" \
-DABLETON_LINK_HOME:PATH="D:\msys64\home\restore\link" \
-DBUILD_ABLETON_LINK_OPCODES:BOOL=0 \
-DBUILD_CSOUNDVST=1 \
-DBUILD_PD_CLASS=0 \
-DBUILD_STATIC_LIBRARY=1 \
-DBUILD_TESTS=0 \
-DBUILD_VST4CS_OPCODES=1 \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_VERBOSE_MAKEFILE=1 \
-DMUSICXML_LIBRARY:FILEPATH=/mingw64/bin/libmusicxml2.dll \
-DNEED_PORTTIME=1 \
-DPTHREAD_LIBRARY:FILEPATH=/mingw64/x86_64-w64-mingw32/lib/libpthread.a \
-DTCL_VERSION=8.5 \
-DUSE_CURL=0 \
-DUSE_GETTEXT=0 \
-DUSE_OPEN_MP=0 \
-D_WIN32=1 \
-DPYTHON_INCLUDE_DIRS:PATH="C:/Program Files/Anaconda2/include" \
-DPYTHON_LIBRARIES:FILEPATH="C:/Program Files/Anaconda2/libs/python27.a" \
-DSTK_LIBRARY:FILEPATH=/mingw64/lib/libstk.a \
-DLIBSNDFILE_LIBRARY:FILEPATH="C:\Program
Files\Mega-Nerd\libsndfile\bin\libsndfile-1.dll" \
-DSNDFILE_H_PATH:PATH="C:\Program Files\Mega-Nerd\libsndfile\include" \
-DBUILD_WEBSOCKET_OPCODE=0 \
-DMS_WIN64=1

if [ $? -ne 0 ]; then
    echo "Failed to run CMake."
    exit
fi
make -j6 $@
if [ $? -ne 0 ]; then
    echo "Failed to run make."
    exit
fi
echo "Compiling csound.node..."
echo "Compiling NSIS list of targets and dependencies..."
C:/Program_Files/Anaconda2/python ../find_csound_dependencies.py
echo "Compiling Doxygen API documentation..."
if [ $? -ne 0 ]; then
    echo "Failed to identify Csound targets and dependencies."
    exit
fi
cd ../../doc
pwd
doxygen Doxyfile
if [ $? -ne 0 ]; then
    echo "Failed to create Csound API documentation."
    exit
fi
doxygen Doxyfile-CsoundAC
if [ $? -ne 0 ]; then
    echo "Failed to create CsoundAC API documentation."
    exit
fi
echo "Compiling Inno Setup installer..."
cd ../installer/windows
pwd
"C:\Program Files (x86)\Inno Setup 5\iscc.exe" csound6_x64.iss
if [ $? -ne 0 ]; then
    echo "Failed to compile Inno Setup installer."
    exit
fi
echo "Uninstalling Csound x64..."
"C:\Program Files\Csound6_x64\unins000.exe" /SILENT
if [ $? -ne 0 ]; then
    echo "Failed to uninstall Csound x64, but continuing."
fi
echo "Installing Csound x64..."
./Setup_Csound6_x64_6.09.0.exe /SILENT
if [ $? -ne 0 ]; then
    echo "Failed to install Csound x64."
    exit
fi
echo "Finished building and installing Csound x64."

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Thu, Jun 1, 2017 at 7:07 PM, Steven Yi  wrote:
> I tried that yesterday but it didn't have any effect. It doesn't matter at
> the moment anyways as I can't even get far enough to compile the portmidi
> driver.
>
>
> On Thu, Jun 1, 2017, 3:23 PM Michael Gogins 
> wrote:
>>
>> See if you need the porttime library now.
>>
>> On Jun 1, 2017 12:28, "Steven Yi"  wrote:
>>>
>>> The flags had -lwinmm.  However, even worse, I deleted my
>>> CMakeCache.txt and retried a build using ./build.sh and the build is a
>>> mess now. I get linker problems for both fluidOpcodes and csound64
>>> (the latter pasted below).  I feel like these were problems that were
>>> solved a while ago but reintroduced.
>>>
>>> Could someone else building with MSYS2 do a clean build and let me
>>> know if you're also getting errors?
>>>
>>> [Link command]
>>>
>>> /C/msys64/mingw64/bin/gcc.exe   -mfpmath=sse -msse2
>>> -fomit-frame-pointer -mstackrealign -static-libgcc -static
>>> -fvisibility=hidden -DHAVE_PTHREAD -O2 -g -DNDEBUG  -static-libstdc++
>>> -static-libgcc -static -shared -o csound64.dll
>>> -Wl,--out-implib,libcsound64.dll.a
>>> -Wl,--major-image-version,0,--minor-image-version,0
>>> -Wl,--whole-archive CMakeFiles/csound64.dir/objects.a
>>> -Wl,--no-whole-archive ../../msvc/deps/lib/libsndfile.dll.a
>>> /C/msys64/usr/lib/libpthread.a -ladvapi32 -lcomctl32 -lcomdlg32
>>> -lglu32 -lkernel32 -lmsvcrt -lodbc32 -lodbccp32 -lole32 -loleaut32
>>> -lshell32 -luser32 -luuid -lwinmm -lwinspool -lws2_32 -lwsock32
>>> -ladvapi32 -lcomctl32 -lcomdlg32 -lglu32 -lkernel32 -lodbc32
>>> -lodbccp32 -lole32 -loleaut32 -lshell32 -luser32 -luuid -lwinmm
>>> -lwinspool -lws2_32 -lwsock32 -lvorbis -lvorbisenc -lspeex -lFLAC
>>> -logg -lcurl -lmsvcrt -lvorbis -lvorbisenc -lspeex -lFLAC -logg -lcurl
>>> -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32
>>> -luuid -lcomdlg32 -ladvapi32
>>>
>>> [output]
>>>
>>> [ 35%] Built target csound64-static
>>>
>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x80):
>>> multiple definition of `pthread_mutex_lock'
>>> C:/msys64/usr/lib/libpthread.a(t-d001062.o):fake:(.text+0x0): first
>>> defined here
>>>
>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x350):
>>> multiple definition of `pthread_mutex_unlock'
>>> C:/msys64/usr/lib/libpthread.a(t-d001065.o):fake:(.text+0x0): first
>>> defined here
>>>
>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x410):
>>> multiple definition of `pthread_mutex_trylock'
>>> C:/msys64/usr/lib/libpthread.a(t-d001064.o):fake:(.text+0x0): first
>>> defined here
>>>
>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x4a0):
>>> multiple definition of `pthread_mutex_init'
>>> C:/msys64/usr/lib/libpthread.a(t-d001061.o):fake:(.text+0x0): first
>>> defined here
>>>
>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x4f0):
>>> multiple definition of `pthread_mutex_destroy'
>>> C:/msys64/usr/lib/libpthread.a(t-d001059.o):fake:(.text+0x0): first
>>> defined here
>>>
>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x530):
>>> multiple definition of `pthread_mutexattr_init'
>>> C:/msys64/usr/lib/libpthread.a(t-d001071.o):fake:(.text+0x0): first
>>> defined here
>>>
>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x540):
>>> multiple definition of `pthread_mutexattr_destroy'
>>> C:/msys64/usr/lib/libpthread.a(t-d001066.o):fake:(.text+0x0): first
>>> defined here
>>>
>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x570):
>>> multiple definition of `pthread_mutexattr_settype'
>>> C:/msys64/usr/lib/libpthread.a(t-d001075.o):fake:(.text+0x0): first
>>> defined here
>>> C:/msys64/usr/lib/libpthread.a(t-d001023.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_barrier_destroy'
>>> C:/msys64/usr/lib/libpthread.a(t-d001024.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_barrier_init'
>>> C:/msys64/usr/lib/libpthread.a(t-d001025.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_barrier_wait'
>>> C:/msys64/usr/lib/libpthread.a(t-d001033.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_cond_init'
>>> C:/msys64/usr/lib/libpthread.a(t-d001034.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_cond_signal'
>>> C:/msys64/usr/lib/libpthread.a(t-d001036.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_cond_wait'
>>> C:/msys64/usr/lib/libpthread.a(t-d001044.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_create'
>>> C:/msys64/usr/lib/libpthread.a(t-d001046.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_equal'
>>> C:/msys64/usr/lib/libpthread.a(t-d001055.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_join'
>>> C:/msys64/usr/lib/libpthread.a(t-d001059.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_mutex_destroy'
>>> C:/msys64/usr/lib/libpthread.a(t-d001061.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_mutex_init'
>>> C:/msys64/usr/lib/libpthread.a(t-d001062.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_mutex_lock'
>>> C:/msys64/usr/lib/libpthread.a(t-d001064.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_mutex_trylock'
>>> C:/msys64/usr/lib/libpthread.a(t-d001065.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_mutex_unlock'
>>> C:/msys64/usr/lib/libpthread.a(t-d001066.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_mutexattr_destroy'
>>> C:/msys64/usr/lib/libpthread.a(t-d001071.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_mutexattr_init'
>>> C:/msys64/usr/lib/libpthread.a(t-d001075.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_mutexattr_settype'
>>> C:/msys64/usr/lib/libpthread.a(t-d001088.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_self'
>>> C:/msys64/usr/lib/libpthread.a(t-d001099.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_spin_init'
>>> C:/msys64/usr/lib/libpthread.a(t-d001100.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_spin_lock'
>>> C:/msys64/usr/lib/libpthread.a(t-d001102.o):fake:(.text+0x2):
>>> undefined reference to `__imp_pthread_spin_unlock'
>>> collect2.exe: error: ld returned 1 exit status
>>> make[2]: *** [CMakeFiles/csound64.dir/build.make:5954: csound64.dll]
>>> Error 1
>>> make[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/csound64.dir/all]
>>> Error 2
>>> make: *** [Makefile:163: all] Error 2
>>> Failed to run make.
>>>
>>> On Thu, Jun 1, 2017 at 2:18 AM, Stephen Kyne  wrote:
>>> > Looks like it's missing the Winmm.lib?
>>> >
>>> >
>>> > https://msdn.microsoft.com/en-us/library/windows/desktop/dd798464(v=vs.85).aspx
>>> >
>>> >
>>> > Stephen
>>> >
>>> > ________________________________
>>> > From: Csound-developers  on behalf of
>>> > Steven
>>> > Yi 
>>> > Sent: 01 June 2017 04:08
>>> > To: CSOUND-DEV@LISTSERV.HEANET.IE
>>> > Subject: [Csnd-dev] MSYS2 - Failing to build portmidi driver
>>> >
>>> > Hi All,
>>> >
>>> > I pulled the latest from develop and am getting errors building with
>>> > msys2. The build errors out on rtpmidi (errors pasted below). Seems
>>> > like a linking issue, but I haven't quite found what's the fix. (I'm
>>> > also travelling for the next few weeks and am intermittently looking
>>> > at Csound dev.)
>>> >
>>> > Any help appreciated!
>>> > steven
>>> >
>>> > [ 78%] Linking C shared module ../pmidi.dll
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x38):
>>> > undefined reference to `__imp_midiInStop'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x4e):
>>> > undefined reference to `__imp_midiInReset'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x5d):
>>> > undefined reference to `__imp_midiInClose'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x92):
>>> > undefined reference to `__imp_midiInReset'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x9b):
>>> > undefined reference to `__imp_midiInClose'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa3):
>>> > undefined reference to `__imp_midiInClose'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcf):
>>> > undefined reference to `__imp_midiInGetErrorTextA'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x17a):
>>> > undefined reference to `__imp_midiInUnprepareHeader'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x213):
>>> > undefined reference to `__imp_midiInPrepareHeader'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x225):
>>> > undefined reference to `__imp_midiInAddBuffer'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x24c):
>>> > undefined reference to `__imp_midiStreamStop'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2a2):
>>> > undefined reference to `__imp_midiOutUnprepareHeader'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2e1):
>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x326):
>>> > undefined reference to `__imp_midiStreamOut'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x368):
>>> > undefined reference to `__imp_midiOutLongMsg'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x3b7):
>>> > undefined reference to `__imp_midiStreamPosition'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x600):
>>> > undefined reference to `__imp_midiOutGetErrorTextA'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x646):
>>> > undefined reference to `__imp_midiInGetErrorTextA'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x734):
>>> > undefined reference to `__imp_midiInOpen'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x755):
>>> > undefined reference to `__imp_midiInPrepareHeader'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x78e):
>>> > undefined reference to `__imp_midiInAddBuffer'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x815):
>>> > undefined reference to `__imp_midiInClose'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x855):
>>> > undefined reference to `__imp_midiInStart'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x865):
>>> > undefined reference to `__imp_midiInReset'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x884):
>>> > undefined reference to `__imp_midiInGetErrorTextA'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x97a):
>>> > undefined reference to `__imp_midiStreamOpen'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa9b):
>>> > undefined reference to `__imp_midiOutClose'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xaeb):
>>> > undefined reference to `__imp_midiOutOpen'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb0f):
>>> > undefined reference to `__imp_midiOutGetErrorTextA'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb4d):
>>> > undefined reference to `__imp_midiStreamProperty'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xbc5):
>>> > undefined reference to `__imp_midiStreamRestart'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xc11):
>>> > undefined reference to `__imp_midiStreamClose'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcb2):
>>> > undefined reference to `__imp_midiOutClose'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcd5):
>>> > undefined reference to `__imp_midiOutGetErrorTextA'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd27):
>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd66):
>>> > undefined reference to `__imp_midiStreamOut'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xdc9):
>>> > undefined reference to `__imp_midiOutLongMsg'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe56):
>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe88):
>>> > undefined reference to `__imp_midiOutLongMsg'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xefb):
>>> > undefined reference to `__imp_midiStreamOut'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1038):
>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1066):
>>> > undefined reference to `__imp_midiOutLongMsg'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x108a):
>>> > undefined reference to `__imp_midiOutShortMsg'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x10cb):
>>> > undefined reference to `__imp_midiStreamOut'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x110f):
>>> > undefined reference to `__imp_midiInGetDevCapsA'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x115a):
>>> > undefined reference to `__imp_midiOutGetDevCapsA'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x118f):
>>> > undefined reference to `__imp_midiInGetNumDevs'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1244):
>>> > undefined reference to `__imp_midiOutGetNumDevs'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x12):
>>> > undefined reference to `__imp_timeGetTime'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x50):
>>> > undefined reference to `__imp_timeBeginPeriod'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x5c):
>>> > undefined reference to `__imp_timeGetTime'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x97):
>>> > undefined reference to `__imp_timeSetEvent'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0xf4):
>>> > undefined reference to `__imp_timeEndPeriod'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x102):
>>> > undefined reference to `__imp_timeKillEvent'
>>> >
>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x146):
>>> > undefined reference to `__imp_timeGetTime'
>>> > collect2.exe: error: ld returned 1 exit status
>>> > make[2]: *** [InOut/CMakeFiles/pmidi.dir/build.make:98: pmidi.dll]
>>> > Error 1
>>> > make[1]: *** [CMakeFiles/Makefile2:1728:
>>> > InOut/CMakeFiles/pmidi.dir/all]
>>> > Error 2

Date2017-06-02 02:23
FromSteven Yi
SubjectRe: [Csnd-dev] MSYS2 - Failing to build portmidi driver
I don't use a custom cmake file either, not sure what you are
referring to. (Maybe you misread my note about the CMake cache file?
Deleting the cache file or deleting the csound-mingw64 folder will
ensure a clean build from scratch.)

Anyways, I had to go through git history to see that code was removed
and only "pthread" was looked for, when the order should have been
winpthread-1, then pthread, then pthreadGC2.  I've restored that and
am past the pthread link issues and back to the portmidi issues.

On Thu, Jun 1, 2017 at 6:16 PM, Michael Gogins  wrote:
> I don't use a custom cmake file. I use a script. I just pull the repo,
> build the packages, and then run this:
>
> #!/bin/bash
> echo "Overrides for Csound's CMake build system, for building Csound
> for the Windows x64 installer."
> echo
> echo "Building Csound..."
> mkdir csound-mingw64
> cd csound-mingw64
> pwd
> rm -rf dist
>
> # -DFIND_CMAKE_SYSTEM_PATH=//mingw64 \
> # --trace-expand \
>
> cmake ../.. -G "MSYS Makefiles" \
> -DABLETON_LINK_HOME:PATH="D:\msys64\home\restore\link" \
> -DBUILD_ABLETON_LINK_OPCODES:BOOL=0 \
> -DBUILD_CSOUNDVST=1 \
> -DBUILD_PD_CLASS=0 \
> -DBUILD_STATIC_LIBRARY=1 \
> -DBUILD_TESTS=0 \
> -DBUILD_VST4CS_OPCODES=1 \
> -DCMAKE_BUILD_TYPE=RelWithDebInfo \
> -DCMAKE_VERBOSE_MAKEFILE=1 \
> -DMUSICXML_LIBRARY:FILEPATH=/mingw64/bin/libmusicxml2.dll \
> -DNEED_PORTTIME=1 \
> -DPTHREAD_LIBRARY:FILEPATH=/mingw64/x86_64-w64-mingw32/lib/libpthread.a \
> -DTCL_VERSION=8.5 \
> -DUSE_CURL=0 \
> -DUSE_GETTEXT=0 \
> -DUSE_OPEN_MP=0 \
> -D_WIN32=1 \
> -DPYTHON_INCLUDE_DIRS:PATH="C:/Program Files/Anaconda2/include" \
> -DPYTHON_LIBRARIES:FILEPATH="C:/Program Files/Anaconda2/libs/python27.a" \
> -DSTK_LIBRARY:FILEPATH=/mingw64/lib/libstk.a \
> -DLIBSNDFILE_LIBRARY:FILEPATH="C:\Program
> Files\Mega-Nerd\libsndfile\bin\libsndfile-1.dll" \
> -DSNDFILE_H_PATH:PATH="C:\Program Files\Mega-Nerd\libsndfile\include" \
> -DBUILD_WEBSOCKET_OPCODE=0 \
> -DMS_WIN64=1
>
> if [ $? -ne 0 ]; then
>     echo "Failed to run CMake."
>     exit
> fi
> make -j6 $@
> if [ $? -ne 0 ]; then
>     echo "Failed to run make."
>     exit
> fi
> echo "Compiling csound.node..."
> echo "Compiling NSIS list of targets and dependencies..."
> C:/Program_Files/Anaconda2/python ../find_csound_dependencies.py
> echo "Compiling Doxygen API documentation..."
> if [ $? -ne 0 ]; then
>     echo "Failed to identify Csound targets and dependencies."
>     exit
> fi
> cd ../../doc
> pwd
> doxygen Doxyfile
> if [ $? -ne 0 ]; then
>     echo "Failed to create Csound API documentation."
>     exit
> fi
> doxygen Doxyfile-CsoundAC
> if [ $? -ne 0 ]; then
>     echo "Failed to create CsoundAC API documentation."
>     exit
> fi
> echo "Compiling Inno Setup installer..."
> cd ../installer/windows
> pwd
> "C:\Program Files (x86)\Inno Setup 5\iscc.exe" csound6_x64.iss
> if [ $? -ne 0 ]; then
>     echo "Failed to compile Inno Setup installer."
>     exit
> fi
> echo "Uninstalling Csound x64..."
> "C:\Program Files\Csound6_x64\unins000.exe" /SILENT
> if [ $? -ne 0 ]; then
>     echo "Failed to uninstall Csound x64, but continuing."
> fi
> echo "Installing Csound x64..."
> ./Setup_Csound6_x64_6.09.0.exe /SILENT
> if [ $? -ne 0 ]; then
>     echo "Failed to install Csound x64."
>     exit
> fi
> echo "Finished building and installing Csound x64."
>
> -----------------------------------------------------
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com
> Michael dot Gogins at gmail dot com
>
>
> On Thu, Jun 1, 2017 at 7:07 PM, Steven Yi  wrote:
>> I tried that yesterday but it didn't have any effect. It doesn't matter at
>> the moment anyways as I can't even get far enough to compile the portmidi
>> driver.
>>
>>
>> On Thu, Jun 1, 2017, 3:23 PM Michael Gogins 
>> wrote:
>>>
>>> See if you need the porttime library now.
>>>
>>> On Jun 1, 2017 12:28, "Steven Yi"  wrote:
>>>>
>>>> The flags had -lwinmm.  However, even worse, I deleted my
>>>> CMakeCache.txt and retried a build using ./build.sh and the build is a
>>>> mess now. I get linker problems for both fluidOpcodes and csound64
>>>> (the latter pasted below).  I feel like these were problems that were
>>>> solved a while ago but reintroduced.
>>>>
>>>> Could someone else building with MSYS2 do a clean build and let me
>>>> know if you're also getting errors?
>>>>
>>>> [Link command]
>>>>
>>>> /C/msys64/mingw64/bin/gcc.exe   -mfpmath=sse -msse2
>>>> -fomit-frame-pointer -mstackrealign -static-libgcc -static
>>>> -fvisibility=hidden -DHAVE_PTHREAD -O2 -g -DNDEBUG  -static-libstdc++
>>>> -static-libgcc -static -shared -o csound64.dll
>>>> -Wl,--out-implib,libcsound64.dll.a
>>>> -Wl,--major-image-version,0,--minor-image-version,0
>>>> -Wl,--whole-archive CMakeFiles/csound64.dir/objects.a
>>>> -Wl,--no-whole-archive ../../msvc/deps/lib/libsndfile.dll.a
>>>> /C/msys64/usr/lib/libpthread.a -ladvapi32 -lcomctl32 -lcomdlg32
>>>> -lglu32 -lkernel32 -lmsvcrt -lodbc32 -lodbccp32 -lole32 -loleaut32
>>>> -lshell32 -luser32 -luuid -lwinmm -lwinspool -lws2_32 -lwsock32
>>>> -ladvapi32 -lcomctl32 -lcomdlg32 -lglu32 -lkernel32 -lodbc32
>>>> -lodbccp32 -lole32 -loleaut32 -lshell32 -luser32 -luuid -lwinmm
>>>> -lwinspool -lws2_32 -lwsock32 -lvorbis -lvorbisenc -lspeex -lFLAC
>>>> -logg -lcurl -lmsvcrt -lvorbis -lvorbisenc -lspeex -lFLAC -logg -lcurl
>>>> -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32
>>>> -luuid -lcomdlg32 -ladvapi32
>>>>
>>>> [output]
>>>>
>>>> [ 35%] Built target csound64-static
>>>>
>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x80):
>>>> multiple definition of `pthread_mutex_lock'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001062.o):fake:(.text+0x0): first
>>>> defined here
>>>>
>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x350):
>>>> multiple definition of `pthread_mutex_unlock'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001065.o):fake:(.text+0x0): first
>>>> defined here
>>>>
>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x410):
>>>> multiple definition of `pthread_mutex_trylock'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001064.o):fake:(.text+0x0): first
>>>> defined here
>>>>
>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x4a0):
>>>> multiple definition of `pthread_mutex_init'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001061.o):fake:(.text+0x0): first
>>>> defined here
>>>>
>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x4f0):
>>>> multiple definition of `pthread_mutex_destroy'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001059.o):fake:(.text+0x0): first
>>>> defined here
>>>>
>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x530):
>>>> multiple definition of `pthread_mutexattr_init'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001071.o):fake:(.text+0x0): first
>>>> defined here
>>>>
>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x540):
>>>> multiple definition of `pthread_mutexattr_destroy'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001066.o):fake:(.text+0x0): first
>>>> defined here
>>>>
>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x570):
>>>> multiple definition of `pthread_mutexattr_settype'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001075.o):fake:(.text+0x0): first
>>>> defined here
>>>> C:/msys64/usr/lib/libpthread.a(t-d001023.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_barrier_destroy'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001024.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_barrier_init'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001025.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_barrier_wait'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001033.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_cond_init'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001034.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_cond_signal'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001036.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_cond_wait'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001044.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_create'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001046.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_equal'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001055.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_join'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001059.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_mutex_destroy'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001061.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_mutex_init'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001062.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_mutex_lock'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001064.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_mutex_trylock'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001065.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_mutex_unlock'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001066.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_mutexattr_destroy'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001071.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_mutexattr_init'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001075.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_mutexattr_settype'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001088.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_self'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001099.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_spin_init'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001100.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_spin_lock'
>>>> C:/msys64/usr/lib/libpthread.a(t-d001102.o):fake:(.text+0x2):
>>>> undefined reference to `__imp_pthread_spin_unlock'
>>>> collect2.exe: error: ld returned 1 exit status
>>>> make[2]: *** [CMakeFiles/csound64.dir/build.make:5954: csound64.dll]
>>>> Error 1
>>>> make[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/csound64.dir/all]
>>>> Error 2
>>>> make: *** [Makefile:163: all] Error 2
>>>> Failed to run make.
>>>>
>>>> On Thu, Jun 1, 2017 at 2:18 AM, Stephen Kyne  wrote:
>>>> > Looks like it's missing the Winmm.lib?
>>>> >
>>>> >
>>>> > https://msdn.microsoft.com/en-us/library/windows/desktop/dd798464(v=vs.85).aspx
>>>> >
>>>> >
>>>> > Stephen
>>>> >
>>>> > ________________________________
>>>> > From: Csound-developers  on behalf of
>>>> > Steven
>>>> > Yi 
>>>> > Sent: 01 June 2017 04:08
>>>> > To: CSOUND-DEV@LISTSERV.HEANET.IE
>>>> > Subject: [Csnd-dev] MSYS2 - Failing to build portmidi driver
>>>> >
>>>> > Hi All,
>>>> >
>>>> > I pulled the latest from develop and am getting errors building with
>>>> > msys2. The build errors out on rtpmidi (errors pasted below). Seems
>>>> > like a linking issue, but I haven't quite found what's the fix. (I'm
>>>> > also travelling for the next few weeks and am intermittently looking
>>>> > at Csound dev.)
>>>> >
>>>> > Any help appreciated!
>>>> > steven
>>>> >
>>>> > [ 78%] Linking C shared module ../pmidi.dll
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x38):
>>>> > undefined reference to `__imp_midiInStop'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x4e):
>>>> > undefined reference to `__imp_midiInReset'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x5d):
>>>> > undefined reference to `__imp_midiInClose'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x92):
>>>> > undefined reference to `__imp_midiInReset'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x9b):
>>>> > undefined reference to `__imp_midiInClose'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa3):
>>>> > undefined reference to `__imp_midiInClose'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcf):
>>>> > undefined reference to `__imp_midiInGetErrorTextA'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x17a):
>>>> > undefined reference to `__imp_midiInUnprepareHeader'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x213):
>>>> > undefined reference to `__imp_midiInPrepareHeader'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x225):
>>>> > undefined reference to `__imp_midiInAddBuffer'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x24c):
>>>> > undefined reference to `__imp_midiStreamStop'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2a2):
>>>> > undefined reference to `__imp_midiOutUnprepareHeader'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2e1):
>>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x326):
>>>> > undefined reference to `__imp_midiStreamOut'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x368):
>>>> > undefined reference to `__imp_midiOutLongMsg'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x3b7):
>>>> > undefined reference to `__imp_midiStreamPosition'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x600):
>>>> > undefined reference to `__imp_midiOutGetErrorTextA'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x646):
>>>> > undefined reference to `__imp_midiInGetErrorTextA'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x734):
>>>> > undefined reference to `__imp_midiInOpen'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x755):
>>>> > undefined reference to `__imp_midiInPrepareHeader'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x78e):
>>>> > undefined reference to `__imp_midiInAddBuffer'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x815):
>>>> > undefined reference to `__imp_midiInClose'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x855):
>>>> > undefined reference to `__imp_midiInStart'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x865):
>>>> > undefined reference to `__imp_midiInReset'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x884):
>>>> > undefined reference to `__imp_midiInGetErrorTextA'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x97a):
>>>> > undefined reference to `__imp_midiStreamOpen'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa9b):
>>>> > undefined reference to `__imp_midiOutClose'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xaeb):
>>>> > undefined reference to `__imp_midiOutOpen'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb0f):
>>>> > undefined reference to `__imp_midiOutGetErrorTextA'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb4d):
>>>> > undefined reference to `__imp_midiStreamProperty'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xbc5):
>>>> > undefined reference to `__imp_midiStreamRestart'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xc11):
>>>> > undefined reference to `__imp_midiStreamClose'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcb2):
>>>> > undefined reference to `__imp_midiOutClose'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcd5):
>>>> > undefined reference to `__imp_midiOutGetErrorTextA'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd27):
>>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd66):
>>>> > undefined reference to `__imp_midiStreamOut'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xdc9):
>>>> > undefined reference to `__imp_midiOutLongMsg'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe56):
>>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe88):
>>>> > undefined reference to `__imp_midiOutLongMsg'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xefb):
>>>> > undefined reference to `__imp_midiStreamOut'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1038):
>>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1066):
>>>> > undefined reference to `__imp_midiOutLongMsg'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x108a):
>>>> > undefined reference to `__imp_midiOutShortMsg'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x10cb):
>>>> > undefined reference to `__imp_midiStreamOut'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x110f):
>>>> > undefined reference to `__imp_midiInGetDevCapsA'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x115a):
>>>> > undefined reference to `__imp_midiOutGetDevCapsA'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x118f):
>>>> > undefined reference to `__imp_midiInGetNumDevs'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1244):
>>>> > undefined reference to `__imp_midiOutGetNumDevs'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x12):
>>>> > undefined reference to `__imp_timeGetTime'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x50):
>>>> > undefined reference to `__imp_timeBeginPeriod'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x5c):
>>>> > undefined reference to `__imp_timeGetTime'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x97):
>>>> > undefined reference to `__imp_timeSetEvent'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0xf4):
>>>> > undefined reference to `__imp_timeEndPeriod'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x102):
>>>> > undefined reference to `__imp_timeKillEvent'
>>>> >
>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x146):
>>>> > undefined reference to `__imp_timeGetTime'
>>>> > collect2.exe: error: ld returned 1 exit status
>>>> > make[2]: *** [InOut/CMakeFiles/pmidi.dir/build.make:98: pmidi.dll]
>>>> > Error 1
>>>> > make[1]: *** [CMakeFiles/Makefile2:1728:
>>>> > InOut/CMakeFiles/pmidi.dir/all]
>>>> > Error 2

Date2017-06-02 02:58
FromSteven Yi
SubjectRe: [Csnd-dev] MSYS2 - Failing to build portmidi driver
Okay, I've fixed it. It had to do with the ordering of
target_link_libraries. Having PORTMIDI_LIBRARY first got it to link.

I get close to a full build now, but python interface now fails:


In file included from C:/Python27/include/Python.h:8:0,
                 from
C:/msys64/home/stevenyi/work/csound/csound/mingw64/csound-mingw64/python_interfacePYTHON_wrap.cxx:182:
C:/Python27/include/pyconfig.h:285:15: error: 'std::_hypot' has not
been declared
 #define hypot _hypot

I've just disabled it and CsoundAC and have a complete build now. I'm
going to move on now as this has taken up too much time.


On Thu, Jun 1, 2017 at 7:23 PM, Steven Yi  wrote:
> I don't use a custom cmake file either, not sure what you are
> referring to. (Maybe you misread my note about the CMake cache file?
> Deleting the cache file or deleting the csound-mingw64 folder will
> ensure a clean build from scratch.)
>
> Anyways, I had to go through git history to see that code was removed
> and only "pthread" was looked for, when the order should have been
> winpthread-1, then pthread, then pthreadGC2.  I've restored that and
> am past the pthread link issues and back to the portmidi issues.
>
> On Thu, Jun 1, 2017 at 6:16 PM, Michael Gogins  wrote:
>> I don't use a custom cmake file. I use a script. I just pull the repo,
>> build the packages, and then run this:
>>
>> #!/bin/bash
>> echo "Overrides for Csound's CMake build system, for building Csound
>> for the Windows x64 installer."
>> echo
>> echo "Building Csound..."
>> mkdir csound-mingw64
>> cd csound-mingw64
>> pwd
>> rm -rf dist
>>
>> # -DFIND_CMAKE_SYSTEM_PATH=//mingw64 \
>> # --trace-expand \
>>
>> cmake ../.. -G "MSYS Makefiles" \
>> -DABLETON_LINK_HOME:PATH="D:\msys64\home\restore\link" \
>> -DBUILD_ABLETON_LINK_OPCODES:BOOL=0 \
>> -DBUILD_CSOUNDVST=1 \
>> -DBUILD_PD_CLASS=0 \
>> -DBUILD_STATIC_LIBRARY=1 \
>> -DBUILD_TESTS=0 \
>> -DBUILD_VST4CS_OPCODES=1 \
>> -DCMAKE_BUILD_TYPE=RelWithDebInfo \
>> -DCMAKE_VERBOSE_MAKEFILE=1 \
>> -DMUSICXML_LIBRARY:FILEPATH=/mingw64/bin/libmusicxml2.dll \
>> -DNEED_PORTTIME=1 \
>> -DPTHREAD_LIBRARY:FILEPATH=/mingw64/x86_64-w64-mingw32/lib/libpthread.a \
>> -DTCL_VERSION=8.5 \
>> -DUSE_CURL=0 \
>> -DUSE_GETTEXT=0 \
>> -DUSE_OPEN_MP=0 \
>> -D_WIN32=1 \
>> -DPYTHON_INCLUDE_DIRS:PATH="C:/Program Files/Anaconda2/include" \
>> -DPYTHON_LIBRARIES:FILEPATH="C:/Program Files/Anaconda2/libs/python27.a" \
>> -DSTK_LIBRARY:FILEPATH=/mingw64/lib/libstk.a \
>> -DLIBSNDFILE_LIBRARY:FILEPATH="C:\Program
>> Files\Mega-Nerd\libsndfile\bin\libsndfile-1.dll" \
>> -DSNDFILE_H_PATH:PATH="C:\Program Files\Mega-Nerd\libsndfile\include" \
>> -DBUILD_WEBSOCKET_OPCODE=0 \
>> -DMS_WIN64=1
>>
>> if [ $? -ne 0 ]; then
>>     echo "Failed to run CMake."
>>     exit
>> fi
>> make -j6 $@
>> if [ $? -ne 0 ]; then
>>     echo "Failed to run make."
>>     exit
>> fi
>> echo "Compiling csound.node..."
>> echo "Compiling NSIS list of targets and dependencies..."
>> C:/Program_Files/Anaconda2/python ../find_csound_dependencies.py
>> echo "Compiling Doxygen API documentation..."
>> if [ $? -ne 0 ]; then
>>     echo "Failed to identify Csound targets and dependencies."
>>     exit
>> fi
>> cd ../../doc
>> pwd
>> doxygen Doxyfile
>> if [ $? -ne 0 ]; then
>>     echo "Failed to create Csound API documentation."
>>     exit
>> fi
>> doxygen Doxyfile-CsoundAC
>> if [ $? -ne 0 ]; then
>>     echo "Failed to create CsoundAC API documentation."
>>     exit
>> fi
>> echo "Compiling Inno Setup installer..."
>> cd ../installer/windows
>> pwd
>> "C:\Program Files (x86)\Inno Setup 5\iscc.exe" csound6_x64.iss
>> if [ $? -ne 0 ]; then
>>     echo "Failed to compile Inno Setup installer."
>>     exit
>> fi
>> echo "Uninstalling Csound x64..."
>> "C:\Program Files\Csound6_x64\unins000.exe" /SILENT
>> if [ $? -ne 0 ]; then
>>     echo "Failed to uninstall Csound x64, but continuing."
>> fi
>> echo "Installing Csound x64..."
>> ./Setup_Csound6_x64_6.09.0.exe /SILENT
>> if [ $? -ne 0 ]; then
>>     echo "Failed to install Csound x64."
>>     exit
>> fi
>> echo "Finished building and installing Csound x64."
>>
>> -----------------------------------------------------
>> Michael Gogins
>> Irreducible Productions
>> http://michaelgogins.tumblr.com
>> Michael dot Gogins at gmail dot com
>>
>>
>> On Thu, Jun 1, 2017 at 7:07 PM, Steven Yi  wrote:
>>> I tried that yesterday but it didn't have any effect. It doesn't matter at
>>> the moment anyways as I can't even get far enough to compile the portmidi
>>> driver.
>>>
>>>
>>> On Thu, Jun 1, 2017, 3:23 PM Michael Gogins 
>>> wrote:
>>>>
>>>> See if you need the porttime library now.
>>>>
>>>> On Jun 1, 2017 12:28, "Steven Yi"  wrote:
>>>>>
>>>>> The flags had -lwinmm.  However, even worse, I deleted my
>>>>> CMakeCache.txt and retried a build using ./build.sh and the build is a
>>>>> mess now. I get linker problems for both fluidOpcodes and csound64
>>>>> (the latter pasted below).  I feel like these were problems that were
>>>>> solved a while ago but reintroduced.
>>>>>
>>>>> Could someone else building with MSYS2 do a clean build and let me
>>>>> know if you're also getting errors?
>>>>>
>>>>> [Link command]
>>>>>
>>>>> /C/msys64/mingw64/bin/gcc.exe   -mfpmath=sse -msse2
>>>>> -fomit-frame-pointer -mstackrealign -static-libgcc -static
>>>>> -fvisibility=hidden -DHAVE_PTHREAD -O2 -g -DNDEBUG  -static-libstdc++
>>>>> -static-libgcc -static -shared -o csound64.dll
>>>>> -Wl,--out-implib,libcsound64.dll.a
>>>>> -Wl,--major-image-version,0,--minor-image-version,0
>>>>> -Wl,--whole-archive CMakeFiles/csound64.dir/objects.a
>>>>> -Wl,--no-whole-archive ../../msvc/deps/lib/libsndfile.dll.a
>>>>> /C/msys64/usr/lib/libpthread.a -ladvapi32 -lcomctl32 -lcomdlg32
>>>>> -lglu32 -lkernel32 -lmsvcrt -lodbc32 -lodbccp32 -lole32 -loleaut32
>>>>> -lshell32 -luser32 -luuid -lwinmm -lwinspool -lws2_32 -lwsock32
>>>>> -ladvapi32 -lcomctl32 -lcomdlg32 -lglu32 -lkernel32 -lodbc32
>>>>> -lodbccp32 -lole32 -loleaut32 -lshell32 -luser32 -luuid -lwinmm
>>>>> -lwinspool -lws2_32 -lwsock32 -lvorbis -lvorbisenc -lspeex -lFLAC
>>>>> -logg -lcurl -lmsvcrt -lvorbis -lvorbisenc -lspeex -lFLAC -logg -lcurl
>>>>> -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32
>>>>> -luuid -lcomdlg32 -ladvapi32
>>>>>
>>>>> [output]
>>>>>
>>>>> [ 35%] Built target csound64-static
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x80):
>>>>> multiple definition of `pthread_mutex_lock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001062.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x350):
>>>>> multiple definition of `pthread_mutex_unlock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001065.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x410):
>>>>> multiple definition of `pthread_mutex_trylock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001064.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x4a0):
>>>>> multiple definition of `pthread_mutex_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001061.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x4f0):
>>>>> multiple definition of `pthread_mutex_destroy'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001059.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x530):
>>>>> multiple definition of `pthread_mutexattr_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001071.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x540):
>>>>> multiple definition of `pthread_mutexattr_destroy'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001066.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x570):
>>>>> multiple definition of `pthread_mutexattr_settype'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001075.o):fake:(.text+0x0): first
>>>>> defined here
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001023.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_barrier_destroy'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001024.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_barrier_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001025.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_barrier_wait'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001033.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_cond_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001034.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_cond_signal'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001036.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_cond_wait'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001044.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_create'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001046.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_equal'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001055.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_join'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001059.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutex_destroy'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001061.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutex_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001062.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutex_lock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001064.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutex_trylock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001065.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutex_unlock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001066.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutexattr_destroy'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001071.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutexattr_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001075.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutexattr_settype'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001088.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_self'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001099.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_spin_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001100.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_spin_lock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001102.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_spin_unlock'
>>>>> collect2.exe: error: ld returned 1 exit status
>>>>> make[2]: *** [CMakeFiles/csound64.dir/build.make:5954: csound64.dll]
>>>>> Error 1
>>>>> make[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/csound64.dir/all]
>>>>> Error 2
>>>>> make: *** [Makefile:163: all] Error 2
>>>>> Failed to run make.
>>>>>
>>>>> On Thu, Jun 1, 2017 at 2:18 AM, Stephen Kyne  wrote:
>>>>> > Looks like it's missing the Winmm.lib?
>>>>> >
>>>>> >
>>>>> > https://msdn.microsoft.com/en-us/library/windows/desktop/dd798464(v=vs.85).aspx
>>>>> >
>>>>> >
>>>>> > Stephen
>>>>> >
>>>>> > ________________________________
>>>>> > From: Csound-developers  on behalf of
>>>>> > Steven
>>>>> > Yi 
>>>>> > Sent: 01 June 2017 04:08
>>>>> > To: CSOUND-DEV@LISTSERV.HEANET.IE
>>>>> > Subject: [Csnd-dev] MSYS2 - Failing to build portmidi driver
>>>>> >
>>>>> > Hi All,
>>>>> >
>>>>> > I pulled the latest from develop and am getting errors building with
>>>>> > msys2. The build errors out on rtpmidi (errors pasted below). Seems
>>>>> > like a linking issue, but I haven't quite found what's the fix. (I'm
>>>>> > also travelling for the next few weeks and am intermittently looking
>>>>> > at Csound dev.)
>>>>> >
>>>>> > Any help appreciated!
>>>>> > steven
>>>>> >
>>>>> > [ 78%] Linking C shared module ../pmidi.dll
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x38):
>>>>> > undefined reference to `__imp_midiInStop'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x4e):
>>>>> > undefined reference to `__imp_midiInReset'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x5d):
>>>>> > undefined reference to `__imp_midiInClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x92):
>>>>> > undefined reference to `__imp_midiInReset'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x9b):
>>>>> > undefined reference to `__imp_midiInClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa3):
>>>>> > undefined reference to `__imp_midiInClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcf):
>>>>> > undefined reference to `__imp_midiInGetErrorTextA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x17a):
>>>>> > undefined reference to `__imp_midiInUnprepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x213):
>>>>> > undefined reference to `__imp_midiInPrepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x225):
>>>>> > undefined reference to `__imp_midiInAddBuffer'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x24c):
>>>>> > undefined reference to `__imp_midiStreamStop'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2a2):
>>>>> > undefined reference to `__imp_midiOutUnprepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2e1):
>>>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x326):
>>>>> > undefined reference to `__imp_midiStreamOut'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x368):
>>>>> > undefined reference to `__imp_midiOutLongMsg'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x3b7):
>>>>> > undefined reference to `__imp_midiStreamPosition'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x600):
>>>>> > undefined reference to `__imp_midiOutGetErrorTextA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x646):
>>>>> > undefined reference to `__imp_midiInGetErrorTextA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x734):
>>>>> > undefined reference to `__imp_midiInOpen'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x755):
>>>>> > undefined reference to `__imp_midiInPrepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x78e):
>>>>> > undefined reference to `__imp_midiInAddBuffer'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x815):
>>>>> > undefined reference to `__imp_midiInClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x855):
>>>>> > undefined reference to `__imp_midiInStart'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x865):
>>>>> > undefined reference to `__imp_midiInReset'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x884):
>>>>> > undefined reference to `__imp_midiInGetErrorTextA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x97a):
>>>>> > undefined reference to `__imp_midiStreamOpen'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa9b):
>>>>> > undefined reference to `__imp_midiOutClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xaeb):
>>>>> > undefined reference to `__imp_midiOutOpen'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb0f):
>>>>> > undefined reference to `__imp_midiOutGetErrorTextA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb4d):
>>>>> > undefined reference to `__imp_midiStreamProperty'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xbc5):
>>>>> > undefined reference to `__imp_midiStreamRestart'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xc11):
>>>>> > undefined reference to `__imp_midiStreamClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcb2):
>>>>> > undefined reference to `__imp_midiOutClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcd5):
>>>>> > undefined reference to `__imp_midiOutGetErrorTextA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd27):
>>>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd66):
>>>>> > undefined reference to `__imp_midiStreamOut'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xdc9):
>>>>> > undefined reference to `__imp_midiOutLongMsg'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe56):
>>>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe88):
>>>>> > undefined reference to `__imp_midiOutLongMsg'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xefb):
>>>>> > undefined reference to `__imp_midiStreamOut'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1038):
>>>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1066):
>>>>> > undefined reference to `__imp_midiOutLongMsg'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x108a):
>>>>> > undefined reference to `__imp_midiOutShortMsg'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x10cb):
>>>>> > undefined reference to `__imp_midiStreamOut'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x110f):
>>>>> > undefined reference to `__imp_midiInGetDevCapsA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x115a):
>>>>> > undefined reference to `__imp_midiOutGetDevCapsA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x118f):
>>>>> > undefined reference to `__imp_midiInGetNumDevs'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1244):
>>>>> > undefined reference to `__imp_midiOutGetNumDevs'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x12):
>>>>> > undefined reference to `__imp_timeGetTime'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x50):
>>>>> > undefined reference to `__imp_timeBeginPeriod'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x5c):
>>>>> > undefined reference to `__imp_timeGetTime'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x97):
>>>>> > undefined reference to `__imp_timeSetEvent'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0xf4):
>>>>> > undefined reference to `__imp_timeEndPeriod'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x102):
>>>>> > undefined reference to `__imp_timeKillEvent'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x146):
>>>>> > undefined reference to `__imp_timeGetTime'
>>>>> > collect2.exe: error: ld returned 1 exit status
>>>>> > make[2]: *** [InOut/CMakeFiles/pmidi.dir/build.make:98: pmidi.dll]
>>>>> > Error 1
>>>>> > make[1]: *** [CMakeFiles/Makefile2:1728:
>>>>> > InOut/CMakeFiles/pmidi.dir/all]
>>>>> > Error 2

Date2017-06-02 10:56
FromStephen Kyne
SubjectRe: [Csnd-dev] MSYS2 - Failing to build portmidi driver

Apologies if that was my change for pthreads. I wonder if we used https://cmake.org/cmake/help/v3.0/module/FindThreads.html, would that be cleaner.


I'll take a look into it and see. It's a bit of a pain to support the older cmake. Maybe best to leave it alone.


Stephen


From: Csound-developers <CSOUND-DEV@LISTSERV.HEANET.IE> on behalf of Steven Yi <stevenyi@GMAIL.COM>
Sent: 02 June 2017 02:58
To: CSOUND-DEV@LISTSERV.HEANET.IE
Subject: Re: [Csnd-dev] MSYS2 - Failing to build portmidi driver
 
Okay, I've fixed it. It had to do with the ordering of
target_link_libraries. Having PORTMIDI_LIBRARY first got it to link.

I get close to a full build now, but python interface now fails:


In file included from C:/Python27/include/Python.h:8:0,
                 from
C:/msys64/home/stevenyi/work/csound/csound/mingw64/csound-mingw64/python_interfacePYTHON_wrap.cxx:182:
C:/Python27/include/pyconfig.h:285:15: error: 'std::_hypot' has not
been declared
 #define hypot _hypot

I've just disabled it and CsoundAC and have a complete build now. I'm
going to move on now as this has taken up too much time.


On Thu, Jun 1, 2017 at 7:23 PM, Steven Yi <stevenyi@gmail.com> wrote:
> I don't use a custom cmake file either, not sure what you are
> referring to. (Maybe you misread my note about the CMake cache file?
> Deleting the cache file or deleting the csound-mingw64 folder will
> ensure a clean build from scratch.)
>
> Anyways, I had to go through git history to see that code was removed
> and only "pthread" was looked for, when the order should have been
> winpthread-1, then pthread, then pthreadGC2.  I've restored that and
> am past the pthread link issues and back to the portmidi issues.
>
> On Thu, Jun 1, 2017 at 6:16 PM, Michael Gogins <michael.gogins@gmail.com> wrote:
>> I don't use a custom cmake file. I use a script. I just pull the repo,
>> build the packages, and then run this:
>>
>> #!/bin/bash
>> echo "Overrides for Csound's CMake build system, for building Csound
>> for the Windows x64 installer."
>> echo
>> echo "Building Csound..."
>> mkdir csound-mingw64
>> cd csound-mingw64
>> pwd
>> rm -rf dist
>>
>> # -DFIND_CMAKE_SYSTEM_PATH=//mingw64 \
>> # --trace-expand \
>>
>> cmake ../.. -G "MSYS Makefiles" \
>> -DABLETON_LINK_HOME:PATH="D:\msys64\home\restore\link" \
>> -DBUILD_ABLETON_LINK_OPCODES:BOOL=0 \
>> -DBUILD_CSOUNDVST=1 \
>> -DBUILD_PD_CLASS=0 \
>> -DBUILD_STATIC_LIBRARY=1 \
>> -DBUILD_TESTS=0 \
>> -DBUILD_VST4CS_OPCODES=1 \
>> -DCMAKE_BUILD_TYPE=RelWithDebInfo \
>> -DCMAKE_VERBOSE_MAKEFILE=1 \
>> -DMUSICXML_LIBRARY:FILEPATH=/mingw64/bin/libmusicxml2.dll \
>> -DNEED_PORTTIME=1 \
>> -DPTHREAD_LIBRARY:FILEPATH=/mingw64/x86_64-w64-mingw32/lib/libpthread.a \
>> -DTCL_VERSION=8.5 \
>> -DUSE_CURL=0 \
>> -DUSE_GETTEXT=0 \
>> -DUSE_OPEN_MP=0 \
>> -D_WIN32=1 \
>> -DPYTHON_INCLUDE_DIRS:PATH="C:/Program Files/Anaconda2/include" \
>> -DPYTHON_LIBRARIES:FILEPATH="C:/Program Files/Anaconda2/libs/python27.a" \
>> -DSTK_LIBRARY:FILEPATH=/mingw64/lib/libstk.a \
>> -DLIBSNDFILE_LIBRARY:FILEPATH="C:\Program
>> Files\Mega-Nerd\libsndfile\bin\libsndfile-1.dll" \
>> -DSNDFILE_H_PATH:PATH="C:\Program Files\Mega-Nerd\libsndfile\include" \
>> -DBUILD_WEBSOCKET_OPCODE=0 \
>> -DMS_WIN64=1
>>
>> if [ $? -ne 0 ]; then
>>     echo "Failed to run CMake."
>>     exit
>> fi
>> make -j6 $@
>> if [ $? -ne 0 ]; then
>>     echo "Failed to run make."
>>     exit
>> fi
>> echo "Compiling csound.node..."
>> echo "Compiling NSIS list of targets and dependencies..."
>> C:/Program_Files/Anaconda2/python ../find_csound_dependencies.py
>> echo "Compiling Doxygen API documentation..."
>> if [ $? -ne 0 ]; then
>>     echo "Failed to identify Csound targets and dependencies."
>>     exit
>> fi
>> cd ../../doc
>> pwd
>> doxygen Doxyfile
>> if [ $? -ne 0 ]; then
>>     echo "Failed to create Csound API documentation."
>>     exit
>> fi
>> doxygen Doxyfile-CsoundAC
>> if [ $? -ne 0 ]; then
>>     echo "Failed to create CsoundAC API documentation."
>>     exit
>> fi
>> echo "Compiling Inno Setup installer..."
>> cd ../installer/windows
>> pwd
>> "C:\Program Files (x86)\Inno Setup 5\iscc.exe" csound6_x64.iss
>> if [ $? -ne 0 ]; then
>>     echo "Failed to compile Inno Setup installer."
>>     exit
>> fi
>> echo "Uninstalling Csound x64..."
>> "C:\Program Files\Csound6_x64\unins000.exe" /SILENT
>> if [ $? -ne 0 ]; then
>>     echo "Failed to uninstall Csound x64, but continuing."
>> fi
>> echo "Installing Csound x64..."
>> ./Setup_Csound6_x64_6.09.0.exe /SILENT
>> if [ $? -ne 0 ]; then
>>     echo "Failed to install Csound x64."
>>     exit
>> fi
>> echo "Finished building and installing Csound x64."
>>
>> -----------------------------------------------------
>> Michael Gogins
>> Irreducible Productions
>> http://michaelgogins.tumblr.com


>> Michael dot Gogins at gmail dot com
>>
>>
>> On Thu, Jun 1, 2017 at 7:07 PM, Steven Yi <stevenyi@gmail.com> wrote:
>>> I tried that yesterday but it didn't have any effect. It doesn't matter at
>>> the moment anyways as I can't even get far enough to compile the portmidi
>>> driver.
>>>
>>>
>>> On Thu, Jun 1, 2017, 3:23 PM Michael Gogins <michael.gogins@gmail.com>
>>> wrote:
>>>>
>>>> See if you need the porttime library now.
>>>>
>>>> On Jun 1, 2017 12:28, "Steven Yi" <stevenyi@gmail.com> wrote:
>>>>>
>>>>> The flags had -lwinmm.  However, even worse, I deleted my
>>>>> CMakeCache.txt and retried a build using ./build.sh and the build is a
>>>>> mess now. I get linker problems for both fluidOpcodes and csound64
>>>>> (the latter pasted below).  I feel like these were problems that were
>>>>> solved a while ago but reintroduced.
>>>>>
>>>>> Could someone else building with MSYS2 do a clean build and let me
>>>>> know if you're also getting errors?
>>>>>
>>>>> [Link command]
>>>>>
>>>>> /C/msys64/mingw64/bin/gcc.exe   -mfpmath=sse -msse2
>>>>> -fomit-frame-pointer -mstackrealign -static-libgcc -static
>>>>> -fvisibility=hidden -DHAVE_PTHREAD -O2 -g -DNDEBUG  -static-libstdc++
>>>>> -static-libgcc -static -shared -o csound64.dll
>>>>> -Wl,--out-implib,libcsound64.dll.a
>>>>> -Wl,--major-image-version,0,--minor-image-version,0
>>>>> -Wl,--whole-archive CMakeFiles/csound64.dir/objects.a
>>>>> -Wl,--no-whole-archive ../../msvc/deps/lib/libsndfile.dll.a
>>>>> /C/msys64/usr/lib/libpthread.a -ladvapi32 -lcomctl32 -lcomdlg32
>>>>> -lglu32 -lkernel32 -lmsvcrt -lodbc32 -lodbccp32 -lole32 -loleaut32
>>>>> -lshell32 -luser32 -luuid -lwinmm -lwinspool -lws2_32 -lwsock32
>>>>> -ladvapi32 -lcomctl32 -lcomdlg32 -lglu32 -lkernel32 -lodbc32
>>>>> -lodbccp32 -lole32 -loleaut32 -lshell32 -luser32 -luuid -lwinmm
>>>>> -lwinspool -lws2_32 -lwsock32 -lvorbis -lvorbisenc -lspeex -lFLAC
>>>>> -logg -lcurl -lmsvcrt -lvorbis -lvorbisenc -lspeex -lFLAC -logg -lcurl
>>>>> -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32
>>>>> -luuid -lcomdlg32 -ladvapi32
>>>>>
>>>>> [output]
>>>>>
>>>>> [ 35%] Built target csound64-static
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x80):
>>>>> multiple definition of `pthread_mutex_lock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001062.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x350):
>>>>> multiple definition of `pthread_mutex_unlock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001065.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x410):
>>>>> multiple definition of `pthread_mutex_trylock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001064.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x4a0):
>>>>> multiple definition of `pthread_mutex_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001061.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x4f0):
>>>>> multiple definition of `pthread_mutex_destroy'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001059.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x530):
>>>>> multiple definition of `pthread_mutexattr_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001071.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x540):
>>>>> multiple definition of `pthread_mutexattr_destroy'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001066.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x570):
>>>>> multiple definition of `pthread_mutexattr_settype'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001075.o):fake:(.text+0x0): first
>>>>> defined here
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001023.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_barrier_destroy'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001024.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_barrier_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001025.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_barrier_wait'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001033.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_cond_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001034.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_cond_signal'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001036.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_cond_wait'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001044.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_create'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001046.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_equal'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001055.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_join'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001059.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutex_destroy'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001061.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutex_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001062.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutex_lock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001064.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutex_trylock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001065.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutex_unlock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001066.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutexattr_destroy'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001071.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutexattr_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001075.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutexattr_settype'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001088.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_self'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001099.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_spin_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001100.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_spin_lock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001102.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_spin_unlock'
>>>>> collect2.exe: error: ld returned 1 exit status
>>>>> make[2]: *** [CMakeFiles/csound64.dir/build.make:5954: csound64.dll]
>>>>> Error 1
>>>>> make[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/csound64.dir/all]
>>>>> Error 2
>>>>> make: *** [Makefile:163: all] Error 2
>>>>> Failed to run make.
>>>>>
>>>>> On Thu, Jun 1, 2017 at 2:18 AM, Stephen Kyne <stevek@outlook.ie> wrote:
>>>>> > Looks like it's missing the Winmm.lib?
>>>>> >
>>>>> >
>>>>> > https://msdn.microsoft.com/en-us/library/windows/desktop/dd798464(v=vs.85).aspx


>>>>> >
>>>>> >
>>>>> > Stephen
>>>>> >
>>>>> > ________________________________
>>>>> > From: Csound-developers <CSOUND-DEV@LISTSERV.HEANET.IE> on behalf of
>>>>> > Steven
>>>>> > Yi <stevenyi@GMAIL.COM>
>>>>> > Sent: 01 June 2017 04:08
>>>>> > To: CSOUND-DEV@LISTSERV.HEANET.IE
>>>>> > Subject: [Csnd-dev] MSYS2 - Failing to build portmidi driver
>>>>> >
>>>>> > Hi All,
>>>>> >
>>>>> > I pulled the latest from develop and am getting errors building with
>>>>> > msys2. The build errors out on rtpmidi (errors pasted below). Seems
>>>>> > like a linking issue, but I haven't quite found what's the fix. (I'm
>>>>> > also travelling for the next few weeks and am intermittently looking
>>>>> > at Csound dev.)
>>>>> >
>>>>> > Any help appreciated!
>>>>> > steven
>>>>> >
>>>>> > [ 78%] Linking C shared module ../pmidi.dll
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x38):
>>>>> > undefined reference to `__imp_midiInStop'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x4e):
>>>>> > undefined reference to `__imp_midiInReset'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x5d):
>>>>> > undefined reference to `__imp_midiInClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x92):
>>>>> > undefined reference to `__imp_midiInReset'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x9b):
>>>>> > undefined reference to `__imp_midiInClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa3):
>>>>> > undefined reference to `__imp_midiInClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcf):
>>>>> > undefined reference to `__imp_midiInGetErrorTextA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x17a):
>>>>> > undefined reference to `__imp_midiInUnprepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x213):
>>>>> > undefined reference to `__imp_midiInPrepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x225):
>>>>> > undefined reference to `__imp_midiInAddBuffer'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x24c):
>>>>> > undefined reference to `__imp_midiStreamStop'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2a2):
>>>>> > undefined reference to `__imp_midiOutUnprepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2e1):
>>>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x326):
>>>>> > undefined reference to `__imp_midiStreamOut'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x368):
>>>>> > undefined reference to `__imp_midiOutLongMsg'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x3b7):
>>>>> > undefined reference to `__imp_midiStreamPosition'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x600):
>>>>> > undefined reference to `__imp_midiOutGetErrorTextA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x646):
>>>>> > undefined reference to `__imp_midiInGetErrorTextA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x734):
>>>>> > undefined reference to `__imp_midiInOpen'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x755):
>>>>> > undefined reference to `__imp_midiInPrepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x78e):
>>>>> > undefined reference to `__imp_midiInAddBuffer'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x815):
>>>>> > undefined reference to `__imp_midiInClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x855):
>>>>> > undefined reference to `__imp_midiInStart'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x865):
>>>>> > undefined reference to `__imp_midiInReset'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x884):
>>>>> > undefined reference to `__imp_midiInGetErrorTextA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x97a):
>>>>> > undefined reference to `__imp_midiStreamOpen'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa9b):
>>>>> > undefined reference to `__imp_midiOutClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xaeb):
>>>>> > undefined reference to `__imp_midiOutOpen'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb0f):
>>>>> > undefined reference to `__imp_midiOutGetErrorTextA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb4d):
>>>>> > undefined reference to `__imp_midiStreamProperty'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xbc5):
>>>>> > undefined reference to `__imp_midiStreamRestart'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xc11):
>>>>> > undefined reference to `__imp_midiStreamClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcb2):
>>>>> > undefined reference to `__imp_midiOutClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcd5):
>>>>> > undefined reference to `__imp_midiOutGetErrorTextA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd27):
>>>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd66):
>>>>> > undefined reference to `__imp_midiStreamOut'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xdc9):
>>>>> > undefined reference to `__imp_midiOutLongMsg'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe56):
>>>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe88):
>>>>> > undefined reference to `__imp_midiOutLongMsg'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xefb):
>>>>> > undefined reference to `__imp_midiStreamOut'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1038):
>>>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1066):
>>>>> > undefined reference to `__imp_midiOutLongMsg'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x108a):
>>>>> > undefined reference to `__imp_midiOutShortMsg'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x10cb):
>>>>> > undefined reference to `__imp_midiStreamOut'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x110f):
>>>>> > undefined reference to `__imp_midiInGetDevCapsA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x115a):
>>>>> > undefined reference to `__imp_midiOutGetDevCapsA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x118f):
>>>>> > undefined reference to `__imp_midiInGetNumDevs'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1244):
>>>>> > undefined reference to `__imp_midiOutGetNumDevs'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x12):
>>>>> > undefined reference to `__imp_timeGetTime'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x50):
>>>>> > undefined reference to `__imp_timeBeginPeriod'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x5c):
>>>>> > undefined reference to `__imp_timeGetTime'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x97):
>>>>> > undefined reference to `__imp_timeSetEvent'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0xf4):
>>>>> > undefined reference to `__imp_timeEndPeriod'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x102):
>>>>> > undefined reference to `__imp_timeKillEvent'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x146):
>>>>> > undefined reference to `__imp_timeGetTime'
>>>>> > collect2.exe: error: ld returned 1 exit status
>>>>> > make[2]: *** [InOut/CMakeFiles/pmidi.dir/build.make:98: pmidi.dll]
>>>>> > Error 1
>>>>> > make[1]: *** [CMakeFiles/Makefile2:1728:
>>>>> > InOut/CMakeFiles/pmidi.dir/all]
>>>>> > Error 2
>>>>> > make: *** [Makefile:163: all] Error 2

Date2017-06-03 16:46
FromSteven Yi
SubjectRe: [Csnd-dev] MSYS2 - Failing to build portmidi driver
It's okay, I just got a little frustrated as I'm traveling and have a limited amount of time for personal work each day and didn't expect to be debugging the MSYS2 build. I'm not sure what CMake version we are supporting now, but we should be careful to navigate that carefully. (I don't know if it's possible to specify minimum CMake version per platform?  That might be one way to go forward with the VS work but also make sure that all of the shared code is working for older CMake on other platforms)




On Fri, Jun 2, 2017, 3:56 AM Stephen Kyne <stevek@outlook.ie> wrote:

Apologies if that was my change for pthreads. I wonder if we used https://cmake.org/cmake/help/v3.0/module/FindThreads.html, would that be cleaner.


I'll take a look into it and see. It's a bit of a pain to support the older cmake. Maybe best to leave it alone.


Stephen


From: Csound-developers <CSOUND-DEV@LISTSERV.HEANET.IE> on behalf of Steven Yi <stevenyi@GMAIL.COM>
Sent: 02 June 2017 02:58
To: CSOUND-DEV@LISTSERV.HEANET.IE
Subject: Re: [Csnd-dev] MSYS2 - Failing to build portmidi driver
 
Okay, I've fixed it. It had to do with the ordering of
target_link_libraries. Having PORTMIDI_LIBRARY first got it to link.

I get close to a full build now, but python interface now fails:


In file included from C:/Python27/include/Python.h:8:0,
                 from
C:/msys64/home/stevenyi/work/csound/csound/mingw64/csound-mingw64/python_interfacePYTHON_wrap.cxx:182:
C:/Python27/include/pyconfig.h:285:15: error: 'std::_hypot' has not
been declared
 #define hypot _hypot

I've just disabled it and CsoundAC and have a complete build now. I'm
going to move on now as this has taken up too much time.


On Thu, Jun 1, 2017 at 7:23 PM, Steven Yi <stevenyi@gmail.com> wrote:
> I don't use a custom cmake file either, not sure what you are
> referring to. (Maybe you misread my note about the CMake cache file?
> Deleting the cache file or deleting the csound-mingw64 folder will
> ensure a clean build from scratch.)
>
> Anyways, I had to go through git history to see that code was removed
> and only "pthread" was looked for, when the order should have been
> winpthread-1, then pthread, then pthreadGC2.  I've restored that and
> am past the pthread link issues and back to the portmidi issues.
>
> On Thu, Jun 1, 2017 at 6:16 PM, Michael Gogins <michael.gogins@gmail.com> wrote:
>> I don't use a custom cmake file. I use a script. I just pull the repo,
>> build the packages, and then run this:
>>
>> #!/bin/bash
>> echo "Overrides for Csound's CMake build system, for building Csound
>> for the Windows x64 installer."
>> echo
>> echo "Building Csound..."
>> mkdir csound-mingw64
>> cd csound-mingw64
>> pwd
>> rm -rf dist
>>
>> # -DFIND_CMAKE_SYSTEM_PATH=//mingw64 \
>> # --trace-expand \
>>
>> cmake ../.. -G "MSYS Makefiles" \
>> -DABLETON_LINK_HOME:PATH="D:\msys64\home\restore\link" \
>> -DBUILD_ABLETON_LINK_OPCODES:BOOL=0 \
>> -DBUILD_CSOUNDVST=1 \
>> -DBUILD_PD_CLASS=0 \
>> -DBUILD_STATIC_LIBRARY=1 \
>> -DBUILD_TESTS=0 \
>> -DBUILD_VST4CS_OPCODES=1 \
>> -DCMAKE_BUILD_TYPE=RelWithDebInfo \
>> -DCMAKE_VERBOSE_MAKEFILE=1 \
>> -DMUSICXML_LIBRARY:FILEPATH=/mingw64/bin/libmusicxml2.dll \
>> -DNEED_PORTTIME=1 \
>> -DPTHREAD_LIBRARY:FILEPATH=/mingw64/x86_64-w64-mingw32/lib/libpthread.a \
>> -DTCL_VERSION=8.5 \
>> -DUSE_CURL=0 \
>> -DUSE_GETTEXT=0 \
>> -DUSE_OPEN_MP=0 \
>> -D_WIN32=1 \
>> -DPYTHON_INCLUDE_DIRS:PATH="C:/Program Files/Anaconda2/include" \
>> -DPYTHON_LIBRARIES:FILEPATH="C:/Program Files/Anaconda2/libs/python27.a" \
>> -DSTK_LIBRARY:FILEPATH=/mingw64/lib/libstk.a \
>> -DLIBSNDFILE_LIBRARY:FILEPATH="C:\Program
>> Files\Mega-Nerd\libsndfile\bin\libsndfile-1.dll" \
>> -DSNDFILE_H_PATH:PATH="C:\Program Files\Mega-Nerd\libsndfile\include" \
>> -DBUILD_WEBSOCKET_OPCODE=0 \
>> -DMS_WIN64=1
>>
>> if [ $? -ne 0 ]; then
>>     echo "Failed to run CMake."
>>     exit
>> fi
>> make -j6 $@
>> if [ $? -ne 0 ]; then
>>     echo "Failed to run make."
>>     exit
>> fi
>> echo "Compiling csound.node..."
>> echo "Compiling NSIS list of targets and dependencies..."
>> C:/Program_Files/Anaconda2/python ../find_csound_dependencies.py
>> echo "Compiling Doxygen API documentation..."
>> if [ $? -ne 0 ]; then
>>     echo "Failed to identify Csound targets and dependencies."
>>     exit
>> fi
>> cd ../../doc
>> pwd
>> doxygen Doxyfile
>> if [ $? -ne 0 ]; then
>>     echo "Failed to create Csound API documentation."
>>     exit
>> fi
>> doxygen Doxyfile-CsoundAC
>> if [ $? -ne 0 ]; then
>>     echo "Failed to create CsoundAC API documentation."
>>     exit
>> fi
>> echo "Compiling Inno Setup installer..."
>> cd ../installer/windows
>> pwd
>> "C:\Program Files (x86)\Inno Setup 5\iscc.exe" csound6_x64.iss
>> if [ $? -ne 0 ]; then
>>     echo "Failed to compile Inno Setup installer."
>>     exit
>> fi
>> echo "Uninstalling Csound x64..."
>> "C:\Program Files\Csound6_x64\unins000.exe" /SILENT
>> if [ $? -ne 0 ]; then
>>     echo "Failed to uninstall Csound x64, but continuing."
>> fi
>> echo "Installing Csound x64..."
>> ./Setup_Csound6_x64_6.09.0.exe /SILENT
>> if [ $? -ne 0 ]; then
>>     echo "Failed to install Csound x64."
>>     exit
>> fi
>> echo "Finished building and installing Csound x64."
>>
>> -----------------------------------------------------
>> Michael Gogins
>> Irreducible Productions
>> http://michaelgogins.tumblr.com
Computer music, photography, some poetry and fiction, and something more or less like theology or philosophy of religion


>> Michael dot Gogins at gmail dot com
>>
>>
>> On Thu, Jun 1, 2017 at 7:07 PM, Steven Yi <stevenyi@gmail.com> wrote:
>>> I tried that yesterday but it didn't have any effect. It doesn't matter at
>>> the moment anyways as I can't even get far enough to compile the portmidi
>>> driver.
>>>
>>>
>>> On Thu, Jun 1, 2017, 3:23 PM Michael Gogins <michael.gogins@gmail.com>
>>> wrote:
>>>>
>>>> See if you need the porttime library now.
>>>>
>>>> On Jun 1, 2017 12:28, "Steven Yi" <stevenyi@gmail.com> wrote:
>>>>>
>>>>> The flags had -lwinmm.  However, even worse, I deleted my
>>>>> CMakeCache.txt and retried a build using ./build.sh and the build is a
>>>>> mess now. I get linker problems for both fluidOpcodes and csound64
>>>>> (the latter pasted below).  I feel like these were problems that were
>>>>> solved a while ago but reintroduced.
>>>>>
>>>>> Could someone else building with MSYS2 do a clean build and let me
>>>>> know if you're also getting errors?
>>>>>
>>>>> [Link command]
>>>>>
>>>>> /C/msys64/mingw64/bin/gcc.exe   -mfpmath=sse -msse2
>>>>> -fomit-frame-pointer -mstackrealign -static-libgcc -static
>>>>> -fvisibility=hidden -DHAVE_PTHREAD -O2 -g -DNDEBUG  -static-libstdc++
>>>>> -static-libgcc -static -shared -o csound64.dll
>>>>> -Wl,--out-implib,libcsound64.dll.a
>>>>> -Wl,--major-image-version,0,--minor-image-version,0
>>>>> -Wl,--whole-archive CMakeFiles/csound64.dir/objects.a
>>>>> -Wl,--no-whole-archive ../../msvc/deps/lib/libsndfile.dll.a
>>>>> /C/msys64/usr/lib/libpthread.a -ladvapi32 -lcomctl32 -lcomdlg32
>>>>> -lglu32 -lkernel32 -lmsvcrt -lodbc32 -lodbccp32 -lole32 -loleaut32
>>>>> -lshell32 -luser32 -luuid -lwinmm -lwinspool -lws2_32 -lwsock32
>>>>> -ladvapi32 -lcomctl32 -lcomdlg32 -lglu32 -lkernel32 -lodbc32
>>>>> -lodbccp32 -lole32 -loleaut32 -lshell32 -luser32 -luuid -lwinmm
>>>>> -lwinspool -lws2_32 -lwsock32 -lvorbis -lvorbisenc -lspeex -lFLAC
>>>>> -logg -lcurl -lmsvcrt -lvorbis -lvorbisenc -lspeex -lFLAC -logg -lcurl
>>>>> -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32
>>>>> -luuid -lcomdlg32 -ladvapi32
>>>>>
>>>>> [output]
>>>>>
>>>>> [ 35%] Built target csound64-static
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x80):
>>>>> multiple definition of `pthread_mutex_lock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001062.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x350):
>>>>> multiple definition of `pthread_mutex_unlock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001065.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x410):
>>>>> multiple definition of `pthread_mutex_trylock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001064.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x4a0):
>>>>> multiple definition of `pthread_mutex_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001061.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x4f0):
>>>>> multiple definition of `pthread_mutex_destroy'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001059.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x530):
>>>>> multiple definition of `pthread_mutexattr_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001071.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x540):
>>>>> multiple definition of `pthread_mutexattr_destroy'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001066.o):fake:(.text+0x0): first
>>>>> defined here
>>>>>
>>>>> C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../x86_64-w64-mingw32/lib/../lib\libpthread.a(libwinpthread_la-mutex.o):(.text+0x570):
>>>>> multiple definition of `pthread_mutexattr_settype'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001075.o):fake:(.text+0x0): first
>>>>> defined here
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001023.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_barrier_destroy'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001024.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_barrier_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001025.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_barrier_wait'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001033.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_cond_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001034.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_cond_signal'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001036.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_cond_wait'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001044.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_create'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001046.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_equal'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001055.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_join'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001059.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutex_destroy'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001061.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutex_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001062.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutex_lock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001064.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutex_trylock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001065.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutex_unlock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001066.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutexattr_destroy'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001071.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutexattr_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001075.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_mutexattr_settype'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001088.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_self'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001099.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_spin_init'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001100.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_spin_lock'
>>>>> C:/msys64/usr/lib/libpthread.a(t-d001102.o):fake:(.text+0x2):
>>>>> undefined reference to `__imp_pthread_spin_unlock'
>>>>> collect2.exe: error: ld returned 1 exit status
>>>>> make[2]: *** [CMakeFiles/csound64.dir/build.make:5954: csound64.dll]
>>>>> Error 1
>>>>> make[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/csound64.dir/all]
>>>>> Error 2
>>>>> make: *** [Makefile:163: all] Error 2
>>>>> Failed to run make.
>>>>>
>>>>> On Thu, Jun 1, 2017 at 2:18 AM, Stephen Kyne <stevek@outlook.ie> wrote:
>>>>> > Looks like it's missing the Winmm.lib?
>>>>> >
>>>>> >
>>>>> > https://msdn.microsoft.com/en-us/library/windows/desktop/dd798464(v=vs.85).aspx
The midiInUnprepareHeader function cleans up the preparation performed by the midiInPrepareHeader function.


>>>>> >
>>>>> >
>>>>> > Stephen
>>>>> >
>>>>> > ________________________________
>>>>> > From: Csound-developers <CSOUND-DEV@LISTSERV.HEANET.IE> on behalf of
>>>>> > Steven
>>>>> > Yi <stevenyi@GMAIL.COM>
>>>>> > Sent: 01 June 2017 04:08
>>>>> > To: CSOUND-DEV@LISTSERV.HEANET.IE
>>>>> > Subject: [Csnd-dev] MSYS2 - Failing to build portmidi driver
>>>>> >
>>>>> > Hi All,
>>>>> >
>>>>> > I pulled the latest from develop and am getting errors building with
>>>>> > msys2. The build errors out on rtpmidi (errors pasted below). Seems
>>>>> > like a linking issue, but I haven't quite found what's the fix. (I'm
>>>>> > also travelling for the next few weeks and am intermittently looking
>>>>> > at Csound dev.)
>>>>> >
>>>>> > Any help appreciated!
>>>>> > steven
>>>>> >
>>>>> > [ 78%] Linking C shared module ../pmidi.dll
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x38):
>>>>> > undefined reference to `__imp_midiInStop'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x4e):
>>>>> > undefined reference to `__imp_midiInReset'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x5d):
>>>>> > undefined reference to `__imp_midiInClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x92):
>>>>> > undefined reference to `__imp_midiInReset'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x9b):
>>>>> > undefined reference to `__imp_midiInClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa3):
>>>>> > undefined reference to `__imp_midiInClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcf):
>>>>> > undefined reference to `__imp_midiInGetErrorTextA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x17a):
>>>>> > undefined reference to `__imp_midiInUnprepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x213):
>>>>> > undefined reference to `__imp_midiInPrepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x225):
>>>>> > undefined reference to `__imp_midiInAddBuffer'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x24c):
>>>>> > undefined reference to `__imp_midiStreamStop'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2a2):
>>>>> > undefined reference to `__imp_midiOutUnprepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x2e1):
>>>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x326):
>>>>> > undefined reference to `__imp_midiStreamOut'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x368):
>>>>> > undefined reference to `__imp_midiOutLongMsg'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x3b7):
>>>>> > undefined reference to `__imp_midiStreamPosition'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x600):
>>>>> > undefined reference to `__imp_midiOutGetErrorTextA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x646):
>>>>> > undefined reference to `__imp_midiInGetErrorTextA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x734):
>>>>> > undefined reference to `__imp_midiInOpen'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x755):
>>>>> > undefined reference to `__imp_midiInPrepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x78e):
>>>>> > undefined reference to `__imp_midiInAddBuffer'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x815):
>>>>> > undefined reference to `__imp_midiInClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x855):
>>>>> > undefined reference to `__imp_midiInStart'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x865):
>>>>> > undefined reference to `__imp_midiInReset'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x884):
>>>>> > undefined reference to `__imp_midiInGetErrorTextA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x97a):
>>>>> > undefined reference to `__imp_midiStreamOpen'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xa9b):
>>>>> > undefined reference to `__imp_midiOutClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xaeb):
>>>>> > undefined reference to `__imp_midiOutOpen'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb0f):
>>>>> > undefined reference to `__imp_midiOutGetErrorTextA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xb4d):
>>>>> > undefined reference to `__imp_midiStreamProperty'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xbc5):
>>>>> > undefined reference to `__imp_midiStreamRestart'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xc11):
>>>>> > undefined reference to `__imp_midiStreamClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcb2):
>>>>> > undefined reference to `__imp_midiOutClose'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xcd5):
>>>>> > undefined reference to `__imp_midiOutGetErrorTextA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd27):
>>>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xd66):
>>>>> > undefined reference to `__imp_midiStreamOut'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xdc9):
>>>>> > undefined reference to `__imp_midiOutLongMsg'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe56):
>>>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xe88):
>>>>> > undefined reference to `__imp_midiOutLongMsg'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0xefb):
>>>>> > undefined reference to `__imp_midiStreamOut'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1038):
>>>>> > undefined reference to `__imp_midiOutPrepareHeader'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1066):
>>>>> > undefined reference to `__imp_midiOutLongMsg'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x108a):
>>>>> > undefined reference to `__imp_midiOutShortMsg'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x10cb):
>>>>> > undefined reference to `__imp_midiStreamOut'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x110f):
>>>>> > undefined reference to `__imp_midiInGetDevCapsA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x115a):
>>>>> > undefined reference to `__imp_midiOutGetDevCapsA'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x118f):
>>>>> > undefined reference to `__imp_midiInGetNumDevs'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(pmwinmm.c.obj):(.text+0x1244):
>>>>> > undefined reference to `__imp_midiOutGetNumDevs'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x12):
>>>>> > undefined reference to `__imp_timeGetTime'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x50):
>>>>> > undefined reference to `__imp_timeBeginPeriod'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x5c):
>>>>> > undefined reference to `__imp_timeGetTime'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x97):
>>>>> > undefined reference to `__imp_timeSetEvent'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0xf4):
>>>>> > undefined reference to `__imp_timeEndPeriod'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x102):
>>>>> > undefined reference to `__imp_timeKillEvent'
>>>>> >
>>>>> > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.3.0/../../../../lib\libportmidi.a(ptwinmm.c.obj):(.text+0x146):
>>>>> > undefined reference to `__imp_timeGetTime'
>>>>> > collect2.exe: error: ld returned 1 exit status
>>>>> > make[2]: *** [InOut/CMakeFiles/pmidi.dir/build.make:98: pmidi.dll]
>>>>> > Error 1
>>>>> > make[1]: *** [CMakeFiles/Makefile2:1728:
>>>>> > InOut/CMakeFiles/pmidi.dir/all]
>>>>> > Error 2
>>>>> > make: *** [Makefile:163: all] Error 2