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

Author Topic: Another Mac Issue[SOLVED]  (Read 3081 times)

0 Members and 1 Guest are viewing this topic.

Ricky

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
    • Tejada
    • Email
Another Mac Issue[SOLVED]
« on: February 21, 2013, 04:35:26 pm »
Hello again,

I'm not able to build anything from Xcode  :D
I am using Xcode 4.5 and I built SFML using cmake unix makefiles
Did sudo make install in terminal, built SFML and copied it into directories.

Ok this is all well and good, example programs run just fine.

I open Xcode and make a new project; select SFML app as the template and that gets the skeleton program infront of me. Problem is I can't build it. The headers are located and the program will compile. The specific problem is it will not link.

I'm using the default compiler is Apple LLVM 4.1 and the standard lib. C++98 with Clang and libstdc++. SFML binaries is set to link the framework.

This is the output I get when I build
Quote
ld: warning: ld: warning: ignoring file /Library/Frameworks/sfml-graphics.framework/sfml-graphics, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /Library/Frameworks/sfml-graphics.framework/sfml-graphicsignoring file /Library/Frameworks/sfml-window.framework/sfml-window, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /Library/Frameworks/sfml-window.framework/sfml-window

ld: warning: ignoring file /Library/Frameworks/sfml-audio.framework/sfml-audio, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /Library/Frameworks/sfml-audio.framework/sfml-audio

ld: warning: ignoring file /Library/Frameworks/sfml-network.framework/sfml-network, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /Library/Frameworks/sfml-network.framework/sfml-network

ld: warning: ignoring file /Library/Frameworks/sfml-system.framework/sfml-system, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /Library/Frameworks/sfml-system.framework/sfml-system
After it ignores the frameworks I get a whole bunch of undefined references.

Any ideas? Thanks guys, I've been really trying hard to figure it out myself but I'm at my wits end  :D

-edit-

When I switch the architecture from "Standard (32/64-bit Intel) to Native I get a different set of errors but I only get 8

Quote
(null): -Wuninitialized is not supported without -O
  "_NSLog", referenced from:

  "_OBJC_CLASS_$_NSAutoreleasePool", referenced from:

  "_OBJC_CLASS_$_NSBundle", referenced from:

  "sf::RenderWindow::RenderWindow(sf::VideoMode, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, sf::ContextSettings const&)", referenced from:

  "___CFConstantStringClassReference", referenced from:

  "_objc_msgSend", referenced from:

  "_objc_msgSend_fixup", referenced from:

-edit-

Issue solved. I'll be uploading snapshots of the steps I took to resolve the issues to help others.
Thanks again guys!
« Last Edit: February 22, 2013, 03:51:45 pm by Ricky »
Wilt thou yet say before him that slayeth thee, I am God? but thou shalt be a man, and no God, in the hand of him that slayeth thee.

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: Another Mac Issue
« Reply #1 on: February 21, 2013, 04:59:00 pm »
I made a video on getting it SFML built and installed for mac:
http://www.youtube.com/watch?v=OyUb8bDP2mw&feature=youtu.be

Ricky

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
    • Tejada
    • Email
Re: Another Mac Issue
« Reply #2 on: February 21, 2013, 06:09:35 pm »
I made a video on getting it SFML built and installed for mac:
http://www.youtube.com/watch?v=OyUb8bDP2mw&feature=youtu.be
I followed the tutorial to the letter and I got nothing. Same errors are coming up. Thanks for giving me something at least :)

-edit-

I tried rebuilding with default Xcode settings and now the only linking errors I get are
Quote
  "sf::Font::loadFromFile(std::string const&)", referenced from:

  "sf::Image::loadFromFile(std::string const&)", referenced from:

  "sf::Music::openFromFile(std::string const&)", referenced from:

  "sf::String::String(char const*, std::locale const&)", referenced from:

  "sf::Texture::loadFromFile(std::string const&, sf::Rect<int> const&)", referenced from:

clang: error: linker command failed with exit code 1 (use -v to see invocation)

« Last Edit: February 21, 2013, 06:15:06 pm by Ricky »
Wilt thou yet say before him that slayeth thee, I am God? but thou shalt be a man, and no God, in the hand of him that slayeth thee.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Another Mac Issue
« Reply #3 on: February 22, 2013, 10:30:43 am »
I guess you're linking you app against libstdc++ but you build SFML with libc++ (or vice versa). The C++ lib must be an exact match or you'll get those errors.
SFML / OS X developer

Ricky

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
    • Tejada
    • Email
Re: Another Mac Issue
« Reply #4 on: February 22, 2013, 03:45:16 pm »
I guess you're linking you app against libstdc++ but you build SFML with libc++ (or vice versa). The C++ lib must be an exact match or you'll get those errors.
You are right! That did the trick, Thanks again Hiura :)
Wilt thou yet say before him that slayeth thee, I am God? but thou shalt be a man, and no God, in the hand of him that slayeth thee.