GLEW: Apple Mach-O Linker (Id) Error
Asked Answered
G

2

3

I'm trying to use glew in my Xcode project, but I'm getting this: Apple Mach-O Linker (Id) Error... Undefined symbols for architecture x86_64

I'm using the current version of glew that I downloaded from their sourceforge site.

Xcode error: Apple Mach-O Linker (Id) Error Undefined symbols for architecture x86_64

Gooey answered 30/1, 2012 at 13:10 Comment(0)
G
8

Here's what I did:

Install Glew via MacPorts. (in terminal run the command sudo port install glew)

In the Xcode project's build settings add the following:

  • other linker flags: -lGLEW
  • header search paths: /opt/local/include/
  • library search paths: /opt/local/lib/
Gooey answered 5/2, 2012 at 9:1 Comment(1)
THANKS!! I lost a whole day because of this. Your solution worked!!Talley
P
2

You aren't linking with the GLEW library. You will probably have to add the directory, you installed GLES into, it to the 'library search path' settings of the Xcode project.

Priscella answered 30/1, 2012 at 13:37 Comment(4)
That sounds promising! I'd already got the headers working by adding /usr/include/** to the header search path, so I tried adding /usr/lib/** to the library search path and it's still not working. :(Gooey
Can you go to the Xcode 'Build tab' (or whatever it's called) and expand and copy the linker command line and errors into your question please?Priscella
I worked it out! Well, I worked how to get rid of the errors at least. I used the macports version of glew: header search paths: /opt/local/include/, library search paths /opt/local/lib/. I then added -lGLEW to 'other linker flags'. Now I'm having trouble with the glut window not appearing, but that's another issue.Gooey
any idea on how to write a makefile for that ?Allanite

© 2022 - 2024 — McMap. All rights reserved.