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

Author Topic: Using SFML with mac OS 10.6.8 and g++  (Read 1512 times)

0 Members and 1 Guest are viewing this topic.

matz

  • Newbie
  • *
  • Posts: 1
    • View Profile
Using SFML with mac OS 10.6.8 and g++
« on: March 01, 2013, 10:32:31 pm »
I'm trying to get SFML (64 bit) to work with g++ on my mac running 10.6.8. I'm avoiding xCode for a few reasons, first and foremost being I can't use c++11 with the current version of xcode on my mac (and I would have to play to upgrade, ugh).

That being said, I can't seem to figure out the process of installation/what to include on the command line in order to compile with g++. I tried following the normal 64 bit mac instructions for xcode, but after installing and using the following in g++:

g++ test.cpp -o test -framework sfml-window -framework sfml-graphics -framework sfml-system

I get:

Undefined symbols for architecture x86_64:
  "sf::Clock::GetElapsedTime() const", referenced from:
      _main in cc1VO6E6.o
  "sf::Sleep(float)", referenced from:
      _main in cc1VO6E6.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

Has anyone had problems like this? I installed using the guide for xcode installation, but it doesn't seem like this would cause such an error. Suggestions?

EDIT: In case it is relevant, my code is just the example:

#include <SFML/System.hpp>
#include <iostream>

int main(){
        sf::Clock Clock;
        while(Clock.GetElapsedTime() < 5.f){
                std::cout << Clock.GetElapsedTime() << std::endl;
                sf::Sleep(0.5f);
        }
        return 0;
}
« Last Edit: March 01, 2013, 10:42:34 pm by matz »

MarcuzPwnz

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Re: Using SFML with mac OS 10.6.8 and g++
« Reply #1 on: March 02, 2013, 05:23:47 am »
You can get the latest version of Xcode from the Mac app store for free.

It runs C++11 perfectly fine. :)

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Using SFML with mac OS 10.6.8 and g++
« Reply #2 on: March 02, 2013, 05:05:20 pm »
@MarcuzPwnz: I don't think the latest version of Xcode are available for 10.6 -> no C++11 support from Apple on this "old" system.


@matz: make sure your headers and binary match the same version of SFML. And upgrade to SFML 2.0, because 1.6 is sooo dead. (FAQ)
SFML / OS X developer

 

anything