SFML community forums

Help => General => Topic started by: MarcuzPwnz on July 30, 2013, 07:53:00 am

Title: 'string' file not found.
Post 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.
Title: Re: 'string' file not found.
Post by: Laurent on July 30, 2013, 08:31:18 am
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>?
Title: Re: 'string' file not found.
Post by: MarcuzPwnz on July 30, 2013, 08:53:36 am
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. :)
Title: Re: 'string' file not found.
Post by: Hiura on July 30, 2013, 08:56:58 am
Do you have a custom version of clang installed on your system? (I had this issue yesterday.)
Title: Re: 'string' file not found.
Post by: MarcuzPwnz on July 30, 2013, 08:58:12 am
I'm using the default compiler supplied with the installation of Xcode from the app store. :)
Title: Re: 'string' file not found.
Post by: Hiura on July 30, 2013, 09:01:06 am
so when you run which clang in a terminal you get /usr/bin/clang, right? (just to make sure)
Title: Re: 'string' file not found.
Post by: MarcuzPwnz on July 30, 2013, 09:02:52 am
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?
Title: Re: 'string' file not found.
Post by: Hiura on July 30, 2013, 09:17:06 am
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)
Title: Re: 'string' file not found.
Post by: MarcuzPwnz on July 30, 2013, 09:21:57 am
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)
Title: Re: 'string' file not found.
Post by: MarcuzPwnz on July 31, 2013, 12:44:02 pm
Does anybody have an idea or solution as to what may be causing this issue or how to fix it? :)
Title: Re: 'string' file not found.
Post by: zsbzsb on July 31, 2013, 01:05:42 pm
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...
Quote
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.
Title: Re: 'string' file not found.
Post by: Hiura on July 31, 2013, 01:07:31 pm
It's in red. But people don't read red, apparently.. http://www.sfml-dev.org/tutorials/2.1/start-osx.php
Title: Re: 'string' file not found.
Post by: MarcuzPwnz on August 01, 2013, 05:32:26 am
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.