I'm finishing up work on new [leapmotion] and [ultraleap] externals and trying to make them available for all compatible platforms (I'll skip the rundown of which hardware and SDKs work on which platforms here unless it's helpful).
I've got everything working except the [leapmotion] external for Windows. I'm using pd-lib-builder and MSYS2 MinGW 64-bit and am able to compile successfully, but linking to the 64-bit Leap library fails with a stream of "undefined reference to" messages. I'm positive that gcc can find the Leap.h header and the Leap.lib/Leap.dll libraries in my Leap SDK 2.3.1 directory, and have done a nearly identical build process for the [ultraleap] using the LeapC SDK 5.7.2 where linking succeeds and everything works fine.
I'd be very grateful if anyone could shed some light on what I'm doing wrong here. There's no need for any Leap hardware for building, you just need to clone my [leapmotion] repo here: https://github.com/wbrent/leapmotion and download Leap SDK version 2.3.1 for Windows here: https://developer.leapmotion.com/releases
From there it's just a matter of editing the Makefile to specify your Leap SDK directory location and attempting a "make" in MSYS2. I'm using Windows 10 Home, Pd 0.53-1 (amd64-32), and pd-lib-builder version 0.6.0. Below is a truncated version of what I get in my attempts.
Any suggestions or further questions are welcome, thanks! William
++++ info: using Makefile.pdlibbuilder version 0.6.0 ++++ info: using Pd API C:\Program Files/Pd/src/m_pd.h ++++ info: making target all in lib leapmotion ++++ info: making src/leapmotion.o in lib leapmotion g++ -DPD -I "C:\Program Files/Pd/src" -DMSW -DNT -DPD_LONGINTTYPE=__int64 -fcheck-new -Iinclude -I/c/msys64/dev/LeapDeveloperKit_2.3.1+31549_win/LeapSDK/include -Wall -Wextra -Wshadow -Winline -Wstrict-aliasing -O3 -ffast-math -funroll-loops -fomit-frame-pointer -march=core2 -msse -msse2 -msse3 -mfpmath=sse -o src/leapmotion.o -c src/leapmotion.cpp . . . ++++ info: making src/Dispatcher.o in lib leapmotion g++ -DPD -I "C:\Program Files/Pd/src" -DMSW -DNT -DPD_LONGINTTYPE=__int64 -fcheck-new -Iinclude -I/c/msys64/dev/LeapDeveloperKit_2.3.1+31549_win/LeapSDK/include -Wall -Wextra -Wshadow -Winline -Wstrict-aliasing -O3 -ffast-math -funroll-loops -fomit-frame-pointer -march=core2 -msse -msse2 -msse3 -mfpmath=sse -o src/Dispatcher.o -c src/Dispatcher.cpp . . . ++++ info: making src/LeapMotionObj.o in lib leapmotion g++ -DPD -I "C:\Program Files/Pd/src" -DMSW -DNT -DPD_LONGINTTYPE=__int64 -fcheck-new -Iinclude -I/c/msys64/dev/LeapDeveloperKit_2.3.1+31549_win/LeapSDK/include -Wall -Wextra -Wshadow -Winline -Wstrict-aliasing -O3 -ffast-math -funroll-loops -fomit-frame-pointer -march=core2 -msse -msse2 -msse3 -mfpmath=sse -o src/LeapMotionObj.o -c src/LeapMotionObj.cpp . . . ++++ info: linking objects in leapmotion.dll for lib leapmotion g++ -static-libgcc -static-libstdc++ -shared -Wl,--enable-auto-import "C:\Program Files/Pd/bin/pd.dll" -L/c/msys64/dev/LeapDeveloperKit_2.3.1+31549_win/LeapSDK/lib/x64 -o leapmotion.dll src/leapmotion.o src/Dispatcher.o src/LeapMotionObj.o -lLeap C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/leapmotion.o:leapmotion.cpp:(.text+0x411): undefined reference to `Leap::Frame::timestamp() cons t' C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/leapmotion.o:leapmotion.cpp:(.text+0x45d): undefined reference to `Leap::Frame::Frame()' . . . C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/LeapMotionObj.o:LeapMotionObj.:(.text+0xf8): undefined reference to `Leap::Interface::~Interface ()' collect2.exe: error: ld returned 1 exit status make: *** [pd-lib-builder//Makefile.pdlibbuilder:885: leapmotion.dll] Error 1
--
William Brent
“Great minds flock together” Conflations: conversational idiom for the 21st century