microdee/UE4-SpaceMouse

Request: Please add Linux support

Hunanbean opened this issue · 20 comments

Currently, the code does not compile on Linux. In this case Arch/Manjaro. Pretty sure i already checked it on Debian/Ubuntu/Mint too.

Unless i am mistaken, it should technically be able to be made to work on Linux. Correct?

Hey! I've never developed on Linux and I don't have a Linux environment set up. There's nothing platform specific in any of the modules here though and HIDUE has the hypothetical Linux HIDAPI included so from my guesses that's causing compile errors. Can you please share the console output of UBT and if you have some free-time could you push a fix if it's easy? That would be really awesome.

Howdy! glad to see you are still active :)
Building plugins work slightly differently on Linux as opposed to Windows. For example, to build the plugin i would run this.

./RunUAT.sh BuildPlugin -Plugin="/home/waterspell/Epic/2build/SpaceMouse/SpaceMouse.uplugin" -Package="/home/waterspell/Epic/built/SpaceMouseLinux/"

Which returned a result about missing #include libudev.h Which was fixed by making the #include /usr/include/libudev.h

After this fix, there is a long report of warnings and errors, which i am just now looking in to.

Running AutomationTool...

//Boilerplate Information here//
  ------------------------------
  Writing manifest to /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Saved/Manifest-UE4Editor-Linux-Development.xml
  Building UE4Editor...
  Performing 16 actions (16 in parallel)
  [3/16] Compile PCH.SpaceMouseRuntime.h
  [2/16] Compile PCH.SpaceMouseReader.h
  [1/16] Compile PCH.HIDUE.h
  [4/16] Compile PCH.SpaceMouse.h
  [5/16] Compile Module.HIDUE.cpp
  [6/16] Compile Module.SpaceMouseReader.cpp
  [7/16] Compile Module.SpaceMouseReader.gen.cpp
  [8/16] Link (lld) libUE4Editor-HIDUE.so
  ld.lld: error: undefined symbol: udev_new
  >>> referenced by hid.cpp:414 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:414)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(hid_enumerate)
  >>> referenced by hid.cpp:288 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:288)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(get_device_string(hid_device_*, device_string_id, wchar_t*, unsigned long))
  
  ld.lld: error: undefined symbol: udev_enumerate_new
  >>> referenced by hid.cpp:421 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:421)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(hid_enumerate)
  
  ld.lld: error: undefined symbol: udev_enumerate_add_match_subsystem
  >>> referenced by hid.cpp:422 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:422)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(hid_enumerate)
  
  ld.lld: error: undefined symbol: udev_enumerate_scan_devices
  >>> referenced by hid.cpp:423 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:423)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(hid_enumerate)
  
  ld.lld: error: undefined symbol: udev_enumerate_get_list_entry
  >>> referenced by hid.cpp:424 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:424)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(hid_enumerate)
  
  ld.lld: error: undefined symbol: udev_enumerate_unref
  >>> referenced by hid.cpp:583 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:583)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(hid_enumerate)
  
  ld.lld: error: undefined symbol: udev_unref
  >>> referenced by hid.cpp:584 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:584)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(hid_enumerate)
  >>> referenced by hid.cpp:375 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:375)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(get_device_string(hid_device_*, device_string_id, wchar_t*, unsigned long))
  
  ld.lld: error: undefined symbol: udev_device_unref
  >>> referenced by hid.cpp:577 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:577)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(hid_enumerate)
  >>> referenced by hid.cpp:372 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:372)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(get_device_string(hid_device_*, device_string_id, wchar_t*, unsigned long))
  
  ld.lld: error: undefined symbol: udev_list_entry_get_next
  >>> referenced by hid.cpp:427 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:427)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(hid_enumerate)
  
  ld.lld: error: undefined symbol: udev_list_entry_get_name
  >>> referenced by hid.cpp:444 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:444)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(hid_enumerate)
  
  ld.lld: error: undefined symbol: udev_device_new_from_syspath
  >>> referenced by hid.cpp:445 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:445)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(hid_enumerate)
  
  ld.lld: error: undefined symbol: udev_device_get_devnode
  >>> referenced by hid.cpp:446 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:446)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(hid_enumerate)
  
  ld.lld: error: undefined symbol: udev_device_get_parent_with_subsystem_devtype
  >>> referenced by hid.cpp:448 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:448)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(hid_enumerate)
  >>> referenced by hid.cpp:517 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:517)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(hid_enumerate)
  >>> referenced by hid.cpp:549 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:549)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(hid_enumerate)
  >>> referenced 2 more times
  
  ld.lld: error: undefined symbol: udev_device_get_sysattr_value
  >>> referenced by hid.cpp:459 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:459)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(hid_enumerate)
  >>> referenced by hid.cpp:155 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:155)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(hid_enumerate)
  >>> referenced by hid.cpp:155 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:155)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(hid_enumerate)
  >>> referenced 4 more times
  
  ld.lld: error: undefined symbol: udev_device_new_from_devnum
  >>> referenced by hid.cpp:299 (/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/Private/Linux/hid.cpp:299)
  >>>               /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/HIDUE/Module.HIDUE.cpp.o:(get_device_string(hid_device_*, device_string_id, wchar_t*, unsigned long))
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)
  [9/16] Compile Module.SpaceMouseRuntime.cpp
  [10/16] Compile Module.SpaceMouseRuntime.gen.cpp
  [11/16] Compile Module.SpaceMouse.cpp
  [12/16] Compile Module.SpaceMouse.gen.cpp
  In file included from /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/SpaceMouse/Module.SpaceMouse.gen.cpp:4:
  In file included from /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Inc/SpaceMouse/SpaceMouseConfig.gen.cpp:8:
  /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/SpaceMouse/Public/SpaceMouseConfig.h:255:91: error: unknown type name 'EV3DCmd'
      static void SetCommandBinding(FInputBindingManager& Ibm, FName InCmdCtx, FName InCmd, EV3DCmd SmButton);
                                                                                            ^
  /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/SpaceMouse/Public/SpaceMouseConfig.h:256:69: error: unknown type name 'EV3DCmd'
      static void SetCommandBinding(TSharedPtr<FUICommandInfo> InCmd, EV3DCmd SmButton);
                                                                      ^
  2 errors generated.
  In file included from /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/SpaceMouseReader/Module.SpaceMouseReader.cpp:22:
  /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/SpaceMouseReader/Private/SpaceMouseManager.cpp:87:25: error: loop variable 'SmDevice' creates a copy from type 'const TSharedPtr<FSmDevice, ESPMode::NotThreadSafe>' [-Werror,-Wrange-loop-construct]
          for (const auto SmDevice : Devices)
                          ^
  /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/SpaceMouseReader/Private/SpaceMouseManager.cpp:87:14: note: use reference type 'const TSharedPtr<FSmDevice, ESPMode::NotThreadSafe> &' to prevent copying
          for (const auto SmDevice : Devices)
               ^~~~~~~~~~~~~~~~~~~~~
                          &
  1 error generated.
  In file included from /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/SpaceMouse/Module.SpaceMouse.cpp:7:
  /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/SpaceMouse/Private/SpaceMouseConfig.cpp:103:24: error: loop variable 'Kvp' creates a copy from type 'const TTuple<FString, FUICommandName>' [-Werror,-Wrange-loop-construct]
          for(const auto Kvp : CustomInputBindings)
                         ^
  /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/SpaceMouse/Private/SpaceMouseConfig.cpp:103:13: note: use reference type 'const TTuple<FString, FUICommandName> &' to prevent copying
          for(const auto Kvp : CustomInputBindings)
              ^~~~~~~~~~~~~~~~
                         &
  1 error generated.
