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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Sir_Rai

Pages: [1]
1
General / Re: OSx Yosemite: x86_64 symbols problem
« on: December 28, 2014, 04:10:02 pm »
omg it was the problem! <Facepalm> Thank you Hiura  :)

2
General / [Solved] OSx Yosemite: x86_64 symbols problem
« on: December 28, 2014, 09:09:12 am »
I'm using OSx Yosemite (10.10.1) with x86_64 architecture. I just cloned the sfml project from github and compiled it successfully, even the examples provided in the repo. But when I try to compile the tutorial test with the green circle:

(click to show/hide)


I have this error:
Code: [Select]
$ clang++ main.cpp -lsfml-graphics                         
Undefined symbols for architecture x86_64:
  "sf::String::String(char const*, std::__1::locale const&)", referenced from:
      _main in main-16f53e.o
  "sf::Window::close()", referenced from:
      _main in main-16f53e.o
  "sf::Window::display()", referenced from:
      _main in main-16f53e.o
  "sf::Window::pollEvent(sf::Event&)", referenced from:
      _main in main-16f53e.o
  "sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)", referenced from:
      _main in main-16f53e.o
  "sf::Window::isOpen() const", referenced from:
      _main in main-16f53e.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 used ccmake to build SFML with shared libraries (not the framework thing). Following the tutorial I use clang and the c++11 libs. For the architecture I have placed "i386;x86_64" this is the CMakeCache generated and the configuration. (This is a bit long click spoiler to see)

(click to show/hide)

Checking the libs in /usr/local/lib with file command I see every lib from SFML is universal. Here the output for libsfml-graphics lib:

$ file libsfml-graphics.dylib                  
libsfml-graphics.dylib: Mach-O universal binary with 2 architectures
libsfml-graphics.dylib (for architecture i386): Mach-O dynamically linked shared library i386
libsfml-graphics.dylib (for architecture x86_64):       Mach-O 64-bit dynamically linked shared library x86_64


my clang version:
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix

I have read multiples posts and googling during hours reading about this issue, most of them related with a wrong configuration in cmake or a bad sfml version download. Most people on osx are using xcode (Im not) and the framework solution, but I want to build just shared libs. I'm doing something wrong? I'm new using clang maybe I'm not compiling the main in a proper way. I've tried compiling using  "-std=c++11" "-stdlib=libc++" as arguments with the same results. Any idea guys?


Pages: [1]