LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup

  • Thread starter Richards via DotNetMonster.com
  • Start date
R

Richards via DotNetMonster.com

This subject appears on a number of old threads, but I didn't find a solution
among these threads.

I found a solution (relevant to my project) in the .NET 2003 help program. I
searched using the keyword "noentry".

As a convenience, I reprint the relevant part here:

To convert the managed DLL to mixed mode --

1)Link with /NOENTRY. In Solution Explorer, right-click the project node and
click Properties. In the project's Property Pages dialog box, click Linker,
and then click Command Line. Add this switch to the Additional Options field.


2) Link msvcrt.lib. In the project's Property Pages dialog box, click Linker,
and then click Input. Add msvcrt.lib to the Additional Dependencies property.


3)Remove nochkclr.obj. On the Input page (same page as previous step), remove
nochkclr.obj from the Additional Dependencies property.

4) Link in the CRT. On the Input page (same page as previous step), add
__DllMainCRTStartup@12 to the Force Symbol References property.

Hope this helps someone.

Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top