linker - trying to build a PortMidi example in Mingw -


im trying build portmidi example in mingw depends on 2 libraries portmidi , winmm, recompiled portmidi portimidi.a im getting errors of missing code.

is posible link winmm mingw, , have use ".a" or ".lib" libraries?

im using command compile source:

g++ -o prg latency.c -iheaders -llib -lportmidi -lwinmm  

thanks help.

you don't need winmm.a build latency.c

you need
libpmjni.dll.a , libportmidi.dll.a or
libportmidi_s.a

to build portmidi wit cmake takes 5 minutes.

  • portmidi source : c:/src/portmidi217/
  • portmidi build : c:/mingw/portmidi

then can compile following command.

gcc.exe  -c -g -i/c/src/portmidi217/pm_common -i/c/src/portmidi217/porttime -mmd -mp -mf build/debug/latency.o.d -o build/debug/latency.o latency.c mkdir -p dist/debug gcc.exe  -o dist/debug/latency build/debug/latency.o -l/c/mingw/portmidi -lpmjni.dll -lportmidi.dll  


building portmidi cmake

  • download or use cmake
  • in c:\cmake\bin folder double click cmake-gui.exe

unzip portmidi folder c:\mingw\src\portmidi217 can see in next image
(replace t:\ c:\ of course)

enter image description here

press configure

enter image description here

settings described --> click next

enter image description here

settings described --> click ok

enter image description here

there errors click configure again

enter image description here

next looks better click configure again

enter image description here

settings described release or debug
maybe worked without c:\msys\1.0\bin\sh.exe
click configure again

enter image description here

looks --> click generate

enter image description here

cd builded c:\mingw\portmidi

enter image description here

open windows command type make

enter image description here

it takes short time build

enter image description here

there : .a , .dll

enter image description here

  • copy .a c:\mingw\lib
  • copy .dll c:\mingw\bin
  • copy c:\mingw\src\portmidi217\pm_common , c:\mingw\src\portmidi217\porttime
    .h folder latency.c is.

then can latency.c compile described above, need adjust paths.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -