Re: Problems with addition of the resource
Re: Problems with addition of the resource
- Subject: Re: Problems with addition of the resource
- From: Greg Guerin <email@hidden>
- Date: Sat, 28 Feb 2009 16:57:56 -0700
Ariel wrote:
I create a project, add GLUT and OpenGL frameworks, but I can't
load an image using by fopen( fp, "data/image.bmp", "r" ); in fact
the image is in 'date', but function shows error message: printf
( "fopen can not open the file"). Under Linux that works. Have you
got any ideas?
You might want to use the global variable 'errno' and the perror()
function to print a more useful error message, to identify the cause
of fopen()'s failure. Start by reading the man pages for fopen and
perror. In Xcode, there is a menu-item under the Help menu that will
open man pages.
The pathname "data/image.bmp" is relative to the working directory.
You should confirm that the current value of the working directory is
what you need when you call fopen().
Depending on how you execute your program, you might have to preset
the working directory. For example, in an Xcode project's
Executable, you control the working directory. If you haven't looked
at its value, the default value from the project template may not be
what your program needs.
Finally, I don't see any fopen() function with 3 parameters, so
either you've mistyped something, or your code is doing something
unusual that you should explain. I assume you're using C code, not C+
+, and are referring to the stdio function fopen described in section
3 of the man pages.
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden