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

  • Home
  • SEARCH
  • 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 8057293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:59:16+00:00 2026-06-05T08:59:16+00:00

I have a system for building my software already set up, using a makefile

  • 0

I have a system for building my software already set up, using a makefile and command-line tools.

I have been easily able to modify the makefile to support my Mac (10.7.4 now), so I am trying to get my code to work independently of XCode. I’ll deal with XCode once I start porting stuff to iOS. My hope is that a makefile solution (while my codebase is still manageable by said makefile) allows me better options for portability and automation.

I am experiencing exactly what is described here. The code compiles and problems are encountered on run-time.

At first I was using the SDL framework (-framework SDL) from the binary download on the SDL site, so I figured I could fix the problem by properly building SDL from source. I have done this and am now linking to libSDL.a and libSDLMain.a. This in turn requires me to include these additional frameworks to successfully compile (I came up with the list based on the output of sdl-config --static-libs:

-framework Cocoa -framework IOKit -framework AudioToolbox -framework AudioUnit -framework Carbon -framework ApplicationServices 

However I still have the same problem, which the article explains has to do with missing this:

[NSApplication sharedApplication];

My code has no Obj-C code. I’m happy to plug some Obj-C into it, though. I added SDLMain.m that came with one of the packages but the linker has a problem with that: ld: duplicate symbol _main

Okay, so I’m not gonna get away with that so easy.

What’s the little piece I’m missing that will let me initialize my NSApplication? Is there a way to do it without having a separate source file (from my Main.cpp) which must now be Obj-C? Is there some C/C++ wrapper function that I can call sharedApplication with?

  • 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-06-05T08:59:17+00:00Added an answer on June 5, 2026 at 8:59 am

    A lot of credit should go to RavuAlHemio because he pointed out for me enough information about what SDL is doing (trying to do) with the entry point. I then edited my code slightly, from

    #undef main
    int main(int argc,char *argv[]) {
    

    to

    int main(int argc,char *argv[]) {
    

    The only reason I had it the first way was because on Windows via MinGW (but not Linux) stdout and stderr were redirected to files rather than put on the terminal. I will now have to come up with a more elegant solution for that.

    Anyway, this has solved the problem.

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

Sidebar

Related Questions

I have my system set up to compile jee6 code from the command line
I'm building a navigation system using jquery scrollto. I have my navigation menu in
I currently building web management system using mvc3 In my application i have system
I have started building a system with clojure, mainly because I need to use
I have started building a system with clojure, mainly because I need to use
I'm building an Insurance Quoting system and have a number of questions to ask.
Recently, I have been building a website and I really want to have a
Hey, I'm building a four tier software system (Presentation - JSP, Problem Domain, Application
For my day job, I have been tasked with setting up a computer system
I'm building a software product, in which the customer will be able to configure

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.