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

Author Topic: Mac OS X 10.6.8 SFML 2.0  (Read 7564 times)

0 Members and 1 Guest are viewing this topic.

Jeffrey

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Mac OS X 10.6.8 SFML 2.0
« Reply #15 on: July 22, 2012, 11:36:46 pm »
Code Blocks seems to get crashy by itself. It can't quit, it always force me to force quit. It doesn't save projects settings and linker settings, and can't save files. Sometimes even the main.cpp file generated disappear or gets deleted and when you are ready to save it says "main.cpp file does not longer exists".
I re downloaded and re installed Code Blocks but nothing changed.

I'm really sorry, I know I'm changing things too often, but I don't feel to be too stable with that IDE, so I'd like to move to Netbeans. I tried it and it seems to work fine with normal setting. It also has makefile which may simplify things. Could you please tell me how to set SFML up (2.0 if possible) on that? Considering that I've already run the installer for 2.0?

Also please note that after the installation of 2.0 in /Developer/usr/local/ there's just one folder: bin/; there's no include/ nor lib/.
« Last Edit: July 22, 2012, 11:47:07 pm by Jeffrey »

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Mac OS X 10.6.8 SFML 2.0
« Reply #16 on: July 23, 2012, 10:56:26 am »
Now I get:


Quote
-------------- Build: Debug in Test ---------------

Compiling: main.cpp
/Users/Jeffrey/Desktop/TestProject/Test/main.cpp: In function 'int main()':
/Users/Jeffrey/Desktop/TestProject/Test/main.cpp:6: error: 'Text' is not a member of 'sf'
/Users/Jeffrey/Desktop/TestProject/Test/main.cpp:6: error: expected `;' before 'text'
/Users/Jeffrey/Desktop/TestProject/Test/main.cpp:8: error: 'class sf::RenderWindow' has no member named 'isOpen'
/Users/Jeffrey/Desktop/TestProject/Test/main.cpp:11: error: 'class sf::RenderWindow' has no member named 'pollEvent'
/Users/Jeffrey/Desktop/TestProject/Test/main.cpp:13: error: 'class sf::Event' has no member named 'type'
/Users/Jeffrey/Desktop/TestProject/Test/main.cpp:14: error: 'class sf::RenderWindow' has no member named 'close'
/Users/Jeffrey/Desktop/TestProject/Test/main.cpp:17: error: 'class sf::RenderWindow' has no member named 'clear'
/Users/Jeffrey/Desktop/TestProject/Test/main.cpp:18: error: 'class sf::RenderWindow' has no member named 'draw'
/Users/Jeffrey/Desktop/TestProject/Test/main.cpp:18: error: 'text' was not declared in this scope
/Users/Jeffrey/Desktop/TestProject/Test/main.cpp:19: error: 'class sf::RenderWindow' has no member named 'display'
Just an idea, not sure about it, but did you uninstall SFML 1.6 before installing 2.0 RC ? Maybe the installer didn't override the old headers. Can you confirme this by showing me what prints the following command in a Terminal ?
perl -ne 'BEGIN { $found = 0; print "\n\n\n"; } END { if ($found == 0) { print "SFML 1.x\n\n\n"; } else { print "SFML 2.x\n\n\n"; } } $found = 1 if m/#define SFML_VERSION_MAJOR 2/' /usr/local/include/SFML/Config.hpp

If it prints "SFML 1.x" then run the following command before reinstalling SFML 2.0 RC with the installer :
rm -r /usr/local/include/SFML
(Note : if it fails because of access right, juste type sudo !! right after the last command and enter your password as prompted.)

Now your project should compile fine, at least in C::B.

I'd like to move to Netbeans. I tried it and it seems to work fine with normal setting. It also has makefile which may simplify things. Could you please tell me how to set SFML up (2.0 if possible) on that?
Well, I don't know how NetBeans works with C++ (I only used it some years ago for Java development) but I guess it's pretty much the same as any IDE : you need to find three thing :
  • where the compiler should search for headers (option -I of gcc)
  • where the linker should search for libraries (-L) or frameworks (-F)
  • which libraries the linker should link against (-l ← it's an ell)
like you did in C::B.

You will probably find that on the web.

Now if you use Makefiles, you need to know how they work. I didn't read this tutorial but it should help you, I guess. You can also have a look at the documentation.

Also please note that after the installation of 2.0 in /Developer/usr/local/ there's just one folder: bin/; there's no include/ nor lib/.
Why did you install SFML in /Developer ? (This folder is removed with future version of Xcode, you probably should not use it anymore. Use instead /usr/local as explained in the tutorial.)
SFML / OS X developer

Jeffrey

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Mac OS X 10.6.8 SFML 2.0
« Reply #17 on: July 23, 2012, 06:40:03 pm »
For the Developer thing: just forget what I said, no problem. I misunderstood what you where saying.
In Netbeans I found the project settings and added "/usr/local/include" under Compiler > Include directories.
Now under Linker there are:

- Additional library directories (path)
- Libraries (I don't know what this is but there are sever buttons, some of which are: Add project, add library, add standard library, add library file, add options)
- Compilation line > Additional options

What would you do here?

Jeffrey

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Mac OS X 10.6.8 SFML 2.0
« Reply #18 on: July 23, 2012, 06:47:54 pm »
I could make it work. Thanks for you help.
For netbeans the steps are the following:

0. Run the Mac OS X 2.0 installer
1. Create a new project
2. Click Run>Set project configuration>Customize
3. Under Build>C++ Compiler and set Include directories to /usr/local/include
4. Under Build>Linker and set Additional library directories to /usr/local/lib
5. Under Build>Linker set Additional options to -lsfml-graphics -lsfml-window -lsfml-system

Now you are able to make the tutorial sample work.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Mac OS X 10.6.8 SFML 2.0
« Reply #19 on: July 23, 2012, 07:40:44 pm »
Great!

Just an idea, not sure about it, but did you uninstall SFML 1.6 before installing 2.0 RC ? Maybe the installer didn't override the old headers. Can you confirme this by showing me what prints the following command in a Terminal ?
perl -ne 'BEGIN { $found = 0; print "\n\n\n"; } END { if ($found == 0) { print "SFML 1.x\n\n\n"; } else { print "SFML 2.x\n\n\n"; } } $found = 1 if m/#define SFML_VERSION_MAJOR 2/' /usr/local/include/SFML/Config.hpp
Did you run the command ?
SFML / OS X developer

Jeffrey

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Mac OS X 10.6.8 SFML 2.0
« Reply #20 on: July 23, 2012, 07:41:42 pm »
It printed:


SFML 2.x

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Mac OS X 10.6.8 SFML 2.0
« Reply #21 on: July 23, 2012, 07:42:58 pm »
Ok, that's strange.

Anyway, you got it working so it's cool.
SFML / OS X developer

Jeffrey

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Mac OS X 10.6.8 SFML 2.0
« Reply #22 on: July 23, 2012, 08:29:32 pm »
What should it have printed?

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Mac OS X 10.6.8 SFML 2.0
« Reply #23 on: July 23, 2012, 10:44:33 pm »
SFML 1.x if my deductions were corrects. The error you got (/Users/Jeffrey/Desktop/TestProject/Test/main.cpp:6: error: 'Text' is not a member of 'sf') led me thing you had still 1.6 installed somehow.

Anyway, it's working so...  ;)
SFML / OS X developer

 

anything