Kazade / kazmath

A C math library targeted at games
Other
520 stars 94 forks source link

Cannot build on OSX 10.11.6 #45

Open jamiltron opened 8 years ago

jamiltron commented 8 years ago

Steps to reproduce:

git clone https://github.com/Kazade/kazmath.git
cd kazmath
mkdir build
cd build
cmake ..
make

produces:

/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:53:34: warning: variadic
      templates are a C++11 extension [-Wc++11-extensions]
    template<typename T, typename... Args>
                                 ^
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:60:34: warning: variadic
      templates are a C++11 extension [-Wc++11-extensions]
    template<typename T, typename... Args>
                                 ^
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:96:5: error: exception
      specification of overriding function is more lax than base version
    ~AssertionError() noexcept (true) {
    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdexcept:76:13: note:
      overridden virtual function is here
    virtual ~logic_error() _NOEXCEPT;
            ^
In file included from /Users/jamiltron/opt/kazmath/tests/main.cpp:5:
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:96:22: error: expected ';'
      at end of declaration list
    ~AssertionError() noexcept (true) {
                     ^
                     ;
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:85:9: error: member
      initializer 'file' does not name a non-static data member or base class
        file(""),
        ^~~~~~~~
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:91:9: error: member
      initializer 'file' does not name a non-static data member or base class
        file(file_and_line.first),
        ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:121:13: warning: 'auto'
      type specifier is a C++11 extension [-Wc++11-extensions]
            auto file_and_line = std::make_pair(file, line);
            ^
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:129:13: warning: 'auto'
      type specifier is a C++11 extension [-Wc++11-extensions]
            auto file_and_line = std::make_pair(file, line);
            ^
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:137:13: warning: 'auto'
      type specifier is a C++11 extension [-Wc++11-extensions]
            auto file_and_line = std::make_pair(file, line);
            ^
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:146:13: warning: 'auto'
      type specifier is a C++11 extension [-Wc++11-extensions]
            auto file_and_line = std::make_pair(file, line);
            ^
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:154:13: warning: 'auto'
      type specifier is a C++11 extension [-Wc++11-extensions]
            auto file_and_line = std::make_pair(file, line);
            ^
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:162:13: warning: 'auto'
      type specifier is a C++11 extension [-Wc++11-extensions]
            auto file_and_line = std::make_pair(file, line);
            ^
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:171:13: warning: 'auto'
      type specifier is a C++11 extension [-Wc++11-extensions]
            auto file_and_line = std::make_pair(file, line);
            ^
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:293:41: error: a space is
      required between consecutive right angle brackets (use '> >')
    std::vector<std::shared_ptr<TestCase>> instances_;
                                        ^~
                                        > >
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:189:29: warning:
      range-based for loop is a C++11 extension [-Wc++11-extensions]
        for(std::string name: names) {
                            ^
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:193:22: warning:
      range-based for loop is a C++11 extension [-Wc++11-extensions]
        for(U& method: methods) {
                     ^
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:194:47: error: no member
      named 'bind' in namespace 'std'; did you mean 'find'?
            std::function<void()> func = std::bind(method, dynamic_cast<...
                                         ~~~~~^~~~
                                              find
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:862:1: note:
      'find' declared here
find(_InputIterator __first, _InputIterator __last, const _Tp& __value_)
^
In file included from /Users/jamiltron/opt/kazmath/tests/main.cpp:5:
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:195:30: error: expected
      expression
            tests_.push_back([=]() {
                             ^
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:209:9: warning: 'auto' type
      specifier is a C++11 extension [-Wc++11-extensions]
        auto new_tests = tests_;
        ^
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:210:9: warning: 'auto' type
      specifier is a C++11 extension [-Wc++11-extensions]
        auto new_names = names_;
        ^
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:226:40: warning:
      range-based for loop is a C++11 extension [-Wc++11-extensions]
        for(std::function<void ()> test: new_tests) {
                                       ^
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:243:23: error: no member
      named 'file' in 'AssertionError'
                if(!e.file.empty()) {
                    ~ ^
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:244:50: error: no member
      named 'file' in 'AssertionError'
                    std::cout << "        " << e.file << ":" << e.line <...
                                               ~ ^
/Users/jamiltron/opt/kazmath/tests/kaztest/kaztest.h:246:41: error: no member
      named 'file' in 'AssertionError'
                    std::ifstream ifs(e.file);
                                      ~ ^
/Users/jamiltron/opt/kazmath/tests/main.cpp:27:43: error: expected expression
        std::vector<void (TestAABB::*)()>({&TestAABB::test_aabb_expand_t...
                                          ^
/Users/jamiltron/opt/kazmath/tests/main.cpp:28:9: error: expected expression
        {"TestAABB::test_aabb_expand_to_contain", "TestAABB::test_aabb_c...
        ^
/Users/jamiltron/opt/kazmath/tests/main.cpp:32:43: error: expected expression
        std::vector<void (TestMat3::*)()>({&TestMat3::test_mat3_inverse...
                                          ^
/Users/jamiltron/opt/kazmath/tests/main.cpp:33:9: error: expected expression
        {"TestMat3::test_mat3_inverse", "TestMat3::test_mat3_transpose"...
        ^
/Users/jamiltron/opt/kazmath/tests/main.cpp:37:43: error: expected expression
        std::vector<void (TestMat4::*)()>({&TestMat4::test_mat4_inverse...
                                          ^
/Users/jamiltron/opt/kazmath/tests/main.cpp:38:9: error: expected expression
        {"TestMat4::test_mat4_inverse", "TestMat4::test_mat4_and_quatern...
        ^
/Users/jamiltron/opt/kazmath/tests/main.cpp:42:44: error: expected expression
        std::vector<void (TestPlane::*)()>({&TestPlane::test_plane_extra...
                                           ^
/Users/jamiltron/opt/kazmath/tests/main.cpp:43:9: error: expected expression
        {"TestPlane::test_plane_extraction_from_matrix", "TestPlane::tes...
        ^
/Users/jamiltron/opt/kazmath/tests/main.cpp:47:49: error: expected expression
        std::vector<void (TestQuaternion::*)()>({&TestQuaternion::test_q...
                                                ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
14 warnings and 20 errors generated.
make[2]: *** [tests/CMakeFiles/kazmath_tests.dir/main.cpp.o] Error 1
make[1]: *** [tests/CMakeFiles/kazmath_tests.dir/all] Error 2
make: *** [all] Error 2
Kazade commented 8 years ago

Thanks! Do you know what compiler and version this is?

Kazade commented 8 years ago

Sorry, I have no idea what happened there - it didn't work for me either! Should be fixed now!

jamiltron commented 8 years ago

make

Undefined symbols for architecture x86_64: "_luaL_register", referenced from: _openclskmMat3 in lkazmath.c.o _opencls__kmRay2 in lkazmath.c.o _openclskmRay3 in lkazmath.c.o _openclskmQuaternion in lkazmath.c.o _opencls__kmMat4 in lkazmath.c.o _openclskmAABB2 in lkazmath.c.o _openclskmPlane in lkazmath.c.o ... "_lua_objlen", referenced from: _lua__kmMat3NewWithArray in lkazmath.c.o _luakmMat4NewWithArray in lkazmath.c.o _luakmMat3Fill in lkazmath.c.o _lua__kmMat4Fill in lkazmath.c.o _luacis_array in lkazmath.c.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: * [lua/liblkazmath.dylib] Error 1 make[1]: * [lua/CMakeFiles/lkazmath.dir/all] Error 2 make: *\ [all] Error 2

Kazade commented 8 years ago

Hmm, that's odd... I've just acquired a (broken) Macbook so I'll see if I can get it running and figure this out. For now you can disable building the lua bindings with:

cmake -DKAZMATH_BUILD_LUA_WRAPPER=off ..

And that should make things compile for now.

jamiltron commented 8 years ago

Thanks. Let me know if there's anyway I can help out. Unfortunately I am not very knowledgable with CMake, which it seems like may be the issue here.