Home>

I want to call a C ++ dynamic library from a C # project in Visual Studio 2019 (Version 16.5.4).

I can only find the information in my old Visual Studio and when I try that method I get an error.

For example in Visual Studio 2015
Link content  

When I try this, the following error appears and I cannot build.

  

Error LNK2019 The unresolved external symbol _main was referenced in the function "int __cdecl invoke_main (void)" (? Invoke_main @@ YAHXZ). Library C: \ Users \ [username] \ source \ repos \ Application \ Library \ MSVCRTD.lib (exe_main.obj)

How can I do it in Visual Studio 2019?

  • Answer # 1

      

    For example, with Visual Studio 2015 (ttps: //qiita.com/TackKaiware/items/27ebcf10bb2624db197a.)
      When I try this, the following error appears and I cannot build.

    I tried it with VS2019 as written in the URL.

    ... not reproduced. It worked properly.