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

Author Topic: Thor make error - Undefined symbols. (Mac)  (Read 2658 times)

0 Members and 1 Guest are viewing this topic.

ripps

  • Newbie
  • *
  • Posts: 10
    • View Profile
Thor make error - Undefined symbols. (Mac)
« on: October 22, 2014, 11:38:09 pm »
Hi

Been struggling through with this for couple of nights, forum searches and googles got me through a couple of previous issues but no joy with this one.

I've downloaded SFML and Thor, both the latest from Github.

Built and installed SFML with Cmake.

Generated Thor Makefile with Cmake.

My issue is when i run make in Terminal I receive the below error.

Code: [Select]
Linking CXX shared library libthor.dylib
Undefined symbols for architecture x86_64:
  "sf::Image::~Image()", referenced from:
      thor::BigTexture::loadFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in BigTexture.cpp.o
      thor::BigTexture::loadFromMemory(void const*, unsigned long) in BigTexture.cpp.o
      thor::BigTexture::loadFromStream(sf::InputStream&) in BigTexture.cpp.o
  "sf::operator/(sf::Time, sf::Time)", referenced from:
      thor::getElapsedRatio(thor::Particle const&) in Particle.cpp.o
      thor::getRemainingRatio(thor::Particle const&) in Particle.cpp.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]: *** [src/libthor.dylib] Error 1
make[1]: *** [src/CMakeFiles/thor.dir/all] Error 2
make: *** [all] Error 2

I've completely started the whole process a couple of times, I've read the installation tutorial and *pretty* sure I understand it. The note on Thors download page that says the development version is not compatible with sfml 2.1 confused me slightly as I had seen other places that the sfml and thor github versions should work.

Any help would be appretiated.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Thor make error - Undefined symbols. (Mac)
« Reply #1 on: October 23, 2014, 04:46:42 pm »
https://github.com/SFML/SFML/commit/6cf30e175111b3299a3cd03f229a79cdfb7553f3 introduced sf::operator/(sf::Time, sf::Time) but this was after the 2.1 release. You probably need to download the lastest source of SFML from github.

Also, make sure you have properly set up your compiler to use the correct stdlib. SFML, Thor and your project should all use the same one.
SFML / OS X developer

ripps

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Thor make error - Undefined symbols. (Mac)
« Reply #2 on: October 23, 2014, 09:44:27 pm »
Also, make sure you have properly set up your compiler to use the correct stdlib. SFML, Thor and your project should all use the same one.

This was it. Thanks.

Although Thor now builds to 100% but *just* fails with the same error but for the below

Code: [Select]
[ 96%] Building CXX object src/CMakeFiles/thor.dir/Trigonometry.cpp.o
[100%] Building CXX object src/CMakeFiles/thor.dir/UniformAccess.cpp.o
Linking CXX shared library libthor.dylib
Undefined symbols for architecture x86_64:
  "sf::Image::loadFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      thor::BigTexture::loadFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in BigTexture.cpp.o

***so close*** ;D

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Thor make error - Undefined symbols. (Mac)
« Reply #3 on: October 23, 2014, 09:54:46 pm »
Looks like SFML is not linked... Make sure you really use the newest version, clean and redownload if necessary. Also follow the installation steps of SFML and Thor tutorials exactly (especially concerning the make install command)!

I'm not sure whether there is something particular to consider for OS X...
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

ripps

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Thor make error - Undefined symbols. (Mac)
« Reply #4 on: October 23, 2014, 10:13:13 pm »
hey, just as you replied i fixed it.

Quick summary of what I did for anybody else who gets these issues;

build and install sfml with the c++11 features enabled (included in tutorial)

when configuring thor in cmake add THOR_CLANG_STDLIB = libc++ uncheck THOR_SHARED_LIBS.

for me, when i unchecked the shared libs option i had to set GLEW_LIBRARY and JPEG_LIBRARY manually. These were both found in the SFML-master/extlibs/libs-osx/lib/ folder.

Thank for the input Hiura and Nexus and hope the above helps people in future.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Thor make error - Undefined symbols. (Mac)
« Reply #5 on: October 23, 2014, 10:16:47 pm »
It's a compiler setting mismatch. You can find plenty of similar errors on this forum.

But you should be able to create dylib...
SFML / OS X developer

 

anything