question

JasonRempel-3868 avatar image
0 Votes"
JasonRempel-3868 asked ·

The sample code for this page doesn't work.

[your-first-windows-program][1] [1]: https://docs.microsoft.com/en-us/windows/win32/learnwin32/your-first-windows-programI&#39

On this page I was trying to learn how to use the Win32 API but I ran into a problem. When I compiled the complete code segment for a blank and basic window it does not build. Im using Visual Studio 2019 and on the Error List this is what it has to say:
LNK2019 unresolved external symbol main referenced in function "int _cdecl invoke _main(void)" (?invoke_main@@YAHXZ)

I looked up the LNK2019 but I still cant find out what might be the issue. m very inexperienced with linker problems and with Win32 API. I know a bit about c++ but this is new territory for me. Some help would be greatly appreciated.; I don't know anything about the tags so it may be wrong

not-supported
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RoyLi-MSFT avatar image
0 Votes"
RoyLi-MSFT answered ·

Hello,

Welcome to Microsoft Q&A!

Currently, Microsoft Q&A is under a public preview. Not all topics are supported right now. All the supported topics are listed on the right top.

Your question is about win32 API and it is not in the supported topics. I suggest that you could ask the question in General Windows Desktop Development Issues Forum.


Thank you!


· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GrantMeStrength avatar image
0 Votes"
GrantMeStrength answered ·

Hi -

We (the docs team) just checked the sample and confirmed it's ok. It's possible your development environment is configured incorrectly? Perhaps a repair of the Visual Studio install might be a good place to start. Let us know if you can't get it working.

-John

· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.