NangiDev / GDSerCommPlugin

A Godot plugin to read Arduino serial input
MIT License
79 stars 13 forks source link

Build Linux binaries #5

Closed NangiDev closed 10 months ago

NangiDev commented 4 years ago

The steps in the instructions does not build the binaries properly

Building steps

git clone --depth=1 git@github.com:Superwaitsum/GDSercomm.git
cd GDSercomm/
git clone --depth=1 git@github.com:GodotNativeTools/godot_headers.git
git clone --depth=1 git@github.com:ingeniamc/sercomm.git
cd sercomm/
cmake -H. -Bbuild
cmake --build build
cd ..
cp sercomm/build/config.h sercomm/include/public/sercomm/
mkdir lib
cp sercomm/build/libsercomm.so lib/
scons p=platform
cp lib/libsercomm.so bin/
cp bin/libsercomm.so /usr/lib
ldconfig

lddtree output

dev@dev-vm:~/Documents/GDSerCommPlugin/addons/GDSerCommDock/bin$ lddtree libGDSercomm.so 
libGDSercomm.so => ./libGDSercomm.so (interpreter => none)
    libsercomm.so => /usr/lib/libsercomm.so
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
        ld-linux-x86-64.so.2 => /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6

Log from Godot

dev@dev-vm:~/Downloads$ ./Godot_v3.2.1-stable_x11.64 
Godot Engine v3.2.1.stable.official - https://godotengine.org
OpenGL ES 3.0 Renderer: llvmpipe (LLVM 9.0, 128 bits)

Running project: /home/dev/Documents/GDSerCommPlugin (::home::dev::Documents::GDSerCommPlugin)
Godot Engine v3.2.1.stable.official - https://godotengine.org
OpenGL ES 3.0 Renderer: llvmpipe (LLVM 9.0, 128 bits)

ERROR: open_dynamic_library: Can't open dynamic library: /home/dev/Documents/GDSerCommPlugin/addons/GDSerCommDock/bin/libGDSercomm.so. Error: /usr/lib/libsercomm.so: undefined symbol: udev_new
   At: drivers/unix/os_unix.cpp:424.
ERROR: get_symbol: No valid library handle, can't get symbol from GDNative object
   At: modules/gdnative/gdnative.cpp:483.
ERROR: init_library: No nativescript_init in "res://addons/GDSerCommDock/bin/libGDSercomm.so" found
   At: modules/gdnative/nativescript/nativescript.cpp:1506.
SCRIPT ERROR: _ready: Attempt to call function 'new' in base 'NativeScript' on a null instance.
   At: res://addons/GDSerCommDock/MenuLogic.gd:5.
NangiDev commented 4 years ago

https://github.com/NangiDev/GDSerCommPlugin/blob/7d6deec58b641b4c89670bade50349d70ef42f60/README.md#L40

Try add -DBUILD_SHARED_LIBS=OFF when building sercomm library to build static library. More info

NangiDev commented 4 years ago

I managed to build sercomm as a static library .a file, but could not get GDSercomm to include the sercomm.a file when building with Scons.

NangiDev commented 10 months ago

Not a prio any more.