News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Using Qt and SDL

Started by bfr, May 12, 2007, 07:07:44 PM

Previous topic - Next topic

bfr

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 `WinMain@16'
:: === Build finished: 1 errors, 0 warnings ===

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


#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.

raph

Quote from: bfr on May 12, 2007, 07:07:44 PM
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