guillaumechereau / goxel

Goxel: Free and Open Source 3D Voxel Editor
GNU General Public License v3.0
2.8k stars 223 forks source link

Can't build on Ubuntu 18.10 #158

Closed titimoby closed 1 year ago

titimoby commented 5 years ago

when running scons: scons pkg-config libglfw3-dev libgtk-3-dev

I end up with the following error: Checking for C library libpng... (cached) yes scons: done reading SConscript files. scons: Building targets ... scons: *** Do not know how to make File targetpkg-config' (/mnt/BigSlowbowski/goxel/pkg-config). Stop. scons: building terminated because of errors. ` any way to get more information on the error cause?

guillaumechereau commented 5 years ago

Do you have pkg-config installed? You can install with the following command:

sudo apt install pkg-config
Mapachana commented 5 years ago

I had a similar problem, what I did (and worked for me in ubuntu 16.04) is:

guillaumechereau commented 5 years ago

make release should generate a much smaller and faster executable. Just typing scons will build in debug mode by default.

titimoby commented 5 years ago

I had all the dependencies already installed. In the end, I produced a working binary using make release

sariug commented 4 years ago

Hello. I am also having a problem with libglfw3.a. I paste the error.

Any help is appreciated ? g++ -o goxel -fsanitize=address -fsanitize=undefined -pthread src/gui.o src/layer.o src/tools.o src/camera.o src/mesh_to_vertices.o src/palette.o src/box_edit.o src/shape.o src/system.o src/quantization.o src/action.o src/luagoxel.o src/script.o src/procedural.o src/mesh.o src/model3d.o src/xxhash.o src/gesture3d.o src/utils.o src/shader_cache.o src/image.o src/render.o src/theme.o src/main.o src/imgui.o src/marchingcube.o src/gesture.o src/pathtracer.o src/goxel.o src/tests.o src/material.o src/mesh_utils.o src/assets.o src/yocto.o src/formats/wavefront.o src/formats/gltf.o src/formats/vox.o src/formats/dicom.o src/formats/povray.o src/formats/vxl.o src/formats/gox.o src/formats/png.o src/formats/qubicle.o src/formats/txt.o src/formats/png_slices.o src/formats/voxlap.o src/utils/texture.o src/utils/box.o src/utils/vec.o src/utils/b64.o src/utils/json.o src/utils/img.o src/utils/gl.o src/utils/mustache.o src/utils/color.o src/utils/cache.o src/utils/ini.o src/utils/sound.o src/tools/plane.o src/tools/color_picker.o src/tools/shape.o src/tools/line.o src/tools/move.o src/tools/procedural.o src/tools/brush.o src/tools/selection.o src/tools/fuzzy_select.o src/tools/extrude.o src/tools/laser.o src/gui/export_panel.o src/gui/settings.o src/gui/view_panel.o src/gui/palette_panel.o src/gui/app.o src/gui/image_panel.o src/gui/menu.o src/gui/debug_panel.o src/gui/tools_panel.o src/gui/topbar.o src/gui/material_panel.o src/gui/light_panel.o src/gui/cameras_panel.o src/gui/render_panel.o src/gui/layers_panel.o src/gui/about.o -L/usr/local/lib -lasan -lubsan -lpng -lGL -lm -lglfw3 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 /usr/bin/ld: /usr/local/lib/libglfw3.a(vulkan.c.o): undefined reference to symbol 'dlsym@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status scons: *** [goxel] Error 1 scons: building terminated because of errors. Makefile:5: recipe for target 'all' failed make: *** [all] Error 2

btw why no cmake ?

guillaumechereau commented 4 years ago

Hello @sariug. Are you also using Ubuntu 18.10? Not sure what this error is. Have you tried to build in release mode to see if that makes a difference?

As to why not cmake: I am not against it, but last time someone submitted a PM request to switch to cmake I didn't like the fact that it used several files. If someone can make a cmake build script for goxel that uses only one file and is not more complicated than the current scons script I would consider switching.

sariug commented 4 years ago

Hey ! Thanks for the quick reply.

I use ubuntu 18.04.3

I am not a real expert on these but : I created this in 2 minutes:

# CMake entry point cmake_minimum_required (VERSION 3.0) project (GOXEL) find_package(OpenGL REQUIRED) find_package(GLEW REQUIRED) if (GLEW_FOUND) include_directories(${GLEW_INCLUDE_DIRS}) link_libraries(${GLEW_LIBRARIES}) endif()

FIND_PACKAGE ( PkgConfig REQUIRED ) PKG_CHECK_MODULES( GTK REQUIRED gtk+-3.0 ) # or use gtk+-2.0, etc... INCLUDE_DIRECTORIES ( ${GTK_INCLUDE_DIRS} )

find_package(PNG) INCLUDE_DIRECTORIES ( ${PNG_INCLUDE_DIRS} ) `set(ALL_LIBS ${OPENGL_LIBRARY} glfw

GLEW_1130

${GLEW_LIBRARIES}
${GTK_LIBRARIES}

)`

include_directories(${CMAKE_SOURCE_DIR}/src) include_directories(${CMAKE_SOURCE_DIR}/src/gui) include_directories(${CMAKE_SOURCE_DIR}/src/tools) include_directories(${CMAKE_SOURCE_DIR}/src/assets) include_directories(${CMAKE_SOURCE_DIR}/src/formats) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ext_src/noc) include_directories(${CMAKE_SOURCE_DIR}/ext_src/uthash) include_directories(${CMAKE_SOURCE_DIR}/ext_src/xxhash) include_directories(${CMAKE_SOURCE_DIR}/ext_src/stb) include_directories(${CMAKE_SOURCE_DIR}/ext_src/yocto) FILE(GLOB SOURCE src/*.c src/*.cpp src/utils/*.c src/gui/*.c src/tools/*.c src/formats/*.c src/assets/*.inl /ext_src/yocto/*.cpp )

add_executable(GOXEL ${SOURCE} )

target_link_libraries(GOXEL ${ALL_LIBS} -lpthread -lm -lX11 )

Just a linking problem left(looks like the other one though.

/usr/bin/ld: CMakeFiles/rotate_points.dir/src/luagoxel.c.o: undefined reference to symbol 'acos@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status CMakeFiles/rotate_points.dir/build.make:854: recipe for target 'rotate_points' failed make[2]: *** [rotate_points] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/rotate_points.dir/all' failed make[1]: *** [CMakeFiles/rotate_points.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

guillaumechereau commented 4 years ago

Thanks for the code. It does look much better than I expected I have to admit. What would be the advantage of cmake compared to other build systems though? As for the bug, I would need to check on a VM to try to reproduce it on an ubuntu 18.10 machine. I'll try to do that when I get the time.

sariug commented 4 years ago

Thanks for the reply again.

What would be the advantage of cmake compared to other build systems though?

more common? almost all projects have it these days except those who are developing some kernels. Also dealing with building errors I find easier, but that's just me being mean :)

thehans commented 4 years ago

Hello, I just ran into the same issue as @titimoby, and just realized what the error was.

The instructions say:

Install dependencies: scons pkg-config libglfw3-dev libgtk-3-dev

Which I, and apparently @titimoby interpreted as a single command, that scons was being run somehow to initialize those components. When in reality, its just the list of the dependencies which should be installed via your package manager.

I would suggest a small change, for clarity, that the README lists the dependencies as bullet points instead of all on the same line.

Install dependencies:

  • scons
  • pkg-config
  • libglfw3-dev
  • libgtk-3-dev
guillaumechereau commented 4 years ago

OK thanks! I will do that.