Author Topic: Using Qt and SDL  (Read 2910 times)

Offline bfr

  • Multiple posting newcomer
  • *
  • Posts: 17
Using Qt and SDL
« on: May 12, 2007, 07:07:44 pm »
How would I use Qt and SDL together?  I can't choose two templates at once...can I?

EDIT:  And when I added C:/sdl/SDL-1.2.11/include/ and C:/sdl/SDL-1.2.11/lib/ (which should be the correct locations) to the "Search Directories" in the apporpriate places, I get:

C:\MinGW\lib\libmingw32.a(main.o):main.c:(.text+0x106):: undefined reference to `[email protected]'
:: === Build finished: 1 errors, 0 warnings ===

I'm using the May 12 Nightly version of Code::Blocks.  Here is my code:

Code: [Select]
#include <QApplication>
#include <QFont>
#include <QPushButton>
#include "SDL.h"

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

    QPushButton quit("Quit");

    quit.resize(500, 400);
    quit.setFont(QFont("Times", 18, QFont::Bold));

    QObject::connect(&quit, SIGNAL(clicked()), &app, SLOT(quit()));

    quit.show();
    return app.exec();
}

EDIT AGAIN:  Also, what does Code::Blocks do when a Qt or SDL template is selected?  Does it just add SDL or Qt directories to the Compiler and Linker tabs in "Search Directories" in the "Build Options"?

ANOTHER EDIT:  I got it to work!!!!  I had to edit some linker settings.
« Last Edit: May 12, 2007, 11:07:07 pm by bfr »

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: Using Qt and SDL
« Reply #1 on: May 13, 2007, 11:06:41 am »
EDIT AGAIN:  Also, what does Code::Blocks do when a Qt or SDL template is selected?  Does it just add SDL or Qt directories to the Compiler and Linker tabs in "Search Directories" in the "Build Options"?
That's right, a wizard adjusts the compiler and linker settings to fit the project-type requirements and creates an example sourcecode.

Regards
raph