Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Thor 2.0 cmake build error OS X 10.7  (Read 23370 times)

0 Members and 1 Guest are viewing this topic.

MonkeyKnight

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Thor 2.0 cmake build error OS X 10.7
« on: April 18, 2012, 01:51:15 am »
I am not positive I have posted this in the correct place.

I am having an issue getting cmake to generate makefiles properly.

SFML_DIR-NOTFOUND

The location that I have SFML2 installed at is (default) /usr/local.

The location that I have SFML2 sources is: /home/nick/src/SFML2

I have pointed SFML_DIR at:
/usr/local/
/home/nick/src/SFML2/
/usr/local/include/SFML/


They all end up the same:




I have searched the SFML2 source dir for SFMLConfig.cmake and for sfml-config.cmake, but have not found either file.


Thank you for any help!
 
« Last Edit: April 18, 2012, 02:53:41 am by MonkeyKnight »

Erebus

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Thor 2.0 cmake build error OS X 10.7
« Reply #1 on: April 18, 2012, 03:10:55 am »
The file you need (I think at least) is FindSFML.cmake and its located in the SFML source dir under cmake/Modules.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Thor 2.0 cmake build error OS X 10.7
« Reply #2 on: April 18, 2012, 11:56:56 am »
I have pointed SFML_DIR at:
You need to set SFMLDIR, not SFML_DIR. Hopefully Laurent renames this variable to SFML_ROOT, the underscore leads to confusion again and again.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Thor 2.0 cmake build error OS X 10.7
« Reply #3 on: April 18, 2012, 12:27:05 pm »
There would be no confusion if people read the error message carefully.
Laurent Gomila - SFML developer

Astrof

  • Full Member
  • ***
  • Posts: 135
    • View Profile
Re: Thor 2.0 cmake build error OS X 10.7
« Reply #4 on: April 18, 2012, 03:24:16 pm »
There would be no confusion if people read the error message carefully.

I wouldn't say no confusion; I'd maybe say less confusion.  When I read SFMLDIR and SFML_DIR to my mind they're the same thing.  Most people just see a general pattern of letters so SFMLDIR, SFML_DIR, SFML-DIR, etc all would be about the same unless read consciously and super carefully. 

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Thor 2.0 cmake build error OS X 10.7
« Reply #5 on: April 18, 2012, 03:35:37 pm »
Yeah, I guess it would be much better if CMake didn't display instructions about something that is not supposed to be used (the SFML_DIR directory containing a configuration file -- I'm not using that at all).

But anyway, I'll change the name of the variable, yes.
Laurent Gomila - SFML developer

MonkeyKnight

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Re: Thor 2.0 cmake build error OS X 10.7
« Reply #6 on: April 18, 2012, 03:52:59 pm »
For this case, I certainly see SFMLDIR and SFML_DIR as two different variables.

But it appears that I have SFMLDIR set, no?

If /usr/local contains the directories local and lib, which contain the sfml headers and sfml libs respectively. Wouldn't this satisfy the cake file?


Code: [Select]
Nicholass-MacBook-Pro:local nick$ cd /usr/local/
Nicholass-MacBook-Pro:local nick$ ls lib | grep sfml
libsfml-audio-s.a
libsfml-audio.2.0.dylib
libsfml-audio.2.dylib
libsfml-audio.dylib
libsfml-graphics-s.a
libsfml-graphics.2.0.dylib
libsfml-graphics.2.dylib
libsfml-graphics.dylib
libsfml-network-s.a
libsfml-network.2.0.dylib
libsfml-network.2.dylib
libsfml-network.dylib
libsfml-system-s.a
libsfml-system.2.0.dylib
libsfml-system.2.dylib
libsfml-system.dylib
libsfml-window-s.a
libsfml-window.2.0.dylib
libsfml-window.2.dylib
libsfml-window.dylib
Nicholass-MacBook-Pro:local nick$ ls include/ | grep SFML
SFML
Nicholass-MacBook-Pro:local nick$


The file you need (I think at least) is FindSFML.cmake and its located in the SFML source dir under cmake/Modules.

