Jump to content
  • Advertisement
Sign in to follow this  
sheep19

compiling a QT project in visual studio

This topic is 2551 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. I have downloaded QT and created my first project:


#pragma comment(lib, "QtCore4.lib")

#include <QtCore/qcoreapplication.h>

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

return a.exec();
}


The code compiles fine if subsystem is set to console. However only the console window is shown when I run it. So I chaned it to "Windowed", and I get a linker error:
LINK : C:\Users\Minas\Documents\Visual Studio 2010\Projects\Qt_HelloWorld\Debug\Qt_HelloWorld.exe not found or not built by the last incremental link; performing full link
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup


(I have set up the project correctly). What am I missing?

Share this post


Link to post
Share on other sites
Advertisement
Set Linker->Advanced->Entry point project setting to "mainCRTStartup" (without quotes).

Here's more info about this setting: http://msdn.microsoft.com/en-us/library/f9t8842e.aspx

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!