hugoam / toy

the thin c++ game engine
https://toyengine.io
GNU General Public License v3.0
1.56k stars 102 forks source link

fails to build on macos #12

Open freder opened 6 years ago

freder commented 6 years ago

os: macos 10.13.6

steps:

./bin/darwin/genie --gcc=osx gmake
cd build/projects/gmake-osx
make config=debug64 -j8

==== Building glslang (debug64) ====
==== Building fcpp (debug64) ====
==== Building glsl-optimizer (debug64) ====
==== Building spirv-opt (debug64) ====
==== Building bx (debug64) ====
==== Building bimg (debug64) ====
==== Building bimg_decode (debug64) ====
==== Building vg (debug64) ====
==== Building glfw (debug64) ====
==== Building wren (debug64) ====
==== Building lua (debug64) ====
==== Building stb_rect_pack (debug64) ====
==== Building json11 (debug64) ====
==== Building tracy (debug64) ====
==== Building BulletCollision (debug64) ====
==== Building BulletDynamics (debug64) ====
==== Building LinearMath (debug64) ====
==== Building stb_image (debug64) ====
==== Building bgfx (debug64) ====
==== Building shaderc (debug64) ====
==== Building mud (debug64) ====
==== Building 00_cube (debug64) ====
==== Building 00_tutorial (debug64) ====
==== Building 01_shapes (debug64) ====
==== Building 02_camera (debug64) ====
==== Building 03_materials (debug64) ====
==== Building 04_lights (debug64) ====
==== Building 04_sponza (debug64) ====
==== Building 06_particles (debug64) ====
03_materials.cpp
01_shapes.cpp
02_camera.cpp
00_cube.cpp
06_particles.cpp
04_sponza.cpp
04_lights.cpp
00_tutorial.cpp
../../../mud/example/03_materials/03_materials.cpp:229:25: fatal error: expected expression
        cstring example_path = MUD_RESOURCE_PATH "examples/03_materials/";
                               ^
<command line>:66:27: note: expanded from here
#define MUD_RESOURCE_PATH /bla/toy/data/
                          ^
../../../mud/example/01_shapes/01_shapes.cpp:78:22: fatal error: expected expression
        Shell app(cstrarray(MUD_RESOURCE_PATH), argc, argv);
                            ^
<command line>:66:27: note: expanded from here
#define MUD_RESOURCE_PATH /bla/toy/data/
                          ^
../../../mud/example/00_cube/00_cube.cpp:56:22: fatal error: expected expression
        Shell app(cstrarray(MUD_RESOURCE_PATH), argc, argv);
                            ^
<command line>:66:27: note: expanded from here
#define MUD_RESOURCE_PATH /bla/toy/data/
                          ^
../../../mud/example/04_lights/04_lights.cpp:147:22: fatal error: expected expression
        Shell app(cstrarray(MUD_RESOURCE_PATH), argc, argv);
                            ^
<command line>:74:27: note: expanded from here
#define MUD_RESOURCE_PATH /bla/toy/data/
                          ^
../../../mud/example/04_sponza/04_sponza.cpp:61:25: fatal error: expected expression
        cstring example_path = MUD_RESOURCE_PATH "examples/04_sponza/";
                               ^
<command line>:74:27: note: expanded from here
#define MUD_RESOURCE_PATH /bla/toy/data/
                          ^
../../../mud/example/02_camera/02_camera.cpp:31:22: fatal error: expected expression
../../../mud/example/06_particles/06_particles.cpp        Shell app(cstrarray(MUD_RESOURCE_PATH), argc, argv);
                            ^
<command line>:70:27: note: expanded from: here96:
25: fatal error: expected expression
#define MUD_RESOURCE_PATH /bla/toy/data/
                          ^
        cstring example_path = MUD_RESOURCE_PATH "examples/06_particles/";
                               ^
<command line>:66:27: note: expanded from here
#define MUD_RESOURCE_PATH /bla/toy/data/
                          ^
