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

Author Topic: compile SFML in xcode for iOS, OpenGL/glu.h file not found.  (Read 2543 times)

0 Members and 1 Guest are viewing this topic.

smartly

  • Newbie
  • *
  • Posts: 10
    • View Profile
compile SFML in xcode for iOS, OpenGL/glu.h file not found.
« on: October 24, 2014, 11:22:03 am »
Why ... iOS not have glu support?
Code: [Select]
In file included from /Users/zoujiaqing/Projects/SFML/src/SFML/Graphics/Font.cpp:29:
In file included from src/SFML/Graphics/GLCheck.hpp:32:
In file included from src/SFML/Graphics/GLExtensions.hpp:77:
extlibs/headers/GL/glew.h:1163:10: fatal error: 'OpenGL/glu.h' file not found
#include <OpenGL/glu.h>
         ^
1 error generated.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: compile SFML in xcode for iOS, OpenGL/glu.h file not found.
« Reply #1 on: October 24, 2014, 11:52:08 am »
I don't remember why it is not done automatically, but it seems that you have to define the SFML_OPENGL_ES macro in your project settings.
Laurent Gomila - SFML developer

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: compile SFML in xcode for iOS, OpenGL/glu.h file not found.
« Reply #2 on: October 24, 2014, 07:57:09 pm »
I compared the different TargetConditionals.h (included in SFML/Config.hpp) on my system. Apparently, the one in /usr/include (or in 10.9 SDK) reads
    #define TARGET_OS_MAC               1
    #define TARGET_OS_WIN32             0
    #define TARGET_OS_UNIX              0
    #define TARGET_OS_EMBEDDED          0
    #define TARGET_OS_IPHONE            0
    #define TARGET_IPHONE_SIMULATOR     0

the one in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/TargetConditionals.h reads a little bit differently
    #define TARGET_OS_MAC               1
    #define TARGET_OS_WIN32             0
    #define TARGET_OS_UNIX              0
    #define TARGET_OS_EMBEDDED          1
    #define TARGET_OS_IPHONE            1
    #define TARGET_IPHONE_SIMULATOR     0

and of course the one in the iPhone Simulator SDK reads
    #define TARGET_OS_MAC               1
    #define TARGET_OS_WIN32             0
    #define TARGET_OS_UNIX              0
    #define TARGET_OS_EMBEDDED          0
    #define TARGET_OS_IPHONE            1
    #define TARGET_IPHONE_SIMULATOR     1

Now, I haven't tested but I guess setting correctly the SDK to use would fix this issue.

@smartly, how did you set up your project?
SFML / OS X developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: compile SFML in xcode for iOS, OpenGL/glu.h file not found.
« Reply #3 on: October 24, 2014, 08:45:23 pm »
SFML_OPENGL_ES is never defined, even if SFML_SYSTEM_IOS is correctly defined. So it's not a problem with TargetConditionals.h, it's just that it has to be done manually.
Laurent Gomila - SFML developer

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: compile SFML in xcode for iOS, OpenGL/glu.h file not found.
« Reply #4 on: October 24, 2014, 10:02:15 pm »
Damn, I was looking at OpenGL.hpp and not GLExtensions.hpp...

I'm wondering though: would it make sense to define SFML_OPENGL_ES in Config.hpp along with SFML_SYSTEM_IOS? (And maybe the same for Android?) Because, unless I'm mistaken, on those OSes only OpenGL ES work, right?
SFML / OS X developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: compile SFML in xcode for iOS, OpenGL/glu.h file not found.
« Reply #5 on: October 24, 2014, 10:55:54 pm »
Yes, that's why I said
Quote from: Laurent
I don't remember why it is not done automatically
Laurent Gomila - SFML developer