I have also tried to set both SFMLDIR and SFML_DIR to: /Users/nick/src/SFML2/cmake/Modules with the same results.


Thanks in advance.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Thor 2.0 cmake build error OS X 10.7
« Reply #7 on: April 18, 2012, 04:00:14 pm »
Quote
But it appears that I have SFMLDIR set, no?
Yes, but SFMLDIR alone won't do anything, it is used by FindSFML.cmake.

Quote
I have also tried to set both SFMLDIR and SFML_DIR to: /Users/nick/src/SFML2/cmake/Modules with the same results.
Look at what the CMake error message says: its the CMAKE_MODULE_PATH variable which is used to locate the FindSFML.cmake file.

I think it would be much easier if Thor included it directly in its sources ;)
Laurent Gomila - SFML developer

MonkeyKnight

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Re: Thor 2.0 cmake build error OS X 10.7
« Reply #8 on: April 18, 2012, 06:06:19 pm »
I apologize for my cmake ignorance. I hardly use cmake.

I am over that hurdle, but now others...

Thanks for all your help.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Thor 2.0 cmake build error OS X 10.7
« Reply #9 on: April 19, 2012, 05:10:57 pm »
I think it would be much easier if Thor included it directly in its sources ;)
You mean the FindSFML.cmake file? That's a good idea, but I have to keep it up-to-date with SFML. Just like the rest of the library ;)

How can I make sure it is used by my scripts? CMAKE_MODULE_PATH might be needed for other modules...

By the way, thanks for the help in this thread and the SFML_ROOT change!
« Last Edit: April 19, 2012, 05:13:36 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Thor 2.0 cmake build error OS X 10.7
« Reply #10 on: April 19, 2012, 06:08:35 pm »
Quote
You mean the FindSFML.cmake file? That's a good idea, but I have to keep it up-to-date with SFML
Hopefully it won't change anymore after the SFML 2 release.

Quote
How can I make sure it is used by my scripts? CMAKE_MODULE_PATH might be needed for other modules...
Can't CMAKE_MODULE_PATH contain multiple paths? If not, setting it in your CMakeLists.txt files will override the user value anyway, and hopefully it will stay local to the current file.
Laurent Gomila - SFML developer

MonkeyKnight

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • Email
Re: Thor 2.0 cmake build error OS X 10.7
« Reply #11 on: April 20, 2012, 03:44:50 am »
Greetings fellas.


I have been away for a bit. I have now come across these errors in the build process:

