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 9045909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:29:09+00:00 2026-06-16T11:29:09+00:00

My friend and I are porting our software to Mac OSX. The application is

  • 0

My friend and I are porting our software to Mac OSX. The application is heavily built on SDL and we are having a hard time getting SDL linked and compiling in Qt5. We are not using any part of Qt in our code other then using the IDE for cross-platform ease.

Currently, I have SDL framework inside /Library/Frameworks/

Inside application.pro I have:

TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt

SOURCES += main.cpp

macx {
   INCLUDEPATH += "/Library/Frameworks/SDL.framework/headers/"
}

In main.cpp I obviously have #include "SDL.h" and if I ctrl Click on the SDL.h it shows that it is linking to the framework…

When I go to build/compile I get this error:

14:21:24: Running steps for project BDGame...
14:21:24: Configuration unchanged, skipping qmake step.
14:21:24: Starting: "/usr/bin/make" -w
make: Entering directory `/Users/Kite/Dropbox/Wizardry Games/BDGame/BDGame-build-Desktop_Qt_5_0_0_clang_64bit_SDK-Release'
g++ -headerpad_max_install_names -mmacosx-version-min=10.6 -o BDGame main.o    
Undefined symbols for architecture x86_64:
  "_main", referenced from:
      start in crt1.10.6.o
     (maybe you meant: _SDL_main)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [BDGame] Error 1
make: Leaving directory `/Users/Kite/Dropbox/Wizardry Games/BDGame/BDGame-build-Desktop_Qt_5_0_0_clang_64bit_SDK-Release'
14:21:24: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project BDGame (kit: Desktop Qt 5.0.0 clang 64bit (SDK))
When executing step 'Make'

enter image description here

What am I doing incorrect that is stopping Qt from using SDL?

  • 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-16T11:29:10+00:00Added an answer on June 16, 2026 at 11:29 am

    In your main.cpp file you have to declare int SDL_main(int, char**) function instead of main(). You also need to get SDLMain.h and SDLMain.m files distributed along with SDL bundle for OS X. These two are required to bootstrap your Cocoa application that will invoke further the SDL_main function.

    I suppose you use Qt project (*.pro) file. You should have something like this in yours:

    qtsdl.pro

    QT       -= core gui
    
    TARGET = qtsdl
    CONFIG   += console
    CONFIG   -= app_bundle
    
    TEMPLATE = app
    
    INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers
    LIBS += -framework Cocoa -framework SDL
    
    SOURCES += \
        main.cpp
    
    OBJECTIVE_SOURCES += \
        SDLMain.m
    
    HEADERS += \
        SDLMain.h
    

    main.cpp

    #include <SDL.h>
    
    int SDL_main(int argc, char *argv[])
    {
        (void)argc;
        (void)argv;
    
        SDL_Surface *screen;
    
        if (SDL_Init(SDL_INIT_VIDEO) < 0)
            return 1;
    
        screen = SDL_SetVideoMode(640, 480, 32, SDL_OPENGL | SDL_HWSURFACE);
        if (!screen) {
            SDL_Quit();
            return 1;
        }
    
        SDL_Event event;
        bool running = true;
    
        while (running) {
            while (SDL_PollEvent(&event)) {
                switch (event.type) {
                case SDL_QUIT:
                    running = false;
                    break;
                case SDL_KEYDOWN:
                    running = false;
                    break;
                default:
                    break;
                }
            }
        }
    
        SDL_Quit();
        return 0;
    }
    

    SDLMain.h and SDLMain.m take them from SDL framework distribution.

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

Sidebar

Related Questions

I'm porting my application searches over to Sphinx from MySQL and am having a
My friend has a website built on wordpress and the developer has left the
My friend proved it to me by taking the WP7 papertoss games and getting
We are currently working on porting an old VB6 application to WPF. The plan,
Posting this one for a friend. They have an Icefaces app that uses Icefaces's
Preface: I'm posting this on behalf of a friend (who's apparently to shy to
friend's I have a task to place the horizontal scroll or swipe menu tabs
My friend and I were discussing the other day which style of code is
My friend gave me a database file: record.mdf . I copied that .mdf file
A friend show me this sample code to implement HTTP POST in C# and

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.