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

Author Topic: [solved] SFML installation on Mac OSX Lion with Qt  (Read 3319 times)

0 Members and 1 Guest are viewing this topic.

SourceBase

  • Newbie
  • *
  • Posts: 5
    • View Profile
[solved] SFML installation on Mac OSX Lion with Qt
« on: September 23, 2012, 12:02:59 pm »
Hello everyone,

I noticed there was an installer for the release candidate, so I downloaded it and installed it.
But the installer was made for Xcode, but I would love to use SFML in Qt.

Can someone tell me what to do to use it in Qt? I don't know what I need to change in the *.pro file and what to link since I don't know where the installer has put the files...

Thanks!

SourceBase.
« Last Edit: September 26, 2012, 09:22:41 pm by SourceBase »

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: SFML installation on Mac OSX Lion with Qt
« Reply #1 on: September 23, 2012, 08:37:42 pm »
What the installer do is the same as what you would have done yourself with some copy and past. Therefore you can look at '... with your bare hands' § to know what was installed and where.

Then the procedure for .pro files is the same as with any library (expect you can choose between frameworks and dylibs).
SFML / OS X developer

SourceBase

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: SFML installation on Mac OSX Lion with Qt
« Reply #2 on: September 24, 2012, 06:35:37 pm »
Okay, I found out the installer puts the frameworks in /Library/Frameworks, and puts the *.hpp files (are these the dylibs you talked about?) in /usr/local (I didn't even know where to find this folder, is it hidden by default? I can only find it by "go to" in the finder and then enter the path to it). Thanks for the link to that page btw!

But now I know where to find the frameworks and the dylibs (if these *.hpp files really are the dylibs), but I still don't know what I need to fill in in the *.pro file.

When I worked with my own built of SFML, I needed to link the libraries with
 LIBS +=  -L "/Path/To/The/Libs/lib" -lsfml-window -lsfml ...
and
 INCLUDE = "/Path/To/SFML/ SFML 2.0"
This was it.

But now I can only find some *.hpp files in /usr/local, but no SFML 2.0 folder to "INCLUDE" in the *.pro file.
So, can I just do it with linking the libs?

If this is possible, can I also copy the content of the SFML folder in /usr/local to some other folder?

Thanks in advance!

SourceBase.


Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: SFML installation on Mac OSX Lion with Qt
« Reply #3 on: September 24, 2012, 11:52:48 pm »
No, hpp files are headers; not dylibs. Read at least the introduction part of the OS X tutorial to fix this confusion.

Now, the easiest way seems to use dylibs with .pro file. dylib can be found in /usr/local/lib and headers in /usr/local/include.

Quote
I can only find it by "go to" in the finder and then enter the path to it
Yes, this is because Apple hides folder like those to prevent regular users to do stupid things with them. Alternatively you can use your Terminal to see all those directories.
SFML / OS X developer

SourceBase

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: SFML installation on Mac OSX Lion with Qt
« Reply #4 on: September 25, 2012, 08:10:52 pm »
Quote
No, hpp files are headers; not dylibs. Read at least the introduction part of the OS X tutorial to fix this confusion.
Okay, now I get it, thank you. Next time I'll try to search on my own...

Quote
Yes, this is because Apple hides folder like those to prevent regular users to do stupid things with them. Alternatively you can use your Terminal to see all those directories.
I made this folder visible, it works a little bit easier.

But now my problem isn't solved yet, in spite of your help.
This time I tried to search myself, but I didn't found what I was looking for. But first let me explain what I did.

In the *.pro file I tried to add the libraries with the following command:
Code: [Select]
LIBS += -L"/usr/local/lib" -libsfml-window -libsfml-graphics //etc.I also used this command:
Code: [Select]
INCLUDEPATH = "/usr/local/include/SFML
The second command works fine, the auto-fill-in works.
But when I try to compile, I get an error saying that the library "-libsfml-window" can't be found.
So I tried an alternative command, which is doing -according to me- the same. That command was the following:
Code: [Select]
LIBS += "/usr/local/lib/libsfml-window"With this command it seems like the library can be found, because I didn't get errors for it, but I did get another error which was saying : "Symbols not found for architecture x86_64". I googled the error, and what I found were similar problems to my mine : the error was displayed when someone tried to link a library. I didn't found a solution, because it wasn't related with SFML in any of the cases...

So can you tell me please what I'm doing wrong? Btw, I also get 3 warnings, if you need the exact information about the warnings, I'll post them.

I have another additional question: in the folder /usr/local/lib I saw 3 times kind of the same library, for example:
• libsfml-audio-d
• libsfml-audio-d.2
•libsfml-audio-d.2.0
What is the difference between these 3?

Thank you!

SourceBase.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: SFML installation on Mac OSX Lion with Qt
« Reply #5 on: September 25, 2012, 10:01:29 pm »
Quote
But when I try to compile, I get an error saying that the library "-libsfml-window" can't be found.
It should be -lsfml-window.

Quote
I did get another error which was saying : "Symbols not found for architecture x86_64". I googled the error, and what I found were similar problems to my mine
Yeah, it's probably the same symptoms but it could be something else. What is the full error message ?

Quote
Btw, I also get 3 warnings, if you need the exact information about the warnings, I'll post them.
You should : I've no idea what warnings you're talking about.  :P

Quote
What is the difference between these 3?
the first two are symlinks to the one below. Use ls -la to see the mapping. You can read § 3.1.1 of this document to grasp the idea behind the symbolic links (.dylibs on Mac are the same as .so on Linux).
SFML / OS X developer

SourceBase

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: SFML installation on Mac OSX Lion with Qt
« Reply #6 on: September 26, 2012, 04:48:54 pm »
Aww yeaaah :) Finally it works!

It compiles fine and I can run the compiled file!

But I still get some warnings, but they don't seem to be very important...But I'll post them here:
Code: [Select]
:-1: warning: directory not found for option '-L/usr/local/pgsql/lib'
:-1: warning: directory not found for option '-L/tmp/qt-stuff-85167/source/qt-everywhere-opensource-src-4.8.1/Desktop/Qt/4.8.1/gcc/lib'
:-1: warning: directory not found for option '-F/tmp/qt-stuff-85167/source/qt-everywhere-opensource-src-4.8.1/Desktop/Qt/4.8.1/gcc/lib'

Maybe you know what they mean?

Thank you for all the help, thanks to you it finally works! I really didn't know how to do it...

SourceBase.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: SFML installation on Mac OSX Lion with Qt
« Reply #7 on: September 26, 2012, 06:36:28 pm »
Glad it helped  :)

Quote
But I still get some warnings, but they don't seem to be very important...
Yeah, they look weird but not too scary. IMO you can forget about them.
SFML / OS X developer

SourceBase

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: SFML installation on Mac OSX Lion with Qt
« Reply #8 on: September 26, 2012, 09:22:29 pm »
This problem is [solved] for me! :)

SourceBase.
« Last Edit: September 27, 2012, 05:09:58 pm by SourceBase »