Code: [Select]
/Users/nick/src/Thor/src/ActionOperations.cpp:114:89: error: no member named 'bind' in namespace 'std'; did you mean 'find'?
                std::remove_copy_if(newEvents.begin(), newEvents.end(), std::back_inserter(out), std::bind(&ActionNode::filterOut, ...
                                                                                                 ~~~~~^~~~
                                                                                                      find 


Code: [Select]
[  3%] Building CXX object src/CMakeFiles/thor.dir/Action.cpp.o
In file included from /Users/nick/src/Thor/src/Action.cpp:26:
In file included from /Users/nick/src/Thor/include/Thor/Events/Action.hpp:32:
In file included from /Users/nick/src/Thor/include/Thor/Detail/ActionOperations.hpp:32:
In file included from /Users/nick/src/Thor/extlibs/aurora/include/Aurora/SmartPtr/CopiedPtr.hpp:32:
In file included from /Users/nick/src/Thor/extlibs/aurora/include/Aurora/SmartPtr/PtrFunctors.hpp:32:
/Users/nick/src/Thor/extlibs/aurora/include/Aurora/Tools/Metaprogramming.hpp:31:10: fatal error: 'type_traits' file not found
#include <type_traits>
         ^
1 error generated.
make[2]: *** [src/CMakeFiles/thor.dir/Action.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/thor.dir/all] Error 2
make: *** [all] Error 2



After some googlin' around, I edited CMakeLists.txt, adding at line 80:

*Keep in mind I am a complete cmake noob.*

Code: [Select]
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
#    set(MACOSX 1)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++0x -U__STRICT_ANSI__ ")
endif()

When I try to compile now, it fixes the above errors - However generates more

Here is my compiler output:

Code: [Select]
[ 46%] Building CXX object src/CMakeFiles/thor.dir/Distributions.cpp.o
0  clang             0x0000000101e8b3e2 _ZL15PrintStackTracePv + 34
1  clang             0x0000000101e8b869 _ZL13SignalHandleri + 553
2  libsystem_c.dylib 0x00007fff8c56ccfa _sigtramp + 26
3  clang             0x00000001010058c6 clang::Decl::getAvailability(std::string*) const + 582
4  clang             0x00000001010349d6 clang::Sema::ActOnBinOp(clang::Scope*, clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*) + 1606
5  clang             0x0000000101033bca clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*, true>, clang::prec::Level) + 570
6  clang             0x000000010102d06b clang::Parser::ParseAssignmentExpression() + 171
7  clang             0x000000010102cfa1 clang::Parser::ParseExpression() + 17
8  clang             0x00000001010824ae clang::Parser::ParseExprStatement(clang::ParsedAttributes&) + 46
9  clang             0x000000010102ca3c clang::Parser::ParseStatementOrDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&, bool) + 1564
10 clang             0x000000010102bd59 clang::Parser::ParseCompoundStatementBody(bool) + 409
11 clang             0x000000010102bb4f clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) + 159
12 clang             0x0000000101577a26 clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&) + 454
13 clang             0x0000000101527aac clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&) + 140
14 clang             0x000000010152174e clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, unsigned int, clang::Decl*) + 2590
15 clang             0x0000000100ff113e clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, bool) + 4478
16 clang             0x0000000100fef2d1 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext) + 3553
17 clang             0x000000010156205c clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 620
18 clang             0x0000000101561064 clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 756
19 clang             0x0000000101560d3f clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 351
20 clang             0x0000000100fedf08 clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&, unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 472
21 clang             0x0000000100fed79f clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::Parser::ParsingDeclSpec*) + 1423
22 clang             0x000000010153561d clang::Parser::ParseInnerNamespace(std::vector<clang::SourceLocation, std::allocator<clang::SourceLocation> >&, std::vector<clang::IdentifierInfo*, std::allocator<clang::IdentifierInfo*> >&, std::vector<clang::SourceLocation, std::allocator<clang::SourceLocation> >&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::Parser::BalancedDelimiterTracker&) + 205
23 clang             0x0000000101534802 clang::Parser::ParseNamespace(unsigned int, clang::SourceLocation&, clang::SourceLocation) + 3074
24 clang             0x0000000100fee032 clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&, unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 770
25 clang             0x0000000100fed79f clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::Parser::ParsingDeclSpec*) + 1423
26 clang             0x0000000100fed199 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 249
27 clang             0x0000000100fd00a5 clang::ParseAST(clang::Sema&, bool) + 325
28 clang             0x0000000100fcebd7 clang::CodeGenAction::ExecuteAction() + 855
29 clang             0x0000000100fa113f clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 879
30 clang             0x0000000100f9fdcb clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2683
31 clang             0x0000000100f925ce cc1_main(char const**, char const**, char const*, void*) + 5086
32 clang             0x0000000100f6cdd8 main + 648
33 clang             0x0000000100f6cb44 start + 52
34 clang             0x0000000000000043 start + 18446744069398410547
Stack dump:
0. Program arguments: /usr/bin/clang -cc1 -triple x86_64-apple-macosx10.7.3 -emit-obj -disable-free -disable-llvm-verifier -main-file-name Distributions.cpp -pic-level 2 -mdisable-fp-elim -relaxed-aliasing -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 128.2 -coverage-file CMakeFiles/thor.dir/Distributions.cpp.o -resource-dir /usr/bin/../lib/clang/3.1 -D thor_EXPORTS -D THOR_EXPORTS -D AURORA_HAS_CPP11 -U __STRICT_ANSI__ -D NDEBUG -I /Users/nick/src/Thor/include -I /Users/nick/src/Thor/extlibs/aurora/include -I /usr/local/include -F/Library/Frameworks -fmodule-cache-path /var/folders/89/g_q7hkb564395stb6j4z3dlr0000gn/T/clang-module-cache -stdlib=libc++ -O3 -std=c++0x -fdeprecated-macro -fdebug-compilation-dir /Users/nick/src/Thor/nBuild/src -ferror-limit 19 -fmessage-length 170 -stack-protector 1 -fblocks -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-dispatch-method=mixed -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o CMakeFiles/thor.dir/Distributions.cpp.o -x c++ /Users/nick/src/Thor/src/Distributions.cpp
1. /Users/nick/src/Thor/include/Thor/Math/Distribution.hpp:68:41: current parser token ';'
2. /Users/nick/src/Thor/include/Thor/Math/Distribution.hpp:37:1: parsing namespace 'thor'
3. /Users/nick/src/Thor/include/Thor/Math/Distribution.hpp:48:1: parsing struct/union/class body 'Distribution'
4. /Users/nick/src/Thor/include/Thor/Math/Distribution.hpp:65:3: parsing function body 'Distribution<T>'
5. /Users/nick/src/Thor/include/Thor/Math/Distribution.hpp:65:3: in compound statement ('{}')
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
clang: note: diagnostic msg: Please submit a bug report to http://developer.apple.com/bugreporter/ and include command line arguments and all diagnostic information.
clang: note: diagnostic msg: Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/89/g_q7hkb564395stb6j4z3dlr0000gn/T/Distributions-m9S8I2.ii
clang: note: diagnostic msg: /var/folders/89/g_q7hkb564395stb6j4z3dlr0000gn/T/Distributions-m9S8I2.sh
make[2]: *** [src/CMakeFiles/thor.dir/Distributions.cpp.o] Error 254
make[1]: *** [src/CMakeFiles/thor.dir/all] Error 2
make: *** [all] Error 2


