cyberbotics / webots

Webots Robot Simulator
https://cyberbotics.com
Apache License 2.0
3.14k stars 1.66k forks source link

stb_image.h path inclusion for using shared libraries #6481

Open Kreijstal opened 6 months ago

Kreijstal commented 6 months ago

the file src/webots/nodes/WbBackground.cpp uses stb_image.h instead of stb/stb_image.h this is if you package webots for distros where stb is provided :) https://github.com/Overv/VulkanTutorial/issues/251

also in file src/controller/c/g_image.c

Kreijstal commented 6 months ago

One way to solve this is to create another directory on stb, or to change the stb import, which one do you think is more appropiate?

omichel commented 6 months ago

I would prefer to avoid creating some webots/src/stb/stb folder as it doesn't look very nice.

Kreijstal commented 6 months ago

we could also change the line in src/webots/Makefile of STB_INCLUDE = -isystem $(WEBOTS_PATH)/src/stb to STB_INCLUDE = -isystem $(WEBOTS_PATH)/src

but I think the nested stb is nicer, the reason is that on 2018 there was no package in most systems, but now there is so systems like windows (msys2) you can simply just use mingw-w64-x86_64-stb, on ubuntu/debian there is libstb and libstb-dev and it compiles as it is without subcloning just using make :) (of course there is mingw-w64-x86_64-glm too)

omichel commented 6 months ago

OK, then we should probably remove this stb folder and use the one from the system. We should add it to the dependencies, so that the right version gets installed: