JoshParnell / ltheory

Limit Theory
The Unlicense
347 stars 75 forks source link

python configure.py build fails #3

Open MNS26 opened 2 years ago

MNS26 commented 2 years ago

following the example process when running python configure.py build this is the following output

❯ python configure.py build
Consolidate compiler generated dependencies of target phx
[  1%] Linking CXX shared library ../../bin/libphx64r.so
/usr/bin/ld: /home/noah/Desktop/Github/ltheory/libphx/ext/lib/linux64/libfmod.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/noah/Desktop/Github/ltheory/libphx/ext/lib/linux64/libfmod.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/noah/Desktop/Github/ltheory/libphx/ext/lib/linux64/libfmod.so: .dynsym local symbol at index 4 (>= sh_info of 2)
/usr/bin/ld: /home/noah/Desktop/Github/ltheory/libphx/ext/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/noah/Desktop/Github/ltheory/libphx/ext/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/noah/Desktop/Github/ltheory/libphx/ext/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 4 (>= sh_info of 2)
/usr/bin/ld: cannot find -lBulletCollision: No such file or directory
/usr/bin/ld: cannot find -lBulletDynamics: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [libphx/CMakeFiles/phx.dir/build.make:1857: ../bin/libphx64r.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:126: libphx/CMakeFiles/phx.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
░▒▓  │   ~/De/G/ltheory │    master ?4 ▓▒░                                                                         ░▒▓ ✔ │ 11:45:40   ▓▒░
neonrust commented 2 years ago

Same here. Not sure, but it might be because libBulletDynamics.so.2.87 and libBulletCollision.so.2.87 depend on libLinearMath.so.2.87 (also a part of Bullet), but it isn't included. Haven't gotten further than this yet... :|

⯈ldd libphx/ext/lib/linux64/libBulletCollision.so.2.87
    linux-vdso.so.1 (0x00007ffd9bf65000)
    libLinearMath.so.2.87 => not found
    libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f2cba59f000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2cba4b8000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2cba498000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2cba270000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f2cba8f1000)
insta256 commented 2 years ago

For me it's going ballistic while wiring in libphx64r.so. I'm also on Linux btw...

[100%] Linking CXX executable ../bin/lt64r
/usr/bin/ld: /home/robert/code/ltheory/ltheory/libphx/ext/lib/linux64/libfmod.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/robert/code/ltheory/ltheory/libphx/ext/lib/linux64/libfmod.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/robert/code/ltheory/ltheory/libphx/ext/lib/linux64/libfmod.so: .dynsym local symbol at index 4 (>= sh_info of 2)
/usr/bin/ld: /home/robert/code/ltheory/ltheory/libphx/ext/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/robert/code/ltheory/ltheory/libphx/ext/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/robert/code/ltheory/ltheory/libphx/ext/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 4 (>= sh_info of 2)
/usr/bin/ld: ../bin/libphx64r.so: undefined reference to 'CProfileManager::dumpAll()'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/lt.dir/build.make:98: ../bin/lt64r] Error 1
make[1]: *** [CMakeFiles/Makefile2:100: CMakeFiles/lt.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Edit: The offending line is in src/Physics.cpp on line 274. I commented it out and now configure.py build completes.

neonrust commented 2 years ago

Ok, so then you succeeded in linking libphx64r.so (that this issue is about). Care to enlighten us?

insta256 commented 2 years ago

Well, I simply followed the build instructions, i.e.

git lfs install
git clone --recursive https://github.com/JoshParnell/ltheory.git ltheory
cd ltheory
python configure.py
python configure.py build
python configure.py run

I commented out line 274 in ltheory/libphx/src/Physics.cpp. Also, the executable name needs to be changed in configure.py. It should be bin/lt64r. Having done this ./configure.py run quits with

bin/lt64r: error while loading shared libraries: libfmod.so.10: cannot open shared object file: No such file or directory

Linking still didn't go as smoothly after all...

Maybe relatedly I noticed, CMakeList.txt of libphx is missing the part where it's supposed to pull in external libraries for Linux.

if (WINDOWS)

  *snip pulling in glew, lz4, lua51, and sdl2 for Windows platforms*

elseif (LINUX)

  # TODO

endif ()
neonrust commented 2 years ago

Strange that it works for you but not for others...

Regarding the run-time error (cannot open shared...), that could be worked around by setting LD_LIBRARY_PATH before running. That is, adding a path where it searches for libraries during run-time. e.g. export LD_LIBRARY_PATH=libphx/ext/lib/linux64 (probably better to use absolute path, though)

insta256 commented 2 years ago

I ended up emulating what the cmake script does on Windows: copy the libraries from ltheory/libphx/ext/lib/linux64/ to ltheory/bin/. Of course, setting LD_LIBRARY_PATH would also work. libfmod.so and libfmodstudio.so are actually expected as libfmod.so.10 and libfmodstudio.so.10, so I renamed them as well. Finally sdl2 is missing in ltheory/libphx/ext/lib/linux64/ and simply copying or linking my native version of libsdl2.so didn't work. I ended up copying the contents of /usr/include/SDL2/ to ltheory/libphx/ext/include/sdl/ (leaving the cmake files in there). With that, compiling and linking finally worked. Now I can run ./configure.py run to be greeted with some Lua error:

./script/env/ext/IOEx.lua:14: attempt to index global 'lfs' (a nil value)

lfs seems to be the LuaFileSystem package. It isn't imported in IOEx.lua (and couldn't be because it seems to be missing altogether). Anybody knows how to install and load Lua packages?

insta256 commented 2 years ago

Regarding your Bulletphysics problems: The only possible difference that I can think of is, that I have bulletphysics installed as a distro package. Maybe that provides libLinearMath.so.2.87?

-> I just checked I have libLinearMath.so.3.24 installed. Of course also available as symlink libLinearMath.so. Maybe installing bulletphysics via your distro will help you as well?

neonrust commented 2 years ago

Ah, I see. Yes having a globally-installed libLinearMath would indeed help. If it would run correctly is another story ;) (considering it is a different version)

