2

So I found Apples great sample called GL3 Text.(LINK) Seems to be doing exactly what I need using included libraries.

I imported the toolkit folder from the sample as it contains everything I need to make it work.

In order to declare a variable type I need, as well as use some methods they had setup in the sample, I need to import OpenGLText.h in my openglview class.

Problem is, when I do this another file from the sample, OpenGLContainers.h, gets errors on these 3 lines

#import <map>
#import <string>
#import <vector>

The error says, for example, "'map' file not found."

If I take out the OpenGLText.h import line, everything compiles fine and I'm able to right click -> jump to definition, on those 3 lines that previously had errors.

I've already double checked that I'm includeing the frameworks they use in the sample. Cocoa, OpenGL, and GLKit.

Any ideas on how to fix this? Seems like theres something conflicting with the imports.

If you don't know how to fix, but have suggestions on other simple ways to render text on an opengl surface on Mac let me know!

Hardycore
  • 334
  • 4
  • 17

2 Answers2

1

Those are C++ headers. You have to compile the sources using those headers as C++ or Objective-C++.

datenwolf
  • 159,371
  • 13
  • 185
  • 298
1

Have you tried the advice in the stack overflow posts below?

.h file not found

XCode - #include <map> in ml.hpp : No such file or directory

Lexical or Preprocessor Issue with "#import <map>

Best Regards, Magnus

Community
  • 1
  • 1
vindarmagnus
  • 326
  • 3
  • 10
  • Thanks for the help. In the end I found the NSOpenGLView and wrote the gl stuff from scratch. Annoying to do it that way but it works. – Hardycore Aug 13 '14 at 21:29
  • That's great! One of the above worked for me. I'm currently struggling with learning gl, and it's hard when copied stuff doesn't even compile! If the answer was feasible, please mark it as accepted and give me some rep ;) – vindarmagnus Aug 14 '14 at 20:05
  • NP and I agree, straight GL is a bit more complex than I'm used to. Luckily what I needed it to do was fairly straight forward. – Hardycore Aug 18 '14 at 22:54