MrOneTwo / Node-editor

Node based UI exploration in C
3 stars 1 forks source link

build on Linux #1

Open efa opened 1 month ago

efa commented 1 month ago

hi, the git sources do not build on current Debian 12.

I managed to build it changing:

1) buildLinux.sh # changed path to use system libs and removed -ldl g++ -msse4.2 -maes -g -Wall ../src/main.cpp -I/usr/include -I/usr/include/SDL2 -L/usr/lib/x86_64-linux-gnu -lSDL2 -lSDL2main -lGLEW -lpthread -lGL -o linux_app

2) main.cpp //#include // on Linux there's no this include

include <cglm/cglm.h> // use <> to use system lib

3) nuklear_sdl_gles2.h //#include // give a lot of ERROR "redeclared as different kind of entity"

My library versions are:

libsdl2-dev 2.26.5
libglew-dev 2.2.0-4
libopengl-dev 1.6.0-1  (OpenGL version 4.6)
libgl1-mesa-dev 22.3.6-1
libcglm-dev 0.8.8-1
libc6-dev 2.36-9 (dirent embedded)

Node-editor

I still got a lot of WARN:

efa@08i7-2500:~/c/Node-editor$ buildLinux.sh 
~/c/Node-editor/app ~/c/Node-editor
In file included from ../src/main.cpp:27:
../src/file.cpp: In function ‘uint32 ListDirectory(char*, char*, char*)’:
../src/file.cpp:64:15: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   64 |     while (ep = readdir(dp))
      |            ~~~^~~~~~~~~~~~~
../src/main.cpp: In function ‘int main(int, char**)’:
../src/main.cpp:296:12: warning: unused variable ‘msPerFrame’ [-Wunused-variable]
  296 |     real64 msPerFrame = (((1000.0f * (real64)counterElapsed) /
      |            ^~~~~~~~~~
../src/main.cpp:298:12: warning: unused variable ‘fps’ [-Wunused-variable]
  298 |     real64 fps = (real64)perfCountFrequency / (real64)counterElapsed;
      |            ^~~
../src/main.cpp:303:12: warning: unused variable ‘mcpf’ [-Wunused-variable]
  303 |     real64 mcpf = ((real64)cyclesElapsed); // / (1000.0f * 1000.0f));
      |            ^~~~
../src/main.cpp:112:14: warning: variable ‘assetTable’ set but not used [-Wunused-but-set-variable]
  112 |   AssetTable assetTable = {};
      |              ^~~~~~~~~~
../src/main.cpp:196:9: warning: unused variable ‘frametimeTarget’ [-Wunused-variable]
  196 |   float frametimeTarget = 1.0f/framerateTarget;
      |         ^~~~~~~~~~~~~~~
../src/main.cpp:207:7: warning: unused variable ‘wireframeToggler’ [-Wunused-variable]
  207 |   int wireframeToggler = 0;
      |       ^~~~~~~~~~~~~~~~
In file included from ../src/main.cpp:47:
../src/node_editor.c: At global scope:
../src/node_editor.c:169:1: warning: ‘void node_editor_set_nodes_window_transform(float, float, float, float)’ defined but not used [-Wunused-function]
  169 | node_editor_set_nodes_window_transform(float x, float y, float w, float h) {
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/main.cpp:32:
../src/load_asset.cpp:209:1: warning: ‘void RetriveOBJ(uint8, AssetTable*, Model3D*)’ defined but not used [-Wunused-function]
  209 | RetriveOBJ(uint8 index, AssetTable* assetTable, Model3D* model)
      | ^~~~~~~~~~
../src/load_asset.cpp:54:1: warning: ‘void LoadAsset(char*, AssetTable*, AssetType)’ defined but not used [-Wunused-function]
   54 | LoadAsset(char* path, AssetTable* assetTable, AssetType type)
      | ^~~~~~~~~
../src/file.cpp:97:1: warning: ‘uint32 ListDirectoryOnTimer(uint32, void*)’ defined but not used [-Wunused-function]
   97 | ListDirectoryOnTimer(uint32 interval, void* params)
      | ^~~~~~~~~~~~~~~~~~~~
In file included from ../src/main.cpp:20:
../src/meow_hash.h:151:1: warning: ‘meow_hash MeowHash_Accelerated(long long unsigned int, long long unsigned int, void*)’ defined but not used [-Wunused-function]
  151 | MeowHash_Accelerated(meow_u64 Seed, meow_u64 TotalLengthInBytes, void *SourceInit)
      | ^~~~~~~~~~~~~~~~~~~~
~/c/Node-editor

Can you please point me to some docs/code to use this library and maybe help me to fix those WARN?

efa commented 1 month ago

found the upstream: https://github.com/Immediate-Mode-UI/Nuklear that is updated, well documented and build without WARN