Took 17.182681s to run mono, ExitCode=6
UnrealBuildTool failed. See log for more details. (/home/waterspell/Library/Logs/Unreal Engine/LocalBuildLogs/UBT-UE4Editor-Linux-Development.txt)
AutomationTool exiting with ExitCode=6 (6)
RunUAT ERROR: AutomationTool was unable to run successfully.

Nice! I can see 4 immediate things

  • apparently /usr/include needs to be added to the PublicIncludePaths in HIDUE.Build.cs
  • probably a static library has to be linked for libudev I guess via PublicAdditionalLibraries. I have no idea about where these are on a typical linux setup, afair libusb and libudev can be installed via most package managers.
  • For some reason EV3DCmd is broke on linux? I wonder why I copied those into the repo from 3DxWare SDK.
  • UE4 doesn't tolerate ranged for loop variable by copy apparently with GCC, just make them a reference: for(const auto& SmDevice : Devices)
  • Then it will probably misbehave in runtime because life is unfair...

For compiling you can try the facility I have for UE boilerplate (https://github.com/microdee/UE4-SpaceMouse-TestProject) but that's optional, and again untested on Linux.

PS.: I've updated your comment for better formatting

Thank you very much for the information! I am not a programmer, so i have to hack through all of this, and that helped a lot!
Regarding formatting, sorry about that. i have to look into how to do that properly on github

also, i do not understand this line. " I wonder why I copied those into the repo from 3DxWare SDK."
do you mean you wonder why you did it, or you wonder why it fails because you did do it?

Ok, the EV3DCmd errors are the only ones left.

As can be seen, i have not taken a course in github comment code formatting yet. sorry

[12/16] Compile Module.SpaceMouse.cpp
  In file included from /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/SpaceMouse/Module.SpaceMouse.gen.cpp:4:
  In file included from /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Inc/SpaceMouse/SpaceMouseConfig.gen.cpp:8:
  /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/SpaceMouse/Public/SpaceMouseConfig.h:255:91: error: unknown type name 'EV3DCmd'
      static void SetCommandBinding(FInputBindingManager& Ibm, FName InCmdCtx, FName InCmd, EV3DCmd SmButton);
                                                                                            ^
  /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/SpaceMouse/Public/SpaceMouseConfig.h:256:69: error: unknown type name 'EV3DCmd'
      static void SetCommandBinding(TSharedPtr<FUICommandInfo> InCmd, EV3DCmd SmButton);
                                                                      ^
  2 errors generated.

Also, just to clarify that when you see EV3DCmd, you are not thinking of V3DCMD

also, i do not understand this line. " I wonder why I copied those into the repo from 3DxWare SDK."
do you mean you wonder why you did it, or you wonder why it fails because you did do it?

Sorry missing comma, I meant "I wonder why <comma> I copied those..."
You can do mono-spaced code blocks via

```
my code...
```

it should look like this

my code...

it's not github specific, it's standard markdown syntax

Also, just to clarify that when you see EV3DCmd, you are not thinking of V3DCMD

yeah EV3DCmd defined here: https://github.com/microdee/UE4-SpaceMouse/blob/master/Source/SpaceMouseReader/Public/SmButtons.h#L46

Maybe I was a victim of include leakage during unity/jumbo build on windows. You might be able to fix that by including SmButtons.h at the top of SpaceMouseConfig.h

#include "SmButtons.h"

after here https://github.com/microdee/UE4-SpaceMouse/blob/master/Source/SpaceMouse/Public/SpaceMouseConfig.h#L12

If you managed to compile it, I encourage you to create a pull request so others can also enjoy the results of these endeavors. Even if it doesn't work immediately at runtime you can always update your PR with new commits

Thanks for the clarification and the instruction! I was using the insert code button, which obviously does not work quite the same :)

