glfwInit failing error
So, I've had this error for a while and I had found a similar thread with a similar problem.
[Session started at 2008-08-23 11:15:36 -0400.]
glfwInit failing because you aren't linked to OpenGL
FAILED OPENING WINDOW
O3D has exited with status 1.
However after reading the thread I added a resource folder and I still got the same problem on OSX tiger.
Heres the code:
Any help would help.
ps Don't suggest sdl or glut, I have my reasons.
pss I didn't post in that thread as most forums don't like reviving old threads.
[Session started at 2008-08-23 11:15:36 -0400.]
glfwInit failing because you aren't linked to OpenGL
FAILED OPENING WINDOW
O3D has exited with status 1.
However after reading the thread I added a resource folder and I still got the same problem on OSX tiger.
Heres the code:
Code:
#include <stdlib.h>
#include <stdio.h>
#include <GL/glfw.h>
void render(void){
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_TRIANGLES);
glVertex3i(1,1,1);
glVertex3i(1,1,1);
glVertex3i(1,0,1);
glEnd();
glFlush();
glfwSwapBuffers();
return;
}
int main(void){
int width, height;
float aspect;
glfwInit();
atexit(glfwTerminate);
glfwEnable( GLFW_STICKY_KEYS );
glfwSwapInterval( 0 );
if(!glfwOpenWindow(640,480,8,8,8,8,8,8,GLFW_WINDOW)){
printf("FAILED OPENING WINDOW");
glfwTerminate();
exit(1);
}
glfwGetWindowSize( &width, &height );
height = height > 0 ? height : 1;
glViewport( 0, 0, width, height );
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
aspect_ratio = ((float)height) / width;
glFrustum(.5, -.5, -.5 * aspect, .5 * aspect, 1, 50);
glMatrixMode(GL_MODELVIEW);
glfwSetWindowTitle("O3D WINDOW TEST");
//glClearColor(1,1,1,1);
while(1){
render();
if (glfwGetKey(GLFW_KEY_ESC)) exit(0);
}
}Any help would help.
ps Don't suggest sdl or glut, I have my reasons.
pss I didn't post in that thread as most forums don't like reviving old threads.
Oddity007 Wrote:glfwInit failing because you aren't linked to OpenGL
Assuming this means what it says, try adding OpenGL.framework to your project.
I already have it in, thats what makes it frustrating.
![[Image: lol.gif]](http://www.idevgames.com/forum/images/smilies/lol.gif)
This is my xcode project
![[Image: lol.gif]](http://www.idevgames.com/forum/images/smilies/lol.gif)
This is my xcode project
Line 135 of macosx_init.c
http://glfw.svn.sourceforge.net/viewvc/g...iew=markup
I wrote this code, and I don't see how it can fail if you're linked to OpenGL, and I've never met anyone else with the issue. I have to assume that (despite appearances) you are not linked to OpenGL. Please post the detailed build log from Xcode to confirm that you are indeed managing to link to the OpenGL framework.
The current implementation of GLFW for Mac OS X is Carbon. I'd avoid it. I can't think of any good reason to use GLFW over SDL other than deployed binary size.
http://glfw.svn.sourceforge.net/viewvc/g...iew=markup
I wrote this code, and I don't see how it can fail if you're linked to OpenGL, and I've never met anyone else with the issue. I have to assume that (despite appearances) you are not linked to OpenGL. Please post the detailed build log from Xcode to confirm that you are indeed managing to link to the OpenGL framework.
The current implementation of GLFW for Mac OS X is Carbon. I'd avoid it. I can't think of any good reason to use GLFW over SDL other than deployed binary size.
Nothing but build succeeded.
I won't use sdl as I can't use argc and argv.
The file size also has an impact for the systems I am developing for.
I won't use sdl as I can't use argc and argv.
The file size also has an impact for the systems I am developing for.
Why can't you use argc and argv with SDL?!
You need to make clean, then build again.
You need to make clean, then build again.
I fixed the problem by putting the framework includes in the prefix header.
Now it's making the window from a nib and returns 48 if I delete it.
Now it's making the window from a nib and returns 48 if I delete it.
Oddity007 Wrote:I fixed the problem by putting the framework includes in the prefix header.
There's no way that could have any effect.
Quote:Now it's making the window from a nib and returns 48 if I delete it.
What do you mean?
It makes the window from a main.nib for some reason.
Then, if I delete the nib, it returns a strange error code of 48.
How do I disable using a nib in xcode 2.4, google keeps giving stuff for 3.0
edit:Actually if you could supply a sample xcode 2.4 project, that would help me figure out what I'm doing wrong.
Then, if I delete the nib, it returns a strange error code of 48.
How do I disable using a nib in xcode 2.4, google keeps giving stuff for 3.0
edit:Actually if you could supply a sample xcode 2.4 project, that would help me figure out what I'm doing wrong.
GLFW does not use a nib, cannot use a nib. What are you talking about?
Okay its obvious that my mac hates me, so if possible could someone tell me where I can find a sample xcode 2.4 project, as google is being surprisingly mute.
/Developer/Examples is full of 'em... just not for GLFW. For GLFW, I'd start with an empty project, add a "Carbon Application" target, the GLFW library and header, the OpenGL and Carbon frameworks.
Did that, and now for the inescapable error:
![[Image: my.php?image=screenshotfc5.png]](http://img158.imageshack.us/my.php?image=screenshotfc5.png)
P.S. You forgot AGL, or is that not needed?
![[Image: my.php?image=screenshotfc5.png]](http://img158.imageshack.us/my.php?image=screenshotfc5.png)
P.S. You forgot AGL, or is that not needed?
AGL is probably also required.
Your picture link is broken (needs to be a link, not an inline image, with imageshack).
Cmd-shift-3 is an easier way to take screenshots than some random 3rd-party software
I can't tell anything much at all from the screenshot, but if your app compiles and links, chances are it's a bug in your program.
Your picture link is broken (needs to be a link, not an inline image, with imageshack).
Cmd-shift-3 is an easier way to take screenshots than some random 3rd-party software

I can't tell anything much at all from the screenshot, but if your app compiles and links, chances are it's a bug in your program.
Well I have it in there.
Its my own screenshot taker, ha ha.
*sigh* the curse of the messed up glfw.
Its my own screenshot taker, ha ha.
*sigh* the curse of the messed up glfw.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Help! Build failing on libcurl | GolfHacker | 7 | 4,918 |
Nov 3, 2007 08:03 PM Last Post: GolfHacker |
|
| Failing to link with static library | c0d1f1ed | 11 | 4,613 |
Sep 24, 2006 05:37 PM Last Post: c0d1f1ed |
|
| 'Unidentified error' error in Xcode | scgames | 2 | 3,161 |
Jun 10, 2006 01:38 AM Last Post: scgames |
|