This is clang puking all over me, isn't it?





Here is the output of the makefile generation
Code: [Select]
The C compiler identification is GNU
The CXX compiler identification is Clang
Checking whether C compiler has -isysroot
Checking whether C compiler has -isysroot - yes
Checking whether C compiler supports OSX deployment target flag
Checking whether C compiler supports OSX deployment target flag - yes
Found SFML: /usr/local/include
Configuring done
Generating done

Here are the versions of clang and gcc
Code: [Select]
Nicholass-MacBook-Pro:~ nick$ clang --version
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.3.0
Thread model: posix

Nicholass-MacBook-Pro:~ nick$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
Copyright (C) 2007 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.

Nicholass-MacBook-Pro:~ nick$



Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: Thor 2.0 cmake build error OS X 10.7
« Reply #12 on: September 02, 2012, 10:36:43 pm »
I'm posting here because I'm having more or less the same issue as MonkeyKnight. I'm using the latest SFML and Thor sources from the Git repositories on OS X 10.8. I want to install Thor to use the BigTexture class.

I didn't get any issue with the CMake configuration (actually CMake didn't even tell me anything about some SFML*DIR variable), but it's failing at build time:
Code: [Select]
[  4%] Building CXX object src/CMakeFiles/thor.dir/Action.cpp.o
In file included from /Users/ceylo/Development/Thor/src/Action.cpp:26:
In file included from /Users/ceylo/Development/Thor/include/Thor/Events/Action.hpp:32:
In file included from /Users/ceylo/Development/Thor/include/Thor/Events/Detail/ActionOperations.hpp:32:
In file included from /Users/ceylo/Development/Thor/extlibs/aurora/include/Aurora/SmartPtr/CopiedPtr.hpp:32:
In file included from /Users/ceylo/Development/Thor/extlibs/aurora/include/Aurora/SmartPtr/PtrFunctors.hpp:32:
/Users/ceylo/Development/Thor/extlibs/aurora/include/Aurora/Tools/Metaprogramming.hpp:31:10: fatal error: 'type_traits' file not found
#include <type_traits>