Ok, it is rather strange. I mean, i am pretty sure EV3DCmd is defined in Buttons.h or perhaps Smbuttons (getting late) and that, that is called/configured before it should be looking for it.

  In file included from /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/SpaceMouse/Module.SpaceMouse.gen.cpp:4:
  In file included from /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Intermediate/Build/Linux/B4D820EA/UE4Editor/Inc/SpaceMouse/SpaceMouseConfig.gen.cpp:8:
  /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/SpaceMouse/Public/SpaceMouseConfig.h:257:91: error: unknown type name 'EV3DCmd'
      static void SetCommandBinding(FInputBindingManager& Ibm, FName InCmdCtx, FName InCmd, EV3DCmd SmButton);
                                                                                            ^
  /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/SpaceMouse/Public/SpaceMouseConfig.h:258:69: error: unknown type name 'EV3DCmd'
      static void SetCommandBinding(TSharedPtr<FUICommandInfo> InCmd, EV3DCmd SmButton);
                                                                      ^

I will definitely open a pull request if/when i can compile this. I think i must have made a mistake though. I have been attempting to build from the downloaded plugin, not the source from Git. I do not have a SmButtons.h file. I will download the source code directly and try that. Thank you for the continued help and education!

Edit: I can tell you, earlier, i did do that include with the Buttons.h file, but then the build failed at 12/16 without any error, and a clean log. Attempting now from the actual code on Git instead of the downloaded plugin. (Yes, i probably should have done that from the beginning, but this kind of stuff is still new to me :) )

