SFML community forums
Help => General => Topic started by: MarcuzPwnz on July 30, 2013, 07:53:00 am
-
Hey there SFML community, it's been a while since I've made a thread here and during this time of absence I've obtained a new computer which I'm having trouble setting up so I can develop in C++ using SFML.
Like usual, I feel ridiculous asking questions because I know they're simple yet I can't figure them out (being a noob at this stuff and all)
So basically my problem is that when I compile the default SFML 2.1 project I get an error "'string' file not found" and I'm not even able to #include <iostream> without getting a similar error. I'm using a Mac running the latest version of Mac OSX and I have the latest Xcode installed yet it seems like I'm not even able to compile basic C++ programs, help? :)
Thanks,
MarcuzPwnz.
-
Make sure that your file is compiled as C++, not as C (most IDEs deduce the language from the file extension).
Are you able to include C headers, like <stdio.h>?
-
I would assume I'm compiling as C++ as I'm using a .cpp file and my language settings on the IDE look like this (http://i.imgur.com/AzBqrj9.png)
And I am unable to include <stdio.h> also.
Thank you for the reply. :)
-
Do you have a custom version of clang installed on your system? (I had this issue yesterday.)
-
I'm using the default compiler supplied with the installation of Xcode from the app store. :)
-
so when you run which clang in a terminal you get /usr/bin/clang, right? (just to make sure)
-
I can't even run clang as a command in terminal, this is obviously a problem.
Is is possible Xcode didn't even install a compiler?
-
I'm not 100% sure that the issue but you can try installing the CLT. See this SO (http://stackoverflow.com/questions/9329243/xcode-4-4-command-line-tools)
-
I just managed to compile a basic command line application using Xcode so I'm assuming that's not the issue. :P
Just clicked your link, I do remember installing the CLT on my last Macbook, I'll give this a try now, thanks. :)
Edit: Installed and now I'm getting the following Apple Mach-O-Linker errors.
(http://i.imgur.com/hfd7Yht.png)
-
Does anybody have an idea or solution as to what may be causing this issue or how to fix it? :)
-
Does anybody have an idea or solution as to what may be causing this issue or how to fix it? :)
For starters, what about try reading what your error is? The very first error in your list is...
Directory not found for option '-L/usr/local/lib'
That means your linker can not find your lib folder, so that would be something to check that your have the correct path in there to the SFML libraries.
-
It's in red. But people don't read red, apparently.. http://www.sfml-dev.org/tutorials/2.1/start-osx.php
-
Managed to fix it, thank you for pointing me in the right direction and I apologise for being troublesome and not reading through everything as I should have first.