Creating an unmanaged C ++ DLL using VS2010

I created a dll project in VS2010 (Win32 console application> dll). I put some header files in the project, when I compile, I get this error:

error LINK2001: unresolved external symbol _dllmaincrtstartup@12 

What is it? How to fix it? Header files also define several abstract classes.

+4
source share
2 answers

Q: This is a .dll that cannot build (and not a .exe that uses a .dll), right?

Q: Is there anything in your .dll source with DllMain ()?

If not, can you add one?

Q: Are you sure that the project settings are configured for the "DLL"? For "/ MT" (multi-threaded static link)?

Q: Otherwise, do you plan to create a new project by creating a "hello world" .dll and checking that it builds?

-1
source

Use the / NOENTRY option , which is required to create the resource library . Use this parameter to prevent LINK from linking the _main link in the DLL.

Project Properties Pages -> Linker -> Advanced: No Entry Point set to Yes (/ NOENTRY)

"A DLL containing objects compiled with / clr is not associated with / NOENTRY , the image may not work correctly" http://support.microsoft.com/kb/814472

0
source

Source: https://habr.com/ru/post/1385693/


All Articles