I'm using Xcode on Mac OS X, and I've added a file called 'peacock.tga' into my project. I can't seem to open that file (using fopen) however. Is there anything special that I need to do in order for the file to be readable?
Using Xcode results in file not found error
You need to make sure you use the correct path to the file. If you're just creating a regular, console-type application, the .tga is probably not being copied to the output directory of the executable. If you're creating an OS X bundle, you probably want to ensure the .tga is packaged into the bundle and that you use a path to where the file ends up in the Resources subdirectory of the bundle.
If you're porting and building a Mac OSX bundle app, you've have some file handling rework ahead of you. First, I recommend that you add your assets as references rather than directly in the project. This is because XCode will preserve folder structure for referenced folders, while flattening file hierarchies that are directly included in the project. Second, you will need to follow these instructions to get a real file path:
You'll be able to use fopen as normal after that. While we're on the topic, I'll point out that this approach will not work on Android, where you have to go through explicit platform-specific IO APIs to load content embedded in your app.