Results 1 to 4 of 4

Thread: error LNK2019: unresolved external symbol _WinMain@16 referenced in function

  1. #1
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Question error LNK2019: unresolved external symbol _WinMain@16 referenced in function

    error LNK2019: unresolved external symbol _WinMain@16 referenced in function
    I use SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES WIN32_EXECUTABLE TRUE) in cmakelists.txt but get above error.Help me...Thank in advance!

  2. #2
    Join Date
    Mar 2011
    Posts
    33
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: error LNK2019: unresolved external symbol _WinMain@16 referenced in function

    WinMain is a windows function right? so you would have to include windows.h or use int main() instead.

  3. #3
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: error LNK2019: unresolved external symbol _WinMain@16 referenced in function

    error occur only when I use SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES WIN32_EXECUTABLE TRUE) in cmakelists.txt.If I remove this command then result is OK.Why is cannot set properties of target?

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: error LNK2019: unresolved external symbol _WinMain@16 referenced in function

    Qt projects don't use WinMain as far as I'm aware. You don't need that flag anyway, you can just use the linker flag "/SUBSYSTEM:WINDOWS".

Similar Threads

  1. Replies: 4
    Last Post: 5th January 2011, 16:51
  2. unresolved external symbol
    By gridolfi in forum Qt Programming
    Replies: 1
    Last Post: 8th September 2009, 18:58
  3. Replies: 1
    Last Post: 10th April 2009, 19:07
  4. unresolved external symbol
    By tgreaves in forum Qt Programming
    Replies: 2
    Last Post: 16th January 2009, 20:49
  5. Replies: 16
    Last Post: 23rd May 2008, 11:12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.