Visual studio 10 - error LNK2019 [SOLVED]

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
lazyCrab
Earned a small fee
Earned a small fee
Posts: 21
Joined: Sat May 26, 2012 4:02 pm

Visual studio 10 - error LNK2019 [SOLVED]

Post by lazyCrab »

I installed wxWidgets 2.9.2 on VS10 and when I try to use a build a very basic GUI app it does not compile with the error :"error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup".
Last edited by lazyCrab on Sat Jun 02, 2012 3:47 pm, edited 1 time in total.
User avatar
doublemax
Moderator
Moderator
Posts: 16490
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Visual studio 10 - error LNK2019

Post by doublemax »

Like i said before, it's much easier if you take the "minimal" sample as starting point for your own project. Even if there are things in it that you don't understand at first, they're all needed.

In general, if the linker complains about missing _main, you're building a console application which is wrong in this case.
Use the source, Luke!
lazyCrab
Earned a small fee
Earned a small fee
Posts: 21
Joined: Sat May 26, 2012 4:02 pm

Re: Visual studio 10 - error LNK2019

Post by lazyCrab »

Thanks again DoubleMax but I'm following a tutorial from here http://zetcode.com/tutorials/wxwidgetst ... tprograms/ and I want to start form scratch. I did choose console application, what should have I chosen?
User avatar
doublemax
Moderator
Moderator
Posts: 16490
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Visual studio 10 - error LNK2019

Post by doublemax »

I did choose console application, what should have I chosen?
Windows

Project settings -> Linker -> General -> System -> Subsystem: Windows
Use the source, Luke!
lazyCrab
Earned a small fee
Earned a small fee
Posts: 21
Joined: Sat May 26, 2012 4:02 pm

Re: Visual studio 10 - error LNK2019

Post by lazyCrab »

Thanks again DoubleMax, it worked!
Post Reply