Ok, if i download the main branch directly, i get SmButtons.h, but it all appears to be a 4.26 version. When i go to releases and download the 4.27 source, it is just Buttons.h. I am attempting to compile for 4.27 at this point, so, I am pretty sure i am at a brick wall. As i said, earlier when i #include Buttons.h it causes the build to fail, but without any error messages.

It is probably something else i messed up trying to figure things otu. still trying.

To fix this error,

'error: loop variable 'SmDevice' creates a copy from type 'const TSharedPtr<FSmDevice, ESPMode::NotThreadSafe>' [-Werror,-Wrange-loop-construct]
for (const auto SmDevice : Devices)

i just did

          for (const auto& SmDevice : Devices)

Is that correct?

I do not know what else to try. here is where i am at on the last run for the night.

Running AutomationTool...

Fixing inconsistent case in filenames.
Setting up Mono
Start UAT: mono AutomationTool.exe BuildPlugin -Plugin=/home/waterspell/Epic/2build/SpaceMouse/SpaceMouse.uplugin -Package=/home/waterspell/Epic/built/SpaceMouseLinux/
Parsing command line: BuildPlugin -Plugin=/home/waterspell/Epic/2build/SpaceMouse/SpaceMouse.uplugin -Package=/home/waterspell/Epic/built/SpaceMouseLinux/
Copying 101 file(s) using max 64 thread(s)
Reading plugin from /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/SpaceMouse.uplugin...
Building plugin for host platforms: Linux
Running: mono "/home/waterspell/Epic/dev-4.27.1/Engine/Binaries/DotNET/UnrealBuildTool.exe" UE4Editor Linux Development -Project=/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/HostProject.uproject -plugin=/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/SpaceMouse.uplugin -iwyu -noubtmakefiles -manifest=/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Saved/Manifest-UE4Editor-Linux-Development.xml -nohotreload -log="/home/waterspell/Library/Logs/Unreal Engine/LocalBuildLogs/UBT-UE4Editor-Linux-Development.txt"
  /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/SpaceMouse/SpaceMouse.Build.cs: warning: Modules must specify an explicit precompiled header (eg. PrivatePCHHeaderFile = "Public/SSmKeySelector.h") from UE 4.21 onwards.
  /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/SpaceMouseReader/SpaceMouseReader.Build.cs: warning: Modules must specify an explicit precompiled header (eg. PrivatePCHHeaderFile = "Public/Buttons.h") from UE 4.21 onwards.
  /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/HIDUE/HIDUE.Build.cs: warning: Modules must specify an explicit precompiled header (eg. PrivatePCHHeaderFile = "Public/HIDUE.h") from UE 4.21 onwards.
  /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Plugins/SpaceMouse/Source/SpaceMouseRuntime/SpaceMouseRuntime.Build.cs: warning: Modules must specify an explicit precompiled header (eg. PrivatePCHHeaderFile = "Public/SmInputDevice.h") from UE 4.21 onwards.
  Parsing headers for UE4Editor
    Running UnrealHeaderTool "/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/HostProject.uproject" "/home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Intermediate/Build/Linux/B4D820EA/UE4Editor/Development/UE4Editor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -abslog="/home/waterspell/Library/Logs/Unreal Engine/LocalBuildLogs/UHT-UE4Editor-Linux-Development.txt" -installed
  Looking for binary: ../../../Engine/Programs/UnrealHeaderTool/Config/BinaryConfig.ini
  LogInit: Display: Loading text-based GConfig....
  Reflection code generated for UE4Editor in 3.8364871 seconds
  ------- Build details --------
  Using toolchain located at '/home/waterspell/Epic/dev-4.27.1/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v19_clang-11.0.1-centos7/x86_64-unknown-linux-gnu'.
  Using clang (/home/waterspell/Epic/dev-4.27.1/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v19_clang-11.0.1-centos7/x86_64-unknown-linux-gnu/bin/clang++) version '11.0.1' (string), 11 (major), 0 (minor), 1 (patch)
  Using bundled libc++ standard C++ library.
  Using lld linker
  Using llvm-ar : /home/waterspell/Epic/dev-4.27.1/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v19_clang-11.0.1-centos7/x86_64-unknown-linux-gnu/bin/llvm-ar
  Using fast way to relink  circularly dependent libraries (no FixDeps).
  ------------------------------
  Writing manifest to /home/waterspell/Epic/built/SpaceMouseLinux/HostProject/Saved/Manifest-UE4Editor-Linux-Development.xml
  Building UE4Editor...
  Performing 16 actions (16 in parallel)
  [2/16] Compile PCH.HIDUE.h
  [1/16] Compile PCH.SpaceMouseReader.h
  [3/16] Compile PCH.SpaceMouseRuntime.h
  [4/16] Compile PCH.SpaceMouse.h
  [5/16] Compile Module.HIDUE.cpp
  [6/16] Compile Module.SpaceMouseReader.gen.cpp
  [7/16] Compile Module.SpaceMouseReader.cpp
  [8/16] Link (lld) libUE4Editor-HIDUE.so
  ld.lld: error: unable to find library -ludev
  clang++: error: linker command failed with exit code 1 (use -v to see invocation)
  [9/16] Compile Module.SpaceMouseRuntime.cpp
  [10/16] Compile Module.SpaceMouseRuntime.gen.cpp
  [11/16] Compile Module.SpaceMouse.gen.cpp
  [12/16] Compile Module.SpaceMouse.cpp
