Search code examples
macosg++sfml

Compiling minimal project with SFML 2.1 on mac os x


I'm trying to compile minimal project with SFML on mac os x. I'm using the following command:

g++ -o rj -framework SFML -lsfml-graphics -lsfml-audio -lsfml-window -lsfml-system main.cpp

with following code:

# include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "test");
    return 0;
}

and getting an error:

Undefined symbols for architecture x86_64:
  "sf::String::String(char const*, std::__1::locale const&)", referenced from:
  _main in main-15430b.o
ld: symbol(s) not found for architecture x86_64

What am i doing wrong?


Solution

  • The problem solved by installing the clang version of library.