A strange mistake !! When C ++/CLIProgramAfter native Lib is referenced for compilation, the following error may occur during program startup:
This is a known bug in ms. cause:
The reason why you get this error is that a winforms application has a managed entry point. the initialization of the native global objects is done by the CRT (C Runtime) startup routine. since in this case there is no CRT startup routine the myboard global object fails to initialize correctly.
IDE is specific the entry of managedapp as "Main". However, using "Main" will bypass a lot of CRT's startup initialization.
Solution:
Right-click Project ---> properties ---> link ---> advanced
Change the entry point from main "? Maincrtstartupstrarray $ fymhp $ 01ap $ aavstring @ system @ Z"
Principle:
That shoshould re-enable the CRT startup code which initializes the internal CRT variables. that symbol is really the mangled name for "int _ clrcall maincrtstartupstrarray (CLI: array <class system: String ^> ^ )".
-----------------------------------------------------------------
I wasted a night on this problem .............