The problem with the DLL linker

I compile the DLL twice (once for x86, once for x64) and I set / ENTRY to "DllMain". I use the / MT runtime library option to statically bind to the runtime library. All this works great when creating an x86 assembly, but the x64 assembly fails:

error LNK2019: unresolved external symbol main referenced in function __tmainCRTStartup
{project directory}\LIBCMT.lib(crt0.obj)

Why does this work for x86 build and not for x64 build? Is something missing here?

+3
source share
2 answers

, : , : "" DllMain, , ( ), . , CRT.

dll CRT, . , , , .

, , dll CRT ( ), CRT , (/NODEFAULTLIB). , , (, Windows API), , ++ ( , , RTTI).
+1

, , DLL x64- ( , /DLL) - main, , ?

0

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


All Articles