[Qt-interest] Qt + SDL + CONFIG += CONSOLE

Thomas Meyer public at meyer-thomas.com
Tue Jul 26 20:48:23 CEST 2011


Hello,
I'm developing a simple SDL-Demo with Qt Creator 4.7.4, MS Windows 7,
MS Visual Studio 2008 Version 9.0.30729.1 SP and SDL-1.2.14

My .pro file:
TEMPLATE=app

TARGET  =  SDL_Demo

CONFIG  +=  console

QT  +=  opengl

INCLUDEPATH  +=  D:/SDL-1.2.14/include/

LIBS  +=  -LD:/SDL-1.2.14/lib  \

      -lSDL  \

      -lSDLmain

SOURCES  +=  SDL_Demo.cpp


My SDL_Demo.cpp:
#include<QtOpenGL>

#include  "SDL.h"


const  GLsizei  windowWidth  =  500;

const  GLsizei  windowHeight  =  500;


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

{

     if  (SDL_Init(SDL_INIT_VIDEO)  <  0)

     {

         fprintf(stderr,  "Unable  to  initialize  SDL  %s",  SDL_GetError());

         exit(1);

     }


     if  (SDL_SetVideoMode(windowWidth,  windowHeight,  0,  SDL_OPENGL)  ==  NULL)

     {

         fprintf(stderr,  "Unable  to  create  OpenGL  Scene:  %s",  SDL_GetError());

         exit(2);

     }


     SDL_Quit();

     return  1;

}

When I build this demo (debug and release) I get a console window and a SDL window
for a short time. When I replace in the .pro file 'CONFIG  +=  console' with
'CONFIG  +=  windows' I get the same like last sentence. But, when I clean the project
and build it, I get an error:
debug\SDL_Demo.exe:-1: error: LNK1169: Mindestens ein mehrfach definiertes Symbol gefunden.

My goal is, to have only the SDL window without the console window.


Could anyone tell me, what I have to change?

Thanks,
     Thomas


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110726/01d22a05/attachment.html 


More information about the Qt-interest-old mailing list