Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6160815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:23:23+00:00 2026-05-23T21:23:23+00:00

(First off, thanks so much. Stackoverflow has been very helpful to me in the

  • 0

(First off, thanks so much. Stackoverflow has been very helpful to me in the past!)

Okay, so I am currently working on a Command Line Tool written in C++ through Xcode.
I’ve done a dozen or so programs in the past like this and had no problem compiling them inside or outside of Xcode. Usually, I just use the terminal’s g++ line to compile manually, but I have occasionally used Xcode’s release. I am definitely less familiar with doing it through Xcode, however, than I am with g++.

That said, this time I am trying to build a project with the SDL framework as well. It’s my first attempt at any sort of GUI and it is way tougher than I’d imagined. I wanted to be able to compile the project and send a copy of the executable file to my professor to show my progress, but I cannot figure out how to do it.

I don’t think it’s possible to build through g++ because I need to also include the SDL and Cocoa frameworks. (That could be very wrong, and if so, that’s also an option!)
When I Build through Xcode, however, I can successfully open it and run it externally through Terminal. So we’re close. But it is unable to find any of the images that I use.
The SDL definitely works, and I can click where the images should be (and it works) but it just says that it can’t open “images/blahblah.bmp”.

Currently my folder heirarchy is like this:

Project folder contains all my .cpp’s and .h’s as well as a folder titled “images” which contains the images. In all my c++ files, I refer to them as “images/border.bmp” for example. To get that to work, I believe I had to set my working directory to this project folder. So that may have something to do with the problem. I did that through the current Scheme, under “working directory”.

I thought that maybe the images folder wasn’t being included in the build? So I tried adding it to the target.
Under Project, Target (accessed by clicking on my Project in the Navigator) I added the folder to Compile Sources, Link Binaries with Libraries, and Copy Files with no result. I tried each independently as well as together.

So, I’m sure I’m missing something very small and silly; I’ve just never done anything like this before. Gotta learn somehow? But I wasn’t able to find anyone with the same problem online. (also, a lot of my search results are blogs, but I’m currently staying in China and am unable to access many of them. … :-/ )

Thanks so much for any help! Hopefully I’ve been clear enough!

Brief Update:
Interestingly, I turned off custom working directory, and put the images into the standard Working Directory instead(which I’m pretty sure is just next to the executable in either “Debug” or “Release” folder), and it still doesn’t work. It does still work in Xcode though (which tells me i think I have the working directory correct.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:23:24+00:00Added an answer on May 23, 2026 at 9:23 pm

    The Mac version of SDL sets the working directory to the application bundle’s parent directory. You’re not creating a Mac application bundle so the operating system can’t find the images. A short term fix would be to open the file SDLMain.m and modify the setupWorkingDirectory: method so the working directory is set to your project folder.

    A long term and better fix is to create a Mac application bundle. The easiest way to do this is to use SDL’s Xcode project templates. The SDL project templates don’t work on Xcode 4 so you would have to install Xcode 3.2, create the project in 3.2, and do the rest of your work in Xcode 4. Another way to create a Mac application bundle is to create a Cocoa application and add the SDL framework, SDLMain.h, and SDLMain.m to your project. You also have to remove some files, including the xib file and the main.m file.

    The following blog post has tips on working with SDL on Mac OS X:

    SDL Tips for Mac OS X

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.