I did try (before) downloading the deb for 2.87 and putting that in the same libphx/ext/lib/linux64 but that didn't help either.

neonrust commented 2 years ago

Btw, you can run ldd on the resulting libphx64r.so, to see which libLinearMath it picked up.

No idea on the lua stuff, I'm completely useless in that area. :(

imbev commented 2 years ago

I eventually managed to get to the following upon running lt64r

Engine_Init: Detected SDL version mismatch:
  Version (Compiled) : 2.0.14
  Version (Linked)   : 2.0.8
Engine_Init: Terminating.
Signal_Handler: Caught Abort
Aborted (core dumped)
MNS26 commented 2 years ago

I ended up emulating what the cmake script does on Windows: copy the libraries from ltheory/libphx/ext/lib/linux64/ to ltheory/bin/. Of course, setting LD_LIBRARY_PATH would also work. libfmod.so and libfmodstudio.so are actually expected as libfmod.so.10 and libfmodstudio.so.10, so I renamed them as well. Finally sdl2 is missing in ltheory/libphx/ext/lib/linux64/ and simply copying or linking my native version of libsdl2.so didn't work. I ended up copying the contents of /usr/include/SDL2/ to ltheory/libphx/ext/include/sdl/ (leaving the cmake files in there). With that, compiling and linking finally worked. Now I can run ./configure.py run to be greeted with some Lua error:

./script/env/ext/IOEx.lua:14: attempt to index global 'lfs' (a nil value)

lfs seems to be the LuaFileSystem package. It isn't imported in IOEx.lua (and couldn't be because it seems to be missing altogether). Anybody knows how to install and load Lua packages?

mind writing the steps/commands you took to get passed it? i dont quite follow what you did

neonrust commented 2 years ago

Engine_Init: Detected SDL version mismatch: Version (Compiled) : 2.0.14 Version (Linked) : 2.0.8

That's "simply" include files and lib from different versions.

You mentioned you needed to copy from system to LT directory, so, it didn't find the system-installed SDL ?

imbev commented 2 years ago

It was not using system-installed SDL. I manually copied libSDL2-2.0.14 to bin/libSDL2-2.0.so.0 and libphx/ext/lib/linux64/libSDL2-2.0.so.0.

Now the error is

./bin/lt64r: symbol lookup error: /home/isaac/Downloads/ltheory/libphx/ext/lib/linux64/libSDL2-2.0.so.0: undefined symbol: strlcpy, version GLIBC_2.2.5

Could this be because I obtained libSDL2 from https://altlinux.pkgs.org/p9/classic-x86_64/libSDL2-2.0.14-alt4.x86_64.rpm.html despite my distro being openSUSE Leap 15.4?

insta256 commented 2 years ago

I eventually managed to get to the following upon running lt64r

Engine_Init: Detected SDL version mismatch:
  Version (Compiled) : 2.0.14
  Version (Linked)   : 2.0.8
Engine_Init: Terminating.
Signal_Handler: Caught Abort
Aborted (core dumped)

I also got this error, because lt ships with headers for sdl 2.0.14 but is missing the actual libsdl2.so. Thus it's trying to link against the system installed sdl (2.0.22 in my case). I fixed this by copying the system sdl2 headers from /usr/include/SDL2/ to ltheory/libphx/ext/include/sdl/. After ./configure.py clean and repeating the build commands the error is gone.

I have to agree, though, replacing libLinearMath.so with the system version isn't going to work...

The proper way to go, would be to fix up the CmakeList.txt to use the system libraries and headers. Half of the necessary libraries seem to be missing anyway.

FormalMoss commented 2 years ago

As noted here: https://github.com/JoshParnell/ltheory/discussions/5

Which highlights how much of a noob I am, I ran a-ground when attempting the previous step to you, i.e. python configure.py

Can you advise which version of Cmake you used to get to the next hurdle?

insta256 commented 2 years ago

I have cmake version 3.23. the CmakeLists.txt specifies version 3.0.2 as the minimum. So, any reasonably recent version should work.

dw0xaa55 commented 2 years ago

Has anyone solved this lua error in IOEx.lua on line 14 yet?

Lua_PCall: Lua returned error message: ./script/env/ext/IOEx.lua:14: attempt to index global 'lfs' (a nil value) Signal_Handler: Caught Abort Lua Backtrace: [1] 1228801 IOT instruction (core dumped) bin/./lt64r

I have installed the luafilesystem package via the package manager of my gnu/linux distro, which did nothing to fix the error. I also tried installing the package via luarocks with the same effect.

When commenting out line 14, it obviously throws the next error, that it cannot check if the directory env/ext/ exists. Maybe someone else has more experience with lua than me and can help.

tatsujb commented 2 years ago

Well, I simply followed the build instructions, i.e.

git lfs install
git clone --recursive https://github.com/JoshParnell/ltheory.git ltheory
cd ltheory
python configure.py
python configure.py build
python configure.py run

On ubuntu 2022 I can't get python configure.py to run, it sptits out

Command 'python' not found, did you mean:
  command 'python3' from deb python3
  command 'python' from deb python-is-python3

so I do python3 configure.py but then I get :

Traceback (most recent call last):
  File "/home/t/Documents/ltheory/configure.py", line 21, in <module>
    subprocess.call(['cmake', '-S', './', '-B', './build'])
  File "/usr/lib/python3.10/subprocess.py", line 345, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.10/subprocess.py", line 969, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'cmake'

not sure what the issue is.

neonrust commented 2 years ago

No such file or directory: 'cmake' Seems simple enough: you need to install cmake.

neonrust commented 2 years ago

wtf... can't edit my message? :( the second row isn't supposed to be a quote...

tatsujb commented 2 years ago

ah yeah. I though cmake would come with build essentials. my bad.

I did what @insta256 did and removed ".exe" in the configure.py

I also ran :

~sudo apt install glew lz4 lua51 sdl2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package glew
E: Unable to locate package lua51
E: Unable to locate package sdl2

but it seems most of these dependencies aren't available as-is on linux.

now when I try configure :

python3 configure.py
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:4 (include):
  include could not find requested file:

    libphx/script/build/Shared.cmake