To "fix" this I had to apply the following patch:
Code: [Select]
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d46f1ae..f617a7f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -72,9 +72,9 @@ endif()
 
 
 # C++11 support
-if(CMAKE_COMPILER_IS_GNUCXX)
-       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
-endif()
+#if(CMAKE_COMPILER_IS_GNUCXX)
+       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -stdlib=libc++")
+#endif()
 
 
 # Variable for install directory
Note that the default compiler on OS X is now Clang, which is why I also commented out the check for g++. CMake uses Clang unless it's asked not to.

However I get these errors now:
Code: [Select]
[ 40%] Building CXX object src/CMakeFiles/thor.dir/ConcaveShape.cpp.o
In file included from /Users/ceylo/Development/Thor/src/ConcaveShape.cpp:28:
In file included from /Users/ceylo/Development/Thor/include/Thor/Math/Triangulation.hpp:39:
/usr/bin/../lib/c++/v1/list:212:9: error: field has incomplete type 'thor::detail::AdvancedTriangle'
    _Tp __value_;
        ^
/usr/bin/../lib/c++/v1/type_traits:1889:54: note: in instantiation of template class 'std::__1::__list_node<thor::detail::AdvancedTriangle, void *>' requested here
decltype(_VSTD::move(_Tp(_VSTD::declval<_Args>()...)), true_type())
                                                     ^
/usr/bin/../lib/c++/v1/type_traits:1890:1: note: while substituting deduced template arguments into function template '__is_constructible_test' [with _Tp =
      std::__1::allocator<std::__1::__list_node<thor::detail::AdvancedTriangle, void *>>, _Args = <no value>]
__is_constructible_test(_Tp&&, _Args&& ...);
^
/usr/bin/../lib/c++/v1/type_traits:1949:14: note: in instantiation of template class 'std::__1::__is_constructible<false,
      std::__1::allocator<std::__1::__list_node<thor::detail::AdvancedTriangle, void *>>, std::__1::allocator<std::__1::__list_node<thor::detail::AdvancedTriangle, void *>>
      &&>' requested here
    : public __is_constructible<is_scalar<_Tp>::value || is_reference<_Tp>::value,
             ^
/usr/bin/../lib/c++/v1/type_traits:1975:14: note: in instantiation of template class 'std::__1::__is_constructible_void_check<false,
      std::__1::allocator<std::__1::__list_node<thor::detail::AdvancedTriangle, void *>>, std::__1::allocator<std::__1::__list_node<thor::detail::AdvancedTriangle, void *>>
      &&>' requested here
    : public __is_constructible_void_check<__contains_void<_Tp, _Args...>::value
             ^
/usr/bin/../lib/c++/v1/type_traits:2455:34: note: in instantiation of template class
      'std::__1::is_constructible<std::__1::allocator<std::__1::__list_node<thor::detail::AdvancedTriangle, void *>>,
      std::__1::allocator<std::__1::__list_node<thor::detail::AdvancedTriangle, void *>> &&>' requested here
    : __is_nothrow_constructible<is_constructible<_Tp, _Args...>::value, _Tp, _Args...>
                                 ^
/usr/bin/../lib/c++/v1/type_traits:2590:14: note: (skipping 1 context in backtrace; use -ftemplate-backtrace-limit=0 to see all)
    : public is_nothrow_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
             ^
/usr/bin/../lib/c++/v1/memory:2219:20: note: in instantiation of template class
      'std::__1::is_nothrow_move_constructible<std::__1::allocator<std::__1::__list_node<thor::detail::AdvancedTriangle, void *>>>' requested here
                   is_nothrow_move_constructible<_T2>::value)
                   ^
/usr/bin/../lib/c++/v1/__config:253:34: note: expanded from macro '_NOEXCEPT_'
#  define _NOEXCEPT_(x) noexcept(x)
                                 ^
/usr/bin/../lib/c++/v1/memory:2386:15: note: in instantiation of template class 'std::__1::__libcpp_compressed_pair_imp<unsigned long,
      std::__1::allocator<std::__1::__list_node<thor::detail::AdvancedTriangle, void *>>, 2>' requested here
    : private __libcpp_compressed_pair_imp<_T1, _T2>
              ^
