I am getting compiler error D8045. cannot compile C file 'serialcommands.c' with the /clr option.
This file is a C library that has been written to talk over a serial port to a TI processor. The task that I need to do is wrap this library with a CLR wrapper (there will be additional questions posted to stackoverflow concerning marshalling data back and forth if you want some more easy points from CLI questions.)
I just want to use this C library from my CLR wrapper. I went to Properties->Configuration Properties->C/C++->General->Compile with Common Language runtime support = No Common Language Runtime support
Is this the correct way to do this? Will I experience nasty weird bugs later or are other things that I need to do to use this?
Yes. You need to compile any C objects without /CLR, since the clr only understands classes and objects.
You can still use them from your C++/CLI project, wrapped inside of your "ref class" objects. This is a normal way of wrapping a C api in .NET objects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With