CMake Error at CMakeLists.txt:6 (add_subdirectory):
  The source directory

    /home/t/Documents/ltheory/libphx

  does not contain a CMakeLists.txt file.

CMake Error at CMakeLists.txt:9 (phx_configure_output_dir):
  Unknown CMake command "phx_configure_output_dir".

-- Configuring incomplete, errors occurred!
See also "/home/t/Documents/ltheory/build/CMakeFiles/CMakeOutput.log".

didn't find anything interesting in the log.

neonrust commented 2 years ago

[I guess you're using a debian-derived distro] Most (if not all) of those dependencies are named with lib prefix, e.g. libglew Also, when installing a dependency to build something, the developer package, usually with -dev suffix, is the one you want. Try e.g. apt search glew to find the correct one...

tatsujb commented 2 years ago

I'm using ubuntu, I'm just fairly green when it comes to compiling source. thanks

I'm assuming I should prioritize 32 bit libs? (ubuntu doesn't install those unless you kinda force it to) for example on lz4 both the 32 and 64 bit library exists but I can actually only install one or the other. I'm going to try 32 bit first.

here's the maximum I was able to install :

sudo apt install libglew-dev libsdl2-dev libsdl2-dev:i386 lz4:i386 lua5.1:i386

(those that are not in this list as their 64 bit version it's because they were incompatible with the 32 bit version, and those that aren't present as their 32 bit version, it's because the 32 bit version didn't exist and those that aren't present in this list as -dev it's because they didn't have a -dev)

please tell me if I should revert this and use only 64 bit versions instead.

neonrust commented 2 years ago

Not sure why you think you need 32bit libs? The native architecture is 64bit, for sure?

tatsujb commented 2 years ago

it is yeah. it's just I heard with a lot of dev projects like games (and in this case a 11 year old game and a windows one in particular) that they use 32 bit dependencies profusely and that for whatever reason the 64bit counterparts are incompatible.

If my assumption is wrong, all the better, i'll delete the 32bit libs and put the default instead

neonrust commented 2 years ago

Yeah, if it involves wine it is sometimes 32bit (especially for older games)..But here you're compiling from source, so I don't see a reason for not using the native arch.

tatsujb commented 2 years ago

awesome thanks! so yeah the final set is :

sudo apt install libglew-dev libsdl2-dev libsdl2-dev lz4 lua5.1

and with this I think I have all the dependencies I will need?

neonrust commented 2 years ago

You didn't find liblz4-dev or liblua5.2-dev ?

tatsujb commented 2 years ago

oh my bad. I didn't test with both lib in front and -dev at the back at the same time. that worked.

sudo apt install libglew-dev libsdl2-dev libsdl2-dev liblz4-dev liblua5.1-dev

should I uninstall the non -dev version or will the compiler know which to pick?

tatsujb commented 2 years ago

as for configure, I'm still getting the same error : https://github.com/JoshParnell/ltheory/issues/3#issuecomment-1308761738

it wants me to have a CMakeLists.txt file ? and the rest of the errors, I don't understand

neonrust commented 2 years ago

Strange, the CMakeLists.txt should already be there. It defines the building process for that sub-directory.

tatsujb commented 2 years ago

I realized the libphx folder is a sub-gitrepo (something I'm new to) and that my git clone command did not clone this repo

I imagine there's a command to clone all of a repo including all subrepos?

EDIT : seems this is it: https://stackoverflow.com/a/4438292/4770754

tatsujb commented 2 years ago

also we're supposed to add libBulletDynamics.so.2.87 libBulletCollision.so.2.87 libLinearMath.so.2.87 as dependencies?

and I didn't understand this https://github.com/JoshParnell/ltheory/issues/3#issuecomment-1200494668

configure finally went through for me :

t@tsu:~/Documents/ltheory$ python3 configure.py 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/t/Documents/ltheory/build
t@tsu:~/Documents/ltheory$ 

and here's my output for build :

behind spoiler to keep message short ``` t@tsu:~/Documents/ltheory$ python3 configure.py build [ 1%] Building CXX object libphx/CMakeFiles/phx.dir/src/Audio.cpp.o [ 2%] Building CXX object libphx/CMakeFiles/phx.dir/src/BSP.cpp.o [ 3%] Building CXX object libphx/CMakeFiles/phx.dir/src/Bit.cpp.o [ 4%] Building CXX object libphx/CMakeFiles/phx.dir/src/BlendMode.cpp.o [ 5%] Building CXX object libphx/CMakeFiles/phx.dir/src/BoxMesh.cpp.o [ 6%] Building CXX object libphx/CMakeFiles/phx.dir/src/BoxTree.cpp.o [ 6%] Building CXX object libphx/CMakeFiles/phx.dir/src/Button.cpp.o [ 7%] Building CXX object libphx/CMakeFiles/phx.dir/src/Bytes.cpp.o [ 8%] Building CXX object libphx/CMakeFiles/phx.dir/src/ClipRect.cpp.o [ 9%] Building CXX object libphx/CMakeFiles/phx.dir/src/CollisionShape.cpp.o [ 10%] Building CXX object libphx/CMakeFiles/phx.dir/src/Common.cpp.o [ 11%] Building CXX object libphx/CMakeFiles/phx.dir/src/CubeFace.cpp.o [ 12%] Building CXX object libphx/CMakeFiles/phx.dir/src/CullFace.cpp.o [ 13%] Building CXX object libphx/CMakeFiles/phx.dir/src/DataFormat.cpp.o [ 13%] Building CXX object libphx/CMakeFiles/phx.dir/src/DepthTest.cpp.o [ 14%] Building CXX object libphx/CMakeFiles/phx.dir/src/Device.cpp.o [ 15%] Building CXX object libphx/CMakeFiles/phx.dir/src/DeviceType.cpp.o [ 16%] Building CXX object libphx/CMakeFiles/phx.dir/src/Directory.cpp.o [ 17%] Building CXX object libphx/CMakeFiles/phx.dir/src/Draw.cpp.o [ 18%] Building CXX object libphx/CMakeFiles/phx.dir/src/Engine.cpp.o [ 19%] Building CXX object libphx/CMakeFiles/phx.dir/src/Error.cpp.o [ 20%] Building CXX object libphx/CMakeFiles/phx.dir/src/File.cpp.o /home/t/Documents/ltheory/libphx/src/File.cpp: In function ‘void File_Read(File*, void*, uint32)’: /home/t/Documents/ltheory/libphx/src/File.cpp:110:8: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 110 | fread(data, len, 1, self->handle); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp: In function ‘uint8 File_ReadU8(File*)’: /home/t/Documents/ltheory/libphx/src/File.cpp:136:10: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 136 | fread((void*)&value, sizeof(T), 1, self->handle); \ | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp:122:3: note: in expansion of macro ‘X’ 122 | X(uint8, U8) \ | ^ /home/t/Documents/ltheory/libphx/src/File.cpp:144:1: note: in expansion of macro ‘READWRITE_X’ 144 | READWRITE_X | ^~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp: In function ‘uint16 File_ReadU16(File*)’: /home/t/Documents/ltheory/libphx/src/File.cpp:136:10: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 136 | fread((void*)&value, sizeof(T), 1, self->handle); \ | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp:123:3: note: in expansion of macro ‘X’ 123 | X(uint16, U16) \ | ^ /home/t/Documents/ltheory/libphx/src/File.cpp:144:1: note: in expansion of macro ‘READWRITE_X’ 144 | READWRITE_X | ^~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp: In function ‘uint32 File_ReadU32(File*)’: /home/t/Documents/ltheory/libphx/src/File.cpp:136:10: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 136 | fread((void*)&value, sizeof(T), 1, self->handle); \ | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp:124:3: note: in expansion of macro ‘X’ 124 | X(uint32, U32) \ | ^ /home/t/Documents/ltheory/libphx/src/File.cpp:144:1: note: in expansion of macro ‘READWRITE_X’ 144 | READWRITE_X | ^~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp: In function ‘uint64 File_ReadU64(File*)’: /home/t/Documents/ltheory/libphx/src/File.cpp:136:10: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 136 | fread((void*)&value, sizeof(T), 1, self->handle); \ | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp:125:3: note: in expansion of macro ‘X’ 125 | X(uint64, U64) \ | ^ /home/t/Documents/ltheory/libphx/src/File.cpp:144:1: note: in expansion of macro ‘READWRITE_X’ 144 | READWRITE_X | ^~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp: In function ‘int8 File_ReadI8(File*)’: /home/t/Documents/ltheory/libphx/src/File.cpp:136:10: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 136 | fread((void*)&value, sizeof(T), 1, self->handle); \ | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp:126:3: note: in expansion of macro ‘X’ 126 | X(int8, I8) \ | ^ /home/t/Documents/ltheory/libphx/src/File.cpp:144:1: note: in expansion of macro ‘READWRITE_X’ 144 | READWRITE_X | ^~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp: In function ‘int16 File_ReadI16(File*)’: /home/t/Documents/ltheory/libphx/src/File.cpp:136:10: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 136 | fread((void*)&value, sizeof(T), 1, self->handle); \ | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp:127:3: note: in expansion of macro ‘X’ 127 | X(int16, I16) \ | ^ /home/t/Documents/ltheory/libphx/src/File.cpp:144:1: note: in expansion of macro ‘READWRITE_X’ 144 | READWRITE_X | ^~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp: In function ‘int32 File_ReadI32(File*)’: /home/t/Documents/ltheory/libphx/src/File.cpp:136:10: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 136 | fread((void*)&value, sizeof(T), 1, self->handle); \ | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp:128:3: note: in expansion of macro ‘X’ 128 | X(int32, I32) \ | ^ /home/t/Documents/ltheory/libphx/src/File.cpp:144:1: note: in expansion of macro ‘READWRITE_X’ 144 | READWRITE_X | ^~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp: In function ‘int64 File_ReadI64(File*)’: /home/t/Documents/ltheory/libphx/src/File.cpp:136:10: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 136 | fread((void*)&value, sizeof(T), 1, self->handle); \ | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp:129:3: note: in expansion of macro ‘X’ 129 | X(int64, I64) \ | ^ /home/t/Documents/ltheory/libphx/src/File.cpp:144:1: note: in expansion of macro ‘READWRITE_X’ 144 | READWRITE_X | ^~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp: In function ‘float File_ReadF32(File*)’: /home/t/Documents/ltheory/libphx/src/File.cpp:136:10: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 136 | fread((void*)&value, sizeof(T), 1, self->handle); \ | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp:130:3: note: in expansion of macro ‘X’ 130 | X(float, F32) \ | ^ /home/t/Documents/ltheory/libphx/src/File.cpp:144:1: note: in expansion of macro ‘READWRITE_X’ 144 | READWRITE_X | ^~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp: In function ‘double File_ReadF64(File*)’: /home/t/Documents/ltheory/libphx/src/File.cpp:136:10: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 136 | fread((void*)&value, sizeof(T), 1, self->handle); \ | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/File.cpp:131:3: note: in expansion of macro ‘X’ 131 | X(double, F64) | ^ /home/t/Documents/ltheory/libphx/src/File.cpp:144:1: note: in expansion of macro ‘READWRITE_X’ 144 | READWRITE_X | ^~~~~~~~~~~ [ 20%] Building CXX object libphx/CMakeFiles/phx.dir/src/Font.cpp.o [ 21%] Building CXX object libphx/CMakeFiles/phx.dir/src/GLMatrix.cpp.o [ 22%] Building CXX object libphx/CMakeFiles/phx.dir/src/GUID.cpp.o [ 23%] Building CXX object libphx/CMakeFiles/phx.dir/src/Gamepad.cpp.o [ 24%] Building CXX object libphx/CMakeFiles/phx.dir/src/GamepadAxis.cpp.o [ 25%] Building CXX object libphx/CMakeFiles/phx.dir/src/GamepadButton.cpp.o [ 26%] Building CXX object libphx/CMakeFiles/phx.dir/src/Hash.cpp.o [ 27%] Building CXX object libphx/CMakeFiles/phx.dir/src/HashGrid.cpp.o [ 27%] Building CXX object libphx/CMakeFiles/phx.dir/src/HashMap.cpp.o [ 28%] Building CXX object libphx/CMakeFiles/phx.dir/src/HatDir.cpp.o [ 29%] Building CXX object libphx/CMakeFiles/phx.dir/src/HmGui.cpp.o In file included from /home/t/Documents/ltheory/libphx/src/HmGui.cpp:121: /home/t/Documents/ltheory/libphx/src/HmGuiInternal.h:110:13: warning: ‘void HmGui_PopClipRect()’ defined but not used [-Wunused-function] 110 | static void HmGui_PopClipRect () { | ^~~~~~~~~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/HmGuiInternal.h:96:13: warning: ‘void HmGui_PushClipRect(HmGuiGroup*)’ defined but not used [-Wunused-function] 96 | static void HmGui_PushClipRect (HmGuiGroup* g) { | ^~~~~~~~~~~~~~~~~~ [ 30%] Building CXX object libphx/CMakeFiles/phx.dir/src/ImGui.cpp.o /home/t/Documents/ltheory/libphx/src/ImGui.cpp: In function ‘void ImGui_EndScrollFrame()’: /home/t/Documents/ltheory/libphx/src/ImGui.cpp:253:9: warning: variable ‘scrollSize’ set but not used [-Wunused-but-set-variable] 253 | Vec2f scrollSize = Vec2f_Create(self.style->scrollBarSize.x, layout->size.y); | ^~~~~~~~~~ /home/t/Documents/ltheory/libphx/src/ImGui.cpp: In function ‘bool ImGui_ButtonEx(cstr, float, float)’: /home/t/Documents/ltheory/libphx/src/ImGui.cpp:362:9: warning: variable ‘labelSize’ set but not used [-Wunused-but-set-variable] 362 | Vec2f labelSize = Vec2f_Create(bound.x, bound.y); | ^~~~~~~~~ [ 31%] Building CXX object libphx/CMakeFiles/phx.dir/src/Input.cpp.o [ 32%] Building CXX object libphx/CMakeFiles/phx.dir/src/InputBindings.cpp.o [ 33%] Building CXX object libphx/CMakeFiles/phx.dir/src/InputEvent.cpp.o [ 34%] Building CXX object libphx/CMakeFiles/phx.dir/src/Intersect.cpp.o [ 34%] Building CXX object libphx/CMakeFiles/phx.dir/src/Joystick.cpp.o [ 35%] Building CXX object libphx/CMakeFiles/phx.dir/src/KDTree.cpp.o [ 36%] Building CXX object libphx/CMakeFiles/phx.dir/src/Key.cpp.o [ 37%] Building CXX object libphx/CMakeFiles/phx.dir/src/Keyboard.cpp.o [ 38%] Building CXX object libphx/CMakeFiles/phx.dir/src/LineSegment.cpp.o /home/t/Documents/ltheory/libphx/src/LineSegment.cpp: In function ‘const char* LineSegment_ToString(LineSegment*)’: /home/t/Documents/ltheory/libphx/src/LineSegment.cpp:19:9: warning: ‘%s’ directive output may be truncated writing up to 511 bytes into a region of size 509 [-Wformat-truncation=] 19 | "p0:%s p1:%s", | ^~ In file included from /usr/include/stdio.h:894, from /home/t/Documents/ltheory/libphx/include/Vec3.h:10, from /home/t/Documents/ltheory/libphx/include/LineSegment.h:5, from /home/t/Documents/ltheory/libphx/src/LineSegment.cpp:2: /usr/include/x86_64-linux-gnu/bits/stdio2.h:71:35: note: ‘__builtin___snprintf_chk’ output between 8 and 1030 bytes into a destination of size 512 71 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 72 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 73 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ [ 39%] Building CXX object libphx/CMakeFiles/phx.dir/src/LodMesh.cpp.o [ 40%] Building CXX object libphx/CMakeFiles/phx.dir/src/Lua.cpp.o [ 41%] Building CXX object libphx/CMakeFiles/phx.dir/src/LuaScheduler.cpp.o [ 41%] Building CXX object libphx/CMakeFiles/phx.dir/src/Matrix.cpp.o [ 42%] Building CXX object libphx/CMakeFiles/phx.dir/src/MemPool.cpp.o [ 43%] Building CXX object libphx/CMakeFiles/phx.dir/src/MemStack.cpp.o [ 44%] Building CXX object libphx/CMakeFiles/phx.dir/src/Mesh.cpp.o [ 45%] Building CXX object libphx/CMakeFiles/phx.dir/src/Mesh_ComputeAO.cpp.o [ 46%] Building CXX object libphx/CMakeFiles/phx.dir/src/Mesh_FromObj.cpp.o [ 47%] Building CXX object libphx/CMakeFiles/phx.dir/src/Meshes.cpp.o [ 48%] Building CXX object libphx/CMakeFiles/phx.dir/src/Metric.cpp.o [ 49%] Building CXX object libphx/CMakeFiles/phx.dir/src/Midi.cpp.o [ 49%] Building CXX object libphx/CMakeFiles/phx.dir/src/Modifier.cpp.o [ 50%] Building CXX object libphx/CMakeFiles/phx.dir/src/Mouse.cpp.o [ 51%] Building CXX object libphx/CMakeFiles/phx.dir/src/MouseButton.cpp.o [ 52%] Building CXX object libphx/CMakeFiles/phx.dir/src/OS.cpp.o [ 53%] Building CXX object libphx/CMakeFiles/phx.dir/src/Octree.cpp.o [ 54%] Building CXX object libphx/CMakeFiles/phx.dir/src/OpenGL.cpp.o [ 55%] Building CXX object libphx/CMakeFiles/phx.dir/src/PhxMath.cpp.o [ 56%] Building CXX object libphx/CMakeFiles/phx.dir/src/PhxMemory.cpp.o [ 56%] Building CXX object libphx/CMakeFiles/phx.dir/src/PhxSignal.cpp.o [ 57%] Building CXX object libphx/CMakeFiles/phx.dir/src/PhxTime.cpp.o [ 58%] Building CXX object libphx/CMakeFiles/phx.dir/src/Physics.cpp.o [ 59%] Building CXX object libphx/CMakeFiles/phx.dir/src/PixelFormat.cpp.o [ 60%] Building CXX object libphx/CMakeFiles/phx.dir/src/Plane.cpp.o [ 61%] Building CXX object libphx/CMakeFiles/phx.dir/src/Polygon.cpp.o [ 62%] Building CXX object libphx/CMakeFiles/phx.dir/src/Profiler.cpp.o [ 63%] Building CXX object libphx/CMakeFiles/phx.dir/src/Quat.cpp.o [ 63%] Building CXX object libphx/CMakeFiles/phx.dir/src/RNG.cpp.o [ 64%] Building CXX object libphx/CMakeFiles/phx.dir/src/Ray.cpp.o [ 65%] Building CXX object libphx/CMakeFiles/phx.dir/src/RenderState.cpp.o [ 66%] Building CXX object libphx/CMakeFiles/phx.dir/src/RenderTarget.cpp.o [ 67%] Building CXX object libphx/CMakeFiles/phx.dir/src/Resource.cpp.o [ 68%] Building CXX object libphx/CMakeFiles/phx.dir/src/ResourceType.cpp.o [ 69%] Building CXX object libphx/CMakeFiles/phx.dir/src/RigidBody.cpp.o [ 70%] Building CXX object libphx/CMakeFiles/phx.dir/src/SDF.cpp.o [ 70%] Building CXX object libphx/CMakeFiles/phx.dir/src/Shader.cpp.o [ 71%] Building CXX object libphx/CMakeFiles/phx.dir/src/ShaderState.cpp.o [ 72%] Building CXX object libphx/CMakeFiles/phx.dir/src/ShaderVar.cpp.o [ 73%] Building CXX object libphx/CMakeFiles/phx.dir/src/ShaderVarType.cpp.o [ 74%] Building CXX object libphx/CMakeFiles/phx.dir/src/Socket.cpp.o [ 75%] Building CXX object libphx/CMakeFiles/phx.dir/src/Sound.cpp.o [ 76%] Building CXX object libphx/CMakeFiles/phx.dir/src/SoundDesc.cpp.o [ 77%] Building CXX object libphx/CMakeFiles/phx.dir/src/State.cpp.o [ 77%] Building CXX object libphx/CMakeFiles/phx.dir/src/StrBuffer.cpp.o [ 78%] Building CXX object libphx/CMakeFiles/phx.dir/src/StrMap.cpp.o [ 79%] Building CXX object libphx/CMakeFiles/phx.dir/src/Tex1D.cpp.o [ 80%] Building CXX object libphx/CMakeFiles/phx.dir/src/Tex2D.cpp.o [ 81%] Building CXX object libphx/CMakeFiles/phx.dir/src/Tex2D_Load.cpp.o In file included from /home/t/Documents/ltheory/libphx/src/Tex2D_Load.cpp:9: /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h: In function ‘unsigned char* stbi__convert_format(unsigned char*, int, int, unsigned int, unsigned int)’: /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1360:44: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 1360 | #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1364:10: note: in expansion of macro ‘CASE’ 1364 | CASE(1,2) dest[0]=src[0], dest[1]=255; break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1364:49: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 1364 | CASE(1,2) dest[0]=src[0], dest[1]=255; break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1360:44: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 1360 | #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1365:10: note: in expansion of macro ‘CASE’ 1365 | CASE(1,3) dest[0]=dest[1]=dest[2]=src[0]; break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1365:52: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 1365 | CASE(1,3) dest[0]=dest[1]=dest[2]=src[0]; break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1360:44: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 1360 | #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1366:10: note: in expansion of macro ‘CASE’ 1366 | CASE(1,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1366:65: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 1366 | CASE(1,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1360:44: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 1360 | #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1367:10: note: in expansion of macro ‘CASE’ 1367 | CASE(2,1) dest[0]=src[0]; break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1367:36: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 1367 | CASE(2,1) dest[0]=src[0]; break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1360:44: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 1360 | #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1368:10: note: in expansion of macro ‘CASE’ 1368 | CASE(2,3) dest[0]=dest[1]=dest[2]=src[0]; break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1368:52: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 1368 | CASE(2,3) dest[0]=dest[1]=dest[2]=src[0]; break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1360:44: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 1360 | #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1369:10: note: in expansion of macro ‘CASE’ 1369 | CASE(2,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1369:68: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 1369 | CASE(2,4) dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1360:44: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 1360 | #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1370:10: note: in expansion of macro ‘CASE’ 1370 | CASE(3,4) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1370:78: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 1370 | E(3,4) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1360:44: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 1360 | #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1371:10: note: in expansion of macro ‘CASE’ 1371 | CASE(3,1) dest[0]=stbi__compute_y(src[0],src[1],src[2]); break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1371:67: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 1371 | CASE(3,1) dest[0]=stbi__compute_y(src[0],src[1],src[2]); break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1360:44: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 1360 | #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1372:10: note: in expansion of macro ‘CASE’ 1372 | CASE(3,2) dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = 255; break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1372:82: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 1372 | 2) dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = 255; break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1360:44: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 1360 | #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1373:10: note: in expansion of macro ‘CASE’ 1373 | CASE(4,1) dest[0]=stbi__compute_y(src[0],src[1],src[2]); break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1373:67: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 1373 | CASE(4,1) dest[0]=stbi__compute_y(src[0],src[1],src[2]); break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1360:44: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 1360 | #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1374:10: note: in expansion of macro ‘CASE’ 1374 | CASE(4,2) dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = src[3]; break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1374:85: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 1374 | dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = src[3]; break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1360:44: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 1360 | #define CASE(a,b) case COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1375:10: note: in expansion of macro ‘CASE’ 1375 | CASE(4,3) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:1375:66: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 1375 | CASE(4,3) dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; break; | ^~~~~ In file included from /home/t/Documents/ltheory/libphx/src/Tex2D_Load.cpp:9: /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h: In function ‘int stbi__create_png_image_raw(stbi__png*, stbi_uc*, stbi__uint32, int, stbi__uint32, stbi__uint32, int, int)’: /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4086:17: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 4086 | for (k=0; k < nk; ++k) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4090:13: note: in expansion of macro ‘CASE’ 4090 | CASE(STBI__F_sub) cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4090:95: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 4090 | cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4086:17: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 4086 | for (k=0; k < nk; ++k) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4091:13: note: in expansion of macro ‘CASE’ 4091 | CASE(STBI__F_up) cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4091:84: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 4091 | TBI__F_up) cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4086:17: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 4086 | for (k=0; k < nk; ++k) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4092:13: note: in expansion of macro ‘CASE’ 4092 | CASE(STBI__F_avg) cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4092:113: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 4092 | STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4086:17: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 4086 | for (k=0; k < nk; ++k) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4093:13: note: in expansion of macro ‘CASE’ 4093 | CASE(STBI__F_paeth) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4093:139: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 4093 | tbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4086:17: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 4086 | for (k=0; k < nk; ++k) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4094:13: note: in expansion of macro ‘CASE’ 4094 | CASE(STBI__F_avg_first) cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4094:102: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 4094 | cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4086:17: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 4086 | for (k=0; k < nk; ++k) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4095:13: note: in expansion of macro ‘CASE’ 4095 | CASE(STBI__F_paeth_first) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4095:112: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 4095 | = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4104:20: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 4104 | for (k=0; k < filter_bytes; ++k) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4106:13: note: in expansion of macro ‘CASE’ 4106 | CASE(STBI__F_none) cur[k] = raw[k]; break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4106:57: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 4106 | CASE(STBI__F_none) cur[k] = raw[k]; break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4104:20: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 4104 | for (k=0; k < filter_bytes; ++k) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4107:13: note: in expansion of macro ‘CASE’ 4107 | CASE(STBI__F_sub) cur[k] = STBI__BYTECAST(raw[k] + cur[k- output_bytes]); break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4107:96: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 4107 | cur[k] = STBI__BYTECAST(raw[k] + cur[k- output_bytes]); break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4104:20: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 4104 | for (k=0; k < filter_bytes; ++k) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4108:13: note: in expansion of macro ‘CASE’ 4108 | CASE(STBI__F_up) cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4108:84: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 4108 | TBI__F_up) cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4104:20: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 4104 | for (k=0; k < filter_bytes; ++k) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4109:13: note: in expansion of macro ‘CASE’ 4109 | CASE(STBI__F_avg) cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k- output_bytes])>>1)); break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4109:114: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 4109 | STBI__BYTECAST(raw[k] + ((prior[k] + cur[k- output_bytes])>>1)); break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4104:20: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 4104 | for (k=0; k < filter_bytes; ++k) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4110:13: note: in expansion of macro ‘CASE’ 4110 | CASE(STBI__F_paeth) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],prior[k],prior[k- output_bytes])); break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4110:141: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 4110 | i__paeth(cur[k- output_bytes],prior[k],prior[k- output_bytes])); break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4104:20: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 4104 | for (k=0; k < filter_bytes; ++k) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4111:13: note: in expansion of macro ‘CASE’ 4111 | CASE(STBI__F_avg_first) cur[k] = STBI__BYTECAST(raw[k] + (cur[k- output_bytes] >> 1)); break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4111:103: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 4111 | cur[k] = STBI__BYTECAST(raw[k] + (cur[k- output_bytes] >> 1)); break; | ^~~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4104:20: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 4104 | for (k=0; k < filter_bytes; ++k) | ^~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4112:13: note: in expansion of macro ‘CASE’ 4112 | CASE(STBI__F_paeth_first) cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],0,0)); break; | ^~~~ /home/t/Documents/ltheory/libphx/ext/include/stb/stb_image.h:4112:113: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 4112 | STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],0,0)); break; | ^~~~~ [ 82%] Building CXX object libphx/CMakeFiles/phx.dir/src/Tex2D_Save.cpp.o [ 83%] Building CXX object libphx/CMakeFiles/phx.dir/src/Tex3D.cpp.o [ 84%] Building CXX object libphx/CMakeFiles/phx.dir/src/TexCube.cpp.o [ 84%] Building CXX object libphx/CMakeFiles/phx.dir/src/TexCube_GenIRMap.cpp.o [ 85%] Building CXX object libphx/CMakeFiles/phx.dir/src/TexFilter.cpp.o [ 86%] Building CXX object libphx/CMakeFiles/phx.dir/src/TexFormat.cpp.o [ 87%] Building CXX object libphx/CMakeFiles/phx.dir/src/TexWrapMode.cpp.o [ 88%] Building CXX object libphx/CMakeFiles/phx.dir/src/Thread.cpp.o [ 89%] Building CXX object libphx/CMakeFiles/phx.dir/src/ThreadPool.cpp.o [ 90%] Building CXX object libphx/CMakeFiles/phx.dir/src/TimeStamp.cpp.o [ 91%] Building CXX object libphx/CMakeFiles/phx.dir/src/Timer.cpp.o [ 91%] Building CXX object libphx/CMakeFiles/phx.dir/src/Triangle.cpp.o [ 92%] Building CXX object libphx/CMakeFiles/phx.dir/src/Trigger.cpp.o [ 93%] Building CXX object libphx/CMakeFiles/phx.dir/src/UIRenderer.cpp.o [ 94%] Building CXX object libphx/CMakeFiles/phx.dir/src/VR.cpp.o [ 95%] Building CXX object libphx/CMakeFiles/phx.dir/src/Viewport.cpp.o [ 96%] Building CXX object libphx/CMakeFiles/phx.dir/src/Window.cpp.o [ 97%] Building CXX object libphx/CMakeFiles/phx.dir/src/WindowMode.cpp.o [ 98%] Building CXX object libphx/CMakeFiles/phx.dir/src/WindowPos.cpp.o [ 99%] Linking CXX shared library ../../bin/libphx64r.so /usr/bin/ld: cannot find -lfreetype: No such file or directory /usr/bin/ld: cannot find -lluajit-5.1: No such file or directory /usr/bin/ld: /home/t/Documents/ltheory/libphx/ext/lib/linux64/libfmod.so: .dynsym local symbol at index 2 (>= sh_info of 2) /usr/bin/ld: /home/t/Documents/ltheory/libphx/ext/lib/linux64/libfmod.so: .dynsym local symbol at index 3 (>= sh_info of 2) /usr/bin/ld: /home/t/Documents/ltheory/libphx/ext/lib/linux64/libfmod.so: .dynsym local symbol at index 4 (>= sh_info of 2) /usr/bin/ld: /home/t/Documents/ltheory/libphx/ext/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 2 (>= sh_info of 2) /usr/bin/ld: /home/t/Documents/ltheory/libphx/ext/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 3 (>= sh_info of 2) /usr/bin/ld: /home/t/Documents/ltheory/libphx/ext/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 4 (>= sh_info of 2) /usr/bin/ld: cannot find -lBulletCollision: No such file or directory /usr/bin/ld: cannot find -lBulletDynamics: No such file or directory collect2: error: ld returned 1 exit status gmake[2]: *** [libphx/CMakeFiles/phx.dir/build.make:1857: ../bin/libphx64r.so] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:126: libphx/CMakeFiles/phx.dir/all] Error 2 gmake: *** [Makefile:91: all] Error 2 ```

I found online that the two errors I got :

/usr/bin/ld: cannot find -lBulletCollision: No such file or directory
/usr/bin/ld: cannot find -lBulletDynamics: No such file or directory

might be due to missing g++ but that's not my case.

t@tsu:~/Documents/ltheory$ g++ --version
g++ (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

what am I supposed to do?

tatsujb commented 2 years ago

or maybe this is the issue : https://stackoverflow.com/a/21391673/4770754

neonrust commented 2 years ago

FYI, I just tried this fork: https://github.com/Limit-Theory-Redux/ltheory Building it worked out of the box, after installing libbullet-dev. Haven't tried running it yet, though... ;)

tatsujb commented 2 years ago

ooh ! thanks! let's try that! (do I also have to remove ".exe" and the other changes required for a linux build? seems I do)

EDIT : well running build for me finished on another error :

[ 99%] Linking CXX shared library ../../bin/libphx64r.so
/usr/bin/ld: cannot find -lfreetype: No such file or directory
/usr/bin/ld: cannot find -lluajit-5.1: No such file or directory
/usr/bin/ld: /home/t/Documents/ltheory/build/_deps/ext-src/lib/linux64/libfmod.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/t/Documents/ltheory/build/_deps/ext-src/lib/linux64/libfmod.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/t/Documents/ltheory/build/_deps/ext-src/lib/linux64/libfmod.so: .dynsym local symbol at index 4 (>= sh_info of 2)
/usr/bin/ld: /home/t/Documents/ltheory/build/_deps/ext-src/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/t/Documents/ltheory/build/_deps/ext-src/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/t/Documents/ltheory/build/_deps/ext-src/lib/linux64/libfmodstudio.so: .dynsym local symbol at index 4 (>= sh_info of 2)
collect2: error: ld returned 1 exit status
gmake[2]: *** [libphx/CMakeFiles/phx.dir/build.make:1857: ../bin/libphx64r.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:126: libphx/CMakeFiles/phx.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

I'll go post in that repo's issues too

EDIT : bizarrely they don't have issues, they only have discussions. I posted there.

EDIT2 : I ran sudo apt install libfreetype-dev libluajit-5.1-dev maybe that'll do it?

neonrust commented 2 years ago

Almost out of the box, I had to make the patch mentioned here, and the patch to configure.py, mentioned here (which you mentioned already)

But to answer your question, yes, installing luajit is required as well.

tatsujb commented 2 years ago

oh yeah forgot about line 274 in ltheory/libphx/src/Physics.cpp

neonrust commented 2 years ago

Haven't been able to run it because of missing libfmod.so.10... not sure how it was able to build though...

tatsujb commented 2 years ago

build did work for me but...

python3 configure.py run
Traceback (most recent call last):
  File "/home/t/Documents/ltheory/configure.py", line 19, in <module>
    subprocess.call(['bin/lt64'] + sys.argv[2:])
  File "/usr/lib/python3.10/subprocess.py", line 345, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.10/subprocess.py", line 969, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'bin/lt64'

run does not.

neonrust commented 2 years ago

FileNotFoundError: [Errno 2] No such file or directory: 'bin/lt64'

Missing an r ? (in configure.py, I mean)

tatsujb commented 2 years ago

dammit

EDIT:

ok haha all caught up with you guys 😅

python3 configure.py run
bin/lt64r: error while loading shared libraries: libfmod.so.10: cannot open shared object file: No such file or directory
tatsujb commented 2 years ago

so now someone just needs to go in an redo the source entirely to not use FMOD but SDL_audio instead https://github.com/JoshParnell/libphx/issues/1#issue-1319792038 "just"

what about if I had a license to FMOD?

neonrust commented 2 years ago

Not really familiar with the fmod license, but yeah, something else would be preferable.

neonrust commented 2 years ago

Don't think you need a license per se just to run applications using it, though.

tatsujb commented 2 years ago

Don't think you need a license per se just to run applications using it, though.

?

do you have an example?

neonrust commented 2 years ago

Example of an application? No, not at the moment.

From their license faq:

When do I need a license? A license must be obtained before commercial release of a game (including soft releases like early access if it is paid access). A license is not required at the start of development.

dw0xaa55 commented 2 years ago

you could just copy the fmod library files from libphx/ext/lib/linux64/ into your bin/ folder. but note, that you have to rename libfmod.so to libfmod.so.10 and libfmodstudio.so to libfmodstudio.so.10.

neonrust commented 2 years ago

Hm... I don't have an "ext" directory, in the redux fork at least.

dw0xaa55 commented 2 years ago

Oh yeah right, it seems, that the redux version doesn't have an ext dir. You could try copying the required shared object files over from the original ltheory.