11 error error generated generated.
.
1 error generated.
1 error generated.
1 error generated.
1 error generated.
1 error generated.
make[1]: *** [../../osx64_clang/obj/x64/Debug/03_materials/mud/example/03_materials/03_materials.o] Error 1
make: *** [03_materials] Error 2
make: *** Waiting for unfinished jobs....
make[1]: *** [../../osx64_clang/obj/x64/Debug/01_shapes/mud/example/01_shapes/01_shapes.o] Error 1
make: *** [01_shapes] Error 2
Shell.cpp
make[1]: *** [../../osx64_clang/obj/x64/Debug/00_cube/mud/example/00_cube/00_cube.o] Error 1
make[1]: *** Waiting for unfinished jobs....
Shell.cpp
make[1]: *** [../../osx64_clang/obj/x64/Debug/04_sponza/mud/example/04_sponza/04_sponza.o] Error 1
make: *** [04_sponza] Error 2
Module.cpp
make[1]: *** [../../osx64_clang/obj/x64/Debug/02_camera/mud/example/02_camera/02_camera.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [../../osx64_clang/obj/x64/Debug/06_particles/mud/example/06_particles/06_particles.o] Error 1
make[1]: *** [../../osx64_clang/obj/x64/Debug/04_lights/mud/example/04_lights/04_lights.o] Error 1
make: *** [06_particles] Error 2
make: *** [04_lights] Error 2
Shell.cpp
../../../mud/example/00_tutorial/00_tutorial.cpp:63:22: fatal error: expected expression
        Shell app(cstrarray(MUD_RESOURCE_PATH), argc, argv);
                            ^
<command line>:66:27: note: expanded from here
#define MUD_RESOURCE_PATH /bla/toy/data/
                          ^
1 error generated.
make[1]: *** [../../osx64_clang/obj/x64/Debug/00_tutorial/mud/example/00_tutorial/00_tutorial.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [02_camera] Error 2
make: *** [00_cube] Error 2
make: *** [00_tutorial] Error 2
hugoam commented 6 years ago

Hi ! I've been working on fixing the builds today including OSX. As of https://github.com/hugoam/toy/commit/38f54e0ff006ae4c3f315f322e1b8c99c007aecf, toy builds for OSX again. Please pull the latest revision and update the submodules and try again. I'd be happy to hear feedback about whether or not it runs on OSX.

Also the examples are expected to be buggy or may crash as toy has been going through some heavy refactoring lately.

freder commented 6 years ago

thanks. – I just pulled the latest changes and updated the submodules as well. now I get:

[...]
Types.cpp
Context.cpp
InputDevice.cpp
InputDispatcher.cpp
../../../mud/3rdparty/FastNoise/FastNoise.cpp:186:12: warning: unused function 'FastAbs'
      [-Wunused-function]
static int FastAbs(int i) { return abs(i); }
           ^
1 warning generated.
Types.cpp
Entity.cpp
Proto.cpp
Test.cpp
Types.cpp
Intersect.cpp
In file included from ../../../mud/src/ecs/Entity.cpp:11:
In file included from ../../../mud/src/ecs/Entity.h:11:
../../../mud/src/ecs/Registry.h:391:46: warning: field 'm_handle' will be initialized after
      field 'm_stream' [-Wreorder]
                Entity(uint32_t handle, uint32_t stream) : m_handle(handle), m_strea...
                                                           ^
../../../mud/src/ecs/Registry.h:448:24: fatal error: use of undeclared identifier 'm_handle'
                ~EntityHandle() { if(m_handle != UINT32_MAX) s_ecs[m_stream]->Delete...
                                     ^
1 warning and 1 error generated.
make[1]: *** [../../osx64_clang/obj/x64/Debug/mud/mud/src/ecs/Entity.o] Error 1
make[1]: *** Waiting for unfinished jobs....
../../../mud/src/ecs/Proto.cpp:24:2: warning: control may reach end of non-void function
      [-Wreturn-type]
        }
        ^
In file included from ../../../mud/src/ecs/Test.cpp:2:
../../../mud/src/ecs/Registry.h:391:46: warning: field 'm_handle' will be initialized after
      field 'm_stream' [-Wreorder]
                Entity(uint32_t handle, uint32_t stream) : m_handle(handle), m_strea...
                                                           ^
../../../mud/src/ecs/Registry.h:448:24: fatal error: use of undeclared identifier 'm_handle'
                ~EntityHandle() { if(m_handle != UINT32_MAX) s_ecs[m_stream]->Delete...
                                     ^
1 warning and 1 error generated.
make[1]: *** [../../osx64_clang/obj/x64/Debug/mud/mud/src/ecs/Test.o] Error 1
1 warning generated.
In file included from ../../../mud/src/ecs/Types.cpp:9:
In file included from ../../../mud/src/ecs/Api.h:1:
In file included from ../../../mud/src/ecs/Entity.h:11:
../../../mud/src/ecs/Registry.h:391:46: warning: field 'm_handle' will be initialized after
      field 'm_stream' [-Wreorder]
                Entity(uint32_t handle, uint32_t stream) : m_handle(handle), m_strea...
                                                           ^
../../../mud/src/ecs/Registry.h:448:24: fatal error: use of undeclared identifier 'm_handle'
                ~EntityHandle() { if(m_handle != UINT32_MAX) s_ecs[m_stream]->Delete...
                                     ^
1 warning and 1 error generated.
make[1]: *** [../../osx64_clang/obj/x64/Debug/mud/mud/src/ecs/Types.o] Error 1
make: *** [mud] Error 2
hugoam commented 6 years ago

Sorry for the delay, I finally got around to fixing the build. Some submodules have changed too so you should probably (starting from toy folder): git pull git submodule update cd mud git submodule sync git submodule update

freder commented 6 years ago

no worries – thanks for doing this in the first place!

now I get:

In file included from ../../../src/block/VisuBlock.cpp:6:
In file included from ../../../src/block/VisuBlock.h:8:
../../../src/visu/VisuScene.h:89:10: fatal error: member access into incomplete type 'toy::World'
                                world.m_ecs.Loop<Spatial, T>([this, paint_func, index, &parent](uint32_t entity, Spatial& spatial, T& component)
                                     ^
../../../src/core/Forward.h:97:11: note: forward declaration of 'toy::World'
    class World;
          ^
In file included from ../../../src/core/Bullet/BulletSolid.cpp:26:
In file included from ../../../3rdparty/bullet/src/btBulletDynamicsCommon.h:20:
In file included from ../../../3rdparty/bullet/src/btBulletCollisionCommon.h:28:
../../../3rdparty/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.h:49:34: warning: unused parameter 'collisionMargin' [-Wunused-parameter]
        virtual void setMargin(btScalar collisionMargin)
                                        ^
In file included from ../../../src/core/Bullet/BulletSolid.cpp:26:
In file included from ../../../3rdparty/bullet/src/btBulletDynamicsCommon.h:22:
In file included from ../../../3rdparty/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h:33:
../../../3rdparty/bullet/src/LinearMath/btThreads.h:71:50: warning: unused parameter 'mutex' [-Wunused-parameter]
SIMD_FORCE_INLINE void btMutexLock( btSpinMutex* mutex )
                                                 ^
../../../3rdparty/bullet/src/LinearMath/btThreads.h:78:52: warning: unused parameter 'mutex' [-Wunused-parameter]
SIMD_FORCE_INLINE void btMutexUnlock( btSpinMutex* mutex )
                                                   ^
../../../3rdparty/bullet/src/LinearMath/btThreads.h:85:53: warning: unused parameter 'mutex' [-Wunused-parameter]
SIMD_FORCE_INLINE bool btMutexTryLock( btSpinMutex* mutex )
                                                    ^
In file included from ../../../src/core/Bullet/BulletSolid.cpp:26:
In file included from ../../../3rdparty/bullet/src/btBulletDynamicsCommon.h:27:
In file included from ../../../3rdparty/bullet/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h:21:
In file included from ../../../3rdparty/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h:21:
In file included from ../../../3rdparty/bullet/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h:26:
../../../3rdparty/bullet/src/BulletDynamics/ConstraintSolver/btSolverBody.h:62:20: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
        SIMD_FORCE_INLINE       const __m128    get128() const
                                ^~~~~~
1 error generated.
make[1]: *** [../../osx64_clang/obj/x64/Debug/toy/src/block/VisuBlock.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from ../../../src/core/Bullet/BulletWorld.cpp:28:
In file included from ../../../3rdparty/bullet/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h:23:
In file included from ../../../3rdparty/bullet/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h:21:
In file included from ../../../3rdparty/bullet/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h:26:
../../../3rdparty/bullet/src/BulletDynamics/ConstraintSolver/btSolverBody.h:62:20: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
        SIMD_FORCE_INLINE       const __m128    get128() const
                                ^~~~~~
In file included from ../../../src/core/Bullet/BulletWorld.cpp:29:
In file included from ../../../3rdparty/bullet/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h:33:
../../../3rdparty/bullet/src/LinearMath/btThreads.h:71:50: warning: unused parameter 'mutex' [-Wunused-parameter]
SIMD_FORCE_INLINE void btMutexLock( btSpinMutex* mutex )
                                                 ^
../../../3rdparty/bullet/src/LinearMath/btThreads.h:78:52: warning: unused parameter 'mutex' [-Wunused-parameter]
SIMD_FORCE_INLINE void btMutexUnlock( btSpinMutex* mutex )
                                                   ^
../../../3rdparty/bullet/src/LinearMath/btThreads.h:85:53: warning: unused parameter 'mutex' [-Wunused-parameter]
SIMD_FORCE_INLINE bool btMutexTryLock( btSpinMutex* mutex )
                                                    ^
In file included from ../../../src/core/Bullet/BulletWorld.cpp:32:
In file included from ../../../3rdparty/bullet/src/btBulletCollisionCommon.h:28:
../../../3rdparty/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.h:49:34: warning: unused parameter 'collisionMargin' [-Wunused-parameter]
        virtual void setMargin(btScalar collisionMargin)
                                        ^
../../../src/core/Bullet/BulletWorld.cpp:207:23: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
                for(size_t i = 0; i < callback.m_collisionObjects.size(); ++i)
                                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 warnings generated.
In file included from ../../../src/block/Types.cpp:9:
In file included from ../../../src/block/Api.h:8:
In file included from ../../../src/block/VisuBlock.h:8:
../../../src/visu/VisuScene.h:89:10: fatal error: member access into incomplete type 'toy::World'
                                world.m_ecs.Loop<Spatial, T>([this, paint_func, index, &parent](uint32_t entity, Spatial& spatial, T& component)
                                     ^
../../../src/core/Forward.h:97:11: note: forward declaration of 'toy::World'
    class World;
          ^
1 error generated.
make[1]: *** [../../osx64_clang/obj/x64/Debug/toy/src/block/Types.o] Error 1
In file included from ../../../src/core/Camera/Camera.cpp:7:
../../../src/core/Camera/Camera.h:66:8: warning: private field 'm_planar' is not used [-Wunused-private-field]
                bool m_planar;
                     ^
../../../src/core/Camera/Camera.h:67:9: warning: private field 'm_vertical_angle' is not used [-Wunused-private-field]
                float m_vertical_angle;
                      ^
../../../src/core/Camera/Camera.h:68:9: warning: private field 'm_plane_distance' is not used [-Wunused-private-field]
                float m_plane_distance;
                      ^
6 warnings generated.
3 warnings generated.
make: *** [toy] Error 2
hugoam commented 6 years ago

This is really weird : I fixed this error yesterday ! Can you confirm that line 12 and 14 are the same as here in https://github.com/hugoam/toy/blob/master/src/visu/VisuScene.h#L12 If not, you didn't pull the latest revision somehow

hugoam commented 6 years ago

Also if you want quicker exchanges on this topic you're welcome to come in the gitter room: https://gitter.im/hugoam/toy

mikalv commented 5 years ago

It seems to still fail on Mac OS X (10.14) at least. Current mud had quite a lot of redefinition errors on some inline functions like swap, as, etc. which didn't make any sense. I removed the mud directory replacing it with the current master of the mud repo, which worked much better however I'm battling some issues with mud::Grid<toy::Block*> I've yet to resolve, seems for me like the class is gone.