Took 26.058405s to run mono, ExitCode=6
UnrealBuildTool failed. See log for more details. (/home/waterspell/Library/Logs/Unreal Engine/LocalBuildLogs/UBT-UE4Editor-Linux-Development.txt)
AutomationTool exiting with ExitCode=6 (6)
RunUAT ERROR: AutomationTool was unable to run successfully.

I am still trying to find a fix for this
[8/16] Link (lld) libUE4Editor-HIDUE.so ld.lld: error: unable to find library -ludev

Thank you TekuConcept! Your code updates allowed compilation on my machine also.

As expected though, there is no communication between the Plugin and Linux SpaceMouse driver. Either spacenavd or 2014 official 3dconnexion drivers.

Perhaps similar to the Mac problem, Linux treats the SpaceMouse as a 2d mouse by default. But, being that there are 2 different driver sets available, one of them open 'spacenavd', It seems as though it could be made to communicate with the plugin. It is beyond my very limited programming experience though.

I gave this a try with a Space Navigator, I had to add a udev rule i just coped from here, The cursor movement is probably due to joystick mouse emulation (i didn't have that issue cause i already have it off) but this here should fix that.

Thanks for discovering that MalikuMane!
As a note, loading spacenavd (the open driver for spacemouse for Linux) takes care of the joystick behavior problem, and also allows the spacemouse to function with other software such as Blender.
So, the short of it is, It Works!

I was hasty closing this issue in my excitement. Perhaps you want to leave it open until everything is worked out? Or maybe just discuss on the PRs