/usr/bin/../lib/c++/v1/list:513:52: note: in instantiation of template class 'std::__1::__compressed_pair<unsigned long,
      std::__1::allocator<std::__1::__list_node<thor::detail::AdvancedTriangle, void *>>>' requested here
    __compressed_pair<size_type, __node_allocator> __size_alloc_;
                                                   ^
/usr/bin/../lib/c++/v1/list:770:15: note: in instantiation of template class 'std::__1::__list_imp<thor::detail::AdvancedTriangle,
      std::__1::allocator<thor::detail::AdvancedTriangle>>' requested here
    : private __list_imp<_Tp, _Alloc>
              ^
/Users/ceylo/Development/Thor/include/Thor/Math/Detail/Triangulation.inl:59:10: note: in instantiation of template class 'std::__1::list<thor::detail::AdvancedTriangle,
      std::__1::allocator<thor::detail::AdvancedTriangle>>' requested here
        typedef TriangleList::iterator                                                  TriangleIterator;
                ^
/Users/ceylo/Development/Thor/include/Thor/Math/Detail/Triangulation.inl:32:8: note: forward declaration of 'thor::detail::AdvancedTriangle'
        class AdvancedTriangle;
              ^
In file included from /Users/ceylo/Development/Thor/src/ConcaveShape.cpp:28:
In file included from /Users/ceylo/Development/Thor/include/Thor/Math/Triangulation.hpp:39:
/usr/bin/../lib/c++/v1/list:203:19: error: static_cast from 'std::__1::__list_node_base<thor::detail::AdvancedTriangle, void *> *' to 'pointer' (aka
      'std::__1::__list_node<thor::detail::AdvancedTriangle, void *> *') is not allowed
        : __prev_(static_cast<pointer>(this)),
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/c++/v1/list:529:5: note: in instantiation of member function 'std::__1::__list_node_base<thor::detail::AdvancedTriangle, void *>::__list_node_base'
      requested here
    __list_imp()
    ^
/usr/bin/../lib/c++/v1/list:795:5: note: in instantiation of member function 'std::__1::__list_imp<thor::detail::AdvancedTriangle,
      std::__1::allocator<thor::detail::AdvancedTriangle> >::__list_imp' requested here
    list()
    ^
/Users/ceylo/Development/Thor/include/Thor/Math/Detail/Triangulation.inl:399:16: note: in instantiation of member function 'std::__1::list<thor::detail::AdvancedTriangle,
      std::__1::allocator<thor::detail::AdvancedTriangle> >::list' requested here
                TriangleList    triangles;
                                ^
/Users/ceylo/Development/Thor/include/Thor/Math/Detail/Triangulation.inl:457:9: note: in instantiation of function template specialization
      'thor::detail::triangulateImpl<std::__1::__wrap_iter<const sf::Vector2<float> *>, thor::ConcaveShape::TriangleGenerator,
      thor::detail::PolygonOutputTrDetails<std::__1::back_insert_iterator<std::__1::vector<thor::Edge<const sf::Vector2<float>>, std::__1::allocator<thor::Edge<const
      sf::Vector2<float>>>>>, const sf::Vector2<float>> >' requested here
        return detail::triangulateImpl(verticesBegin, verticesEnd, trianglesOut,
               ^
/Users/ceylo/Development/Thor/src/ConcaveShape.cpp:241:2: note: in instantiation of function template specialization 'thor::triangulatePolygon<std::__1::__wrap_iter<const
      sf::Vector2<float> *>, thor::ConcaveShape::TriangleGenerator, std::__1::back_insert_iterator<std::__1::vector<thor::Edge<const sf::Vector2<float>>,
      std::__1::allocator<thor::Edge<const sf::Vector2<float>>>>> >' requested here
        triangulatePolygon(mPoints.begin(), mPoints.end(), TriangleGenerator(mTriangleShapes, mFillColor), std::back_inserter(mEdges));
        ^
In file included from /Users/ceylo/Development/Thor/src/ConcaveShape.cpp:28:
In file included from /Users/ceylo/Development/Thor/include/Thor/Math/Triangulation.hpp:39:
/usr/bin/../lib/c++/v1/list:204:19: error: static_cast from 'std::__1::__list_node_base<thor::detail::AdvancedTriangle, void *> *' to 'pointer' (aka
      'std::__1::__list_node<thor::detail::AdvancedTriangle, void *> *') is not allowed
          __next_(static_cast<pointer>(this))
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/c++/v1/list:678:30: error: static_cast from '__node_base *' (aka '__list_node_base<value_type, __void_pointer> *') to '__node_pointer' (aka
      'std::__1::__list_node<thor::detail::AdvancedTriangle, void *> *') is not allowed
        __node_pointer __l = static_cast<__node_pointer>(&__end_);
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/c++/v1/list:664:5: note: in instantiation of member function 'std::__1::__list_imp<thor::detail::AdvancedTriangle,
      std::__1::allocator<thor::detail::AdvancedTriangle> >::clear' requested here
    clear();
    ^
/usr/bin/../lib/c++/v1/list:769:23: note: in instantiation of member function 'std::__1::__list_imp<thor::detail::AdvancedTriangle,
      std::__1::allocator<thor::detail::AdvancedTriangle> >::~__list_imp' requested here
class _LIBCPP_VISIBLE list
                      ^
/Users/ceylo/Development/Thor/include/Thor/Math/Detail/Triangulation.inl:457:9: note: in instantiation of function template specialization
      'thor::detail::triangulateImpl<std::__1::__wrap_iter<const sf::Vector2<float> *>, thor::ConcaveShape::TriangleGenerator,
      thor::detail::PolygonOutputTrDetails<std::__1::back_insert_iterator<std::__1::vector<thor::Edge<const sf::Vector2<float>>, std::__1::allocator<thor::Edge<const
      sf::Vector2<float>>>>>, const sf::Vector2<float>> >' requested here
        return detail::triangulateImpl(verticesBegin, verticesEnd, trianglesOut,
               ^
/Users/ceylo/Development/Thor/src/ConcaveShape.cpp:241:2: note: in instantiation of function template specialization 'thor::triangulatePolygon<std::__1::__wrap_iter<const
      sf::Vector2<float> *>, thor::ConcaveShape::TriangleGenerator, std::__1::back_insert_iterator<std::__1::vector<thor::Edge<const sf::Vector2<float>>,
      std::__1::allocator<thor::Edge<const sf::Vector2<float>>>>> >' requested here
        triangulatePolygon(mPoints.begin(), mPoints.end(), TriangleGenerator(mTriangleShapes, mFillColor), std::back_inserter(mEdges));
        ^
In file included from /Users/ceylo/Development/Thor/src/ConcaveShape.cpp:28:
In file included from /Users/ceylo/Development/Thor/include/Thor/Math/Triangulation.hpp:39:
/usr/bin/../lib/c++/v1/list:561:25: error: static_cast from '__node_base *' (aka '__list_node_base<value_type, __void_pointer> *') to '__node_pointer' (aka
      'std::__1::__list_node<thor::detail::AdvancedTriangle, void *> *') is not allowed
        return iterator(static_cast<__node_pointer>(&__end_));
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/c++/v1/list:866:59: note: in instantiation of member function 'std::__1::__list_imp<thor::detail::AdvancedTriangle,
      std::__1::allocator<thor::detail::AdvancedTriangle> >::end' requested here
          iterator end() _NOEXCEPT          {return base::end();}
                                                          ^
/Users/ceylo/Development/Thor/include/Thor/Math/Detail/Triangulation.inl:421:70: note: in instantiation of member function 'std::__1::list<thor::detail::AdvancedTriangle,
      std::__1::allocator<thor::detail::AdvancedTriangle> >::end' requested here
                return transformTriangles<UserVertex>(triangles.begin(), triangles.end(), trianglesOut);
                                                                                   ^
/Users/ceylo/Development/Thor/include/Thor/Math/Detail/Triangulation.inl:457:9: note: in instantiation of function template specialization
      'thor::detail::triangulateImpl<std::__1::__wrap_iter<const sf::Vector2<float> *>, thor::ConcaveShape::TriangleGenerator,
      thor::detail::PolygonOutputTrDetails<std::__1::back_insert_iterator<std::__1::vector<thor::Edge<const sf::Vector2<float>>, std::__1::allocator<thor::Edge<const
      sf::Vector2<float>>>>>, const sf::Vector2<float>> >' requested here
        return detail::triangulateImpl(verticesBegin, verticesEnd, trianglesOut,
               ^
/Users/ceylo/Development/Thor/src/ConcaveShape.cpp:241:2: note: in instantiation of function template specialization 'thor::triangulatePolygon<std::__1::__wrap_iter<const
      sf::Vector2<float> *>, thor::ConcaveShape::TriangleGenerator, std::__1::back_insert_iterator<std::__1::vector<thor::Edge<const sf::Vector2<float>>,
      std::__1::allocator<thor::Edge<const sf::Vector2<float>>>>> >' requested here
        triangulatePolygon(mPoints.begin(), mPoints.end(), TriangleGenerator(mTriangleShapes, mFillColor), std::back_inserter(mEdges));
        ^
5 errors generated.
make[2]: *** [src/CMakeFiles/thor.dir/ConcaveShape.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/thor.dir/all] Error 2
make: *** [all] Error 2

I don't know if this could help but here is the C++11 support status for Clang: http://clang.llvm.org/cxx_status.html
And `clang -v` outputs the following:
Code: [Select]
Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin12.1.0
Thread model: posix

I'd grateful if anyone knew how to fix this or if it should be fixed in Thor's sources.
Thanks!

Ceylo
Want to play movies in your SFML application? Check out sfeMovie!

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Thor 2.0 cmake build error OS X 10.7
« Reply #13 on: September 02, 2012, 11:44:18 pm »
I haven't ever tested Thor with Clang, I'm not even sure if it can be installed easily on Windows. Can you tell me more about the CMake flag -stdlib=libc++ you added? Is it Clang-specific?

Concerning the other error message, it looks like std::list<thor::detail::AdvancedTriangle> is used with an undefined AdvancedTriangle. The file Triangulation.inl refers to this type as follows:
class AdvancedTriangle;                            //  (32) incomplete type, declaration
typedef std::list<AdvancedTriangle> TriangleList;  //  (55) incomplete, maybe problematic
typedef TriangleList::iterator TriangleIterator;   //  (59) incomplete, maybe problematic
class THOR_API AdvancedTriangle ... { ... };       // (134) class definition

Okay, apparently the old standard completely forbids incomplete types in the STL:
Quote from: C++ standard 2003, §17.4.3.6/2
In particular, the effects are undefined [...] if an incomplete type (3.9) is used as a template argument when instantiating a template component.

The new standard however contains an interesting change:
Quote from: C++ FDIS 2011 (n3290), §17.6.4.8/2
In particular, the effects are undefined [...] if an incomplete type (3.9) is used as a template argument when instantiating a template component, unless specifically allowed for that component.
So, further research is necessary :D

Reordering dependencies in Thor's source might be quite difficult, maybe I have to introduce other classes just to workaround that... :-\
« Last Edit: September 03, 2012, 12:05:45 am by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: Thor 2.0 cmake build error OS X 10.7
« Reply #14 on: September 03, 2012, 12:23:15 am »
I added the flag after reading this: http://stackoverflow.com/questions/9345271/xcode-4-3-and-c11-include-paths
Which I found after searching for the "fatal error: 'type_traits' file not found" error message.

And GCC isn't a better option here as the one provided with Apple development tools is GCC 4.2, which doesn't even recognize the -std=c++0x and -stdlib=libc++ parameters. I could build the latest GCC but this isn't a easy solution for OS X users.

As for running Clang on Windows, I don't think it's easy at the moment. The best you could do if you want to test it yourself is running it with Linux.
Want to play movies in your SFML application? Check out sfeMovie!