I am trying to set my settings in Visual Studio such that I can write managed C++
code to be called later by a C#
program. I start with a new C++
project and here are the settings that I have changed and why:
- Precompiled Headers to
not using precompiled headers
. As I just would rather not. - Common Language Runtime Support to
/clr
. As I understand it this is fundamentally needed. - Debugging Information Format from
/ZI
tonone
. As/clr
and/ZI
are incompatible - Enable minimal rebuild to
no
. As/clr
and/Gm
are incompatible. - Basic runtime checks to
default
. As/clr
and/RTC1
are incompatible.
After all this I now come across many C2760 error codes located in xlocale
or xlocnum
. The error specifically states
syntax error: unexpected token 'identifier', expected 'catch'
Now, I am an extreme beginner here so maybe this is trivial and if so I apologize. My goal is to write a simple c++ class
, wrap it with managed code, and have a DLL
that I can link with a c#
program later.
When I look at the MSDN Documentation page, all they say is to compile with /clr
and /LD
. Well there is no /LD
option that I am able to find either, and I know that the /LD
option is to create the DLL
which is important. Any help or guidance would be greatly appreciated.
P.S. This is Visual Studio Community 2017