[[ SOLVED ]]
SOLUTION -- Wiped drive and reinstalled Mavericks.
So I followed the wonderfully detailed installation instructions given by this site to install SFML on Mac OSX in XCode, but when I got to the point of initiating the build, XCode gave me 5 errors that read like this:
clang: error: unknown argument: '-frameworksfml-<thing>' [-Wunused-command-line-argument-hard-error-in-future]
Where "thing" is system, window, graphics, audio, and network. I've tried re-installing it a couple of times and double checking things. I've tried using the XCode templates. I've tried installing the source. I've also tried using this installation tutorial instead:
http://www.mjbshaw.com/2013/02/building-sfml-2-with-c11-on-os-x.html but still I get the same errors. I've also tried to use this workaround used for similar errors described at
https://github.com/romanbsd/fast-stemmer/issues/9 to no avail. There's been some other minor things I've done but I can't seem to get these errors fixed. It's all become a painful headache that's lasted for four days.
I'm totally at a loss and could really use some help here.
Thanks
-- So I did some more stuff that didn't work. I tried to compile the sample program from the templates using the terminal.
The exact command I executed was:
g++ -o prog main.cpp -lsfml-system -lsfml-graphics -lsfml-window -lsfml-audio -lsfml-network
It gave these errors:
Undefined symbols for architecture x86_64:
"resourcePath()", referenced from:
_main in main-744f91.o
"sf::Font::loadFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
_main in main-744f91.o
"sf::Image::loadFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
_main in main-744f91.o
"sf::Music::openFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
_main in main-744f91.o
"sf::String::String(char const*, std::__1::locale const&)", referenced from:
_main in main-744f91.o
"sf::Texture::loadFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, sf::Rect<int> const&)", referenced from:
_main in main-744f91.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
And with the -v option tagged on the end:
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.9.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name main.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 236.3 -v -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.1 -stdlib=libc++ -fdeprecated-macro -fdebug-compilation-dir /Users/xCodemonkey/prog/code/c++/SFML -ferror-limit 19 -fmessage-length 95 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.9.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o /var/folders/p0/lsbwztmd4ml308ccw6r_qzbm0000gn/T/main-c75fc8.o -x c++ main.cpp
clang -cc1 version 5.1 based upon LLVM 3.4svn default target x86_64-apple-darwin13.1.0
ignoring nonexistent directory "/usr/include/c++/v1"
#include "..." search starts here:
#include <...> search starts here:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1
/usr/local/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.1/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
End of search list.
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.9.0 -o prog /var/folders/p0/lsbwztmd4ml308ccw6r_qzbm0000gn/T/main-c75fc8.o -lsfml-system -lsfml-graphics -lsfml-audio -lsfml-network -lsfml-window -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a
Undefined symbols for architecture x86_64:
"resourcePath()", referenced from:
_main in main-c75fc8.o
"sf::Font::loadFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
_main in main-c75fc8.o
"sf::Image::loadFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
_main in main-c75fc8.o
"sf::Music::openFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
_main in main-c75fc8.o
"sf::String::String(char const*, std::__1::locale const&)", referenced from:
_main in main-c75fc8.o
"sf::Texture::loadFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, sf::Rect<int> const&)", referenced from:
_main in main-c75fc8.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here's the sample code just in case it's useful in some way:
ResourcePath.mm
#include "ResourcePath.hpp"
#import <Foundation/Foundation.h>
////////////////////////////////////////////////////////////
std::string resourcePath(void)
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
std::string rpath;
NSBundle* bundle = [NSBundle mainBundle];
if (bundle == nil) {
#ifdef DEBUG
NSLog(@"bundle is nil... thus no resources path can be found.");
#endif
} else {
NSString* path = [bundle resourcePath];
rpath = [path UTF8String] + std::string("/");
}
[pool drain];
return rpath;
}
ResourcePath.hpp
#ifndef RESOURCE_PATH_HPP
#define RESOURCE_PATH_HPP
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <string>
////////////////////////////////////////////////////////////
/// \brief Return the path to the resource folder.
///
/// \return The path to the resource folder associate
/// with the main bundle or an empty string is there is no bundle.
///
////////////////////////////////////////////////////////////
std::string resourcePath(void);
#endif
main.cpp
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
// Here is a small helper for you ! Have a look.
#include "ResourcePath.hpp"
int main(int, char const**)
{
// Create the main window
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
// Set the Icon
sf::Image icon;
if (!icon.loadFromFile(resourcePath() + "icon.png")) {
return EXIT_FAILURE;
}
window.setIcon(icon.getSize().x, icon.getSize().y, icon.getPixelsPtr());
// Load a sprite to display
sf::Texture texture;
if (!texture.loadFromFile(resourcePath() + "cute_image.jpg")) {
return EXIT_FAILURE;
}
sf::Sprite sprite(texture);
// Create a graphical text to display
sf::Font font;
if (!font.loadFromFile(resourcePath() + "sansation.ttf")) {
return EXIT_FAILURE;
}
sf::Text text("Hello SFML", font, 50);
text.setColor(sf::Color::Black);
// Load a music to play
sf::Music music;
if (!music.openFromFile(resourcePath() + "nice_music.ogg")) {
return EXIT_FAILURE;
}
// Play the music
music.play();
// Start the game loop
while (window.isOpen())
{
// Process events
sf::Event event;
while (window.pollEvent(event))
{
// Close window : exit
if (event.type == sf::Event::Closed) {
window.close();
}
// Espace pressed : exit
if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape) {
window.close();
}
}
// Clear screen
window.clear();
// Draw the sprite
window.draw(sprite);
// Draw the string
window.draw(text);
// Update the window
window.display();
}
return EXIT_SUCCESS;
}