• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problems with addition of the resource
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Problems with addition of the resource
  • Next by Date: Re: Subversion with xcode problems
  • Previous by thread: Re: Problems with addition of the resource
  • Next by thread: Java project - warning message - catch 22
  • Index(es):
    • Date
    • Thread