Hi, I'm trying to run some of the example code that comes with Thor 2.0 on Mac OS 10.10.5. I've gone through the Cmake install tutorial, and I'm pretty sure I have it installed correctly.
Problem is when I go to compile a sample program I run into problems.
I've tried g++ and clang++ with different flags, all with no success.
For example:
clang++ -std=c++11 -stdlib=libc++ Action.cpp -lsfml-window gives a long error message:
- Undefined symbols for architecture x86_64:
"sf::String::String(char const*, std::__1::locale const&)", referenced from:
_main in Action-8f94e3.o
"thor::Connection::Connection(std::__1::weak_ptr<thor::detail::AbstractConnectionImpl>)", referenced from:
thor::detail::Listener<thor::ActionContext<MyAction> const&>::shareConnection() const in Action-8f94e3.o
"thor::Action::Action(sf::Event::EventType)", referenced from:
_main in Action-8f94e3.o
"thor::Action::Action(sf::Mouse::Button, thor::Action::ActionType)", referenced from:
_main in Action-8f94e3.o
"thor::Action::Action(sf::Keyboard::Key, thor::Action::ActionType)", referenced from:
_main in Action-8f94e3.o
"thor::Action::Action(thor::JoystickAxis)", referenced from:
_main in Action-8f94e3.o
"thor::Action::Action(thor::JoystickButton, thor::Action::ActionType)", referenced from:
_main in Action-8f94e3.o
"thor::Action::Action()", referenced from:
std::__1::map<MyAction, thor::Action, std::__1::less<MyAction>, std::__1::allocator<std::__1::pair<MyAction const, thor::Action> > >::__construct_node_with_key(MyAction const&) in Action-8f94e3.o
"thor::detail::EventBuffer::pollEvents(sf::Window&)", referenced from:
thor::ActionMap<MyAction>::update(sf::Window&) in Action-8f94e3.o
"thor::detail::EventBuffer::clearEvents()", referenced from:
thor::ActionMap<MyAction>::update(sf::Window&) in Action-8f94e3.o
"thor::detail::EventBuffer::EventBuffer()", referenced from:
thor::ActionMap<MyAction>::ActionMap() in Action-8f94e3.o
"thor::detail::ActionResult::ActionResult()", referenced from:
thor::ActionMap<MyAction>::invokeCallbacks(thor::EventSystem<thor::ActionContext<MyAction>, MyAction>&, sf::Window*) const in Action-8f94e3.o
"thor::detail::JoystickBuilder::Axis::above(float)", referenced from:
_main in Action-8f94e3.o
"thor::detail::JoystickBuilder::Axis::below(float)", referenced from:
_main in Action-8f94e3.o
"thor::detail::JoystickBuilder::axis(sf::Joystick::Axis)", referenced from:
_main in Action-8f94e3.o
"thor::detail::JoystickBuilder::button(unsigned int)", referenced from:
_main in Action-8f94e3.o
"thor::joystick(unsigned int)", referenced from:
_main in Action-8f94e3.o
"thor::operator&&(thor::Action const&, thor::Action const&)", referenced from:
_main in Action-8f94e3.o
"thor::operator||(thor::Action const&, thor::Action const&)", referenced from:
_main in Action-8f94e3.o
"thor::Action::isActive(thor::detail::EventBuffer const&) const", referenced from:
thor::ActionMap<MyAction>::isActive(MyAction const&) const in Action-8f94e3.o
"thor::Action::isActive(thor::detail::EventBuffer const&, thor::detail::ActionResult&) const", referenced from:
thor::ActionMap<MyAction>::invokeCallbacks(thor::EventSystem<thor::ActionContext<MyAction>, MyAction>&, sf::Window*) const in Action-8f94e3.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've tried other flags with clang++ and g++, but all combinations I have tried have resulted in some some aspect of C++ Language not beeing found or recognized(e.g. type_traits not found)
Is clang++ -std=c++11 -stdlib=libc++ the proper compile method for mac?
How do I fix this?
Thanks
Oh, and my version of clang:
clang++ -v
Apple LLVM version 7.0.0 (clang-700.1.76)
Target: x86_64-apple-darwin14.5.0
Thread model: posix