I am creating a C# console application in .NET 5 that loads a C++ library that I am also writing
When I go to compile this code on linux, how can I compile the C++ library with the flag that allows for CLR support?
I am creating a C# console application in .NET 5 that loads a C++ library that I am also writing
When I go to compile this code on linux, how can I compile the C++ library with the flag that allows for CLR support?
If you are targeting Linux, then you need to P/Invoke into the C++ library. There would be no compiler option as the C++ library would be an ordinary native library; there wouldn’t be any CLR code contained within it. No other way to do this using Visual Studio.
The situation is different if you are targeting Windows using VS. In that case, the C++ code could be written as C++/CLI (mixed code) which would require a special compiler option to handle the CLR library calls in the library.