Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Error LNK2019: unresolved external symbol _main referenced in function _WinMain@16
Forum Updated to NodeBB v4.3 + New Features

Error LNK2019: unresolved external symbol _main referenced in function _WinMain@16

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 6.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    levanil
    wrote on last edited by
    #1

    Hi, all!
    I have Qt 5.4.0 for visual studio 2013 32 bit.
    I have Qt add-in 1.2.4.
    I have Visual Studio 2013 Ultimate + Update 4 (12.031101.00)

    I have a simple Qt app.
    .pro file:
    @QT += core gui widgets

    TARGET = splitter_qt_creator
    TEMPLATE = app

    SOURCES += main.cpp@

    main.cpp file:
    @#include <QApplication>
    #include <QSplitter>
    #include <QTextEdit>

    int mian(int argc, char* argv[])
    {
    QApplication a(argc, argv);

    QSplitter* pMainSplitter = new QSplitter;
    ...
    pMainSplitter->show();
    
    return a.exec(&#41;;
    

    }
    @
    Unfortunately when I try to build the solution, the error appears:
    error LNK2019: unresolved external symbol _main referenced in function _WinMain@16

    I've tried to apply "hot-fix" - remove value related to "/SUBSYSTEM:WINDOWS" from project properties->linker->command line->additonal options.
    but atm the value is not an additional option.
    additional options are:
    "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='...' language='' processorArchitecture=''"

    Who can help me?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Subst27
      wrote on last edited by
      #2

      It seems you create new project as Console application but your code is Win32.

      check it, plz

      1 Reply Last reply
      0
      • L Offline
        L Offline
        levanil
        wrote on last edited by
        #3

        if you mean I should remove QT += core, it doesn't help.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kuschky
          wrote on last edited by
          #4

          Hi, check the name of your main function. You did a mistype

          @int mian(int argc, char* argv[])@

          it's named mian so the linker can not find the main function.

          Best regards Michael

          1 Reply Last reply
          0
          • L Offline
            L Offline
            levanil
            wrote on last edited by
            #5

            Thanks a lot !
            omg, epick fail

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Corey821
              Banned
              wrote on last edited by
              #6
              This post is deleted!
              1 Reply Last reply
              -1

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved