[half-SOLVED] Share Keyboard+Mouse between 2 computers(Haiku-Win) through KM Switch

The post you referred to contains links to 2 different programs. Which one did you attempted to build?

I am getting this :

barrier-haiku> make
g++ -c haiku-ubarrier.cpp -iquote./  -iquote./  -iquoteobjects.x86_64-cc8-release/  -isystem/boot/system/develop/headers/private/storage/  -isystem/boot/system/develop/headers/private/input/  -isystem/boot/system/develop/headers/private/shared/  -isystem/boot/system/develop/headers/private/interface/  -O3    -o "objects.x86_64-cc8-release/haiku-ubarrier.o"
haiku-ubarrier.cpp: In member function 'virtual status_t uBarrierInputServerDevice::Start(const char*, void*)':
haiku-ubarrier.cpp:318:2: error: 'snprintf' was not declared in this scope
  snprintf(threadName, B_OS_NAME_LENGTH, "uBarrier haiku");
  ^~~~~~~~
haiku-ubarrier.cpp:318:2: note: 'snprintf' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?
haiku-ubarrier.cpp:52:1:
+#include <cstdio>
 
haiku-ubarrier.cpp:318:2:
  snprintf(threadName, B_OS_NAME_LENGTH, "uBarrier haiku");
  ^~~~~~~~
/boot/system/develop/etc/makefile-engine:297: recipe for target 'objects.x86_64-cc8-release/haiku-ubarrier.o' failed
make: *** [objects.x86_64-cc8-release/haiku-ubarrier.o] Error 1

You’ll want to use preformated text for this kind of things, so the forum doesn’t eat the < > stuff as HTML.

As I said, it’s snprintf it wants, and gcc even tells you which header to use. Possibly the x86_64 headers don’t self-include in the same way as on 32bit… Or maybe the code was only ever tested with GCC2 which ships different headers.

1 Like

Good day,

looks like this is not solved yet :disappointed_relieved:

Sometimes it works, sometimes it doesn’t. Actually as reported in the ticket, after some time without switching to Haiku, Haiku can’t detect the availability of the usb devices. Something is still going on there, with the switch connected to the USB 2.0 port.

Regards,
RR

Addin #include <stdio.h> somewhere in top of haiku-ubarrier.cpp will make it to build…

1 Like

Good day,

As of lately, this issue seems to have improved. I’ve been all this afternoon switching from Windows to Haiku and viceversa and it “seems fine”. I quote this because of this pics:
screenshot1
screenshot2

So, what looks like it is happening now, is that each time I switch from Windows to Haiku, Haiku adds several new keyboards and several new mouses. Meaning that, the more I switch, the more input devices appear on the list. This only happens in the Input preferences, as listusb command spits what it should, only the devices connected to USB.

Looks like instead of detecting the same devices over and over, Input preferences treats devices as new ones each time the KM switch activates the Haiku pc. :scream:

I’ll add this to the ticket (https://dev.haiku-os.org/ticket/11793).
Regards,
RR