jimm / keymaster

MIDI processing and patching system
3 stars 0 forks source link

Build errors #2

Open mxmilkiib opened 23 hours ago

mxmilkiib commented 23 hours ago

On Arch Linux;

20:07:30 milk@red:~/src/keymaster main ± make
g++  -std=c++14 -MD -MP -g  -I/usr/lib/wx/include/gtk3-unicode-3.2 -I/usr/include/wx-3.2 -DWXUSINGDLL -D__WXGTK3__ -D__WXGTK__ -D_FILE_OFFSET_BITS=64   -c -o src/clock.o src/clock.cpp
In file included from src/clock.cpp:2:
src/clock.h: In member function ‘bool Clock::is_running()’:
src/clock.h:32:37: error: invalid operands of types ‘pthread_t’ {aka ‘long unsigned int’} and ‘std::nullptr_t’ to binary ‘operator!=’
   32 |   bool is_running() { return thread != nullptr; }
      |                              ~~~~~~~^~~~~~~~~~
src/clock.cpp: In constructor ‘Clock::Clock(std::vector<Input*>&)’:
src/clock.cpp:20:31: error: cannot convert ‘std::nullptr_t’ to ‘pthread_t’ {aka ‘long unsigned int’} in initialization
   20 |   : inputs(km_inputs), thread(nullptr)
      |                               ^~~~~~~
      |                               |
      |                               std::nullptr_t
src/clock.cpp: In member function ‘void Clock::stop()’:
src/clock.cpp:48:14: error: invalid operands of types ‘pthread_t’ {aka ‘long unsigned int’} and ‘std::nullptr_t’ to binary ‘operator==’
   48 |   if (thread == nullptr)
      |       ~~~~~~~^~~~~~~~~~
src/clock.cpp:50:12: error: cannot convert ‘std::nullptr_t’ to ‘pthread_t’ {aka ‘long unsigned int’} in assignment
   50 |   thread = nullptr;
      |            ^~~~~~~
make: *** [<builtin>: src/clock.o] Error 1
jimm commented 22 hours ago

Thanks for letting me know about this. I'll see if I can reproduce this in a linux Docker instance or something like that; I don't have direct access to a linux machine.

In the meantime, can you replace all of the nullptr occurrences for thread in that file with 0 instead? That might work.

BTW, I'm actually rewriting KeyMaster in JUCE (https://juce.com/) which will allow for a nicer cross-platform GUI and hopefully better cross-platform portability and realtime MIDI handling. See https://github.com/jimm/juce-keymaster though it's not done quite yet.

jimm commented 22 hours ago

You might also have to change the one in clock.h on line 32 as well.

jimm commented 21 hours ago

I'm having trouble getting an arch linux installation up and configured (I don't know pacman well and updating things didn't go very well, let alone trying to install anything). However, in an Ubuntu image I saw the same errors you saw but in src/input.cpp instead. Replacing the nullptr instances with 0 where the errors were fixed the errors.