简体   繁体   中英

Using c# interface in a c++ project with VS express 1013

I am trying to include ac# interface into a c++ header file which belongs to a clr library. I add the additional directory and as soon as I include the interface and try to build the c++ project, I get loads of errors leading to the cs file, like:

在此处输入图片说明

Do I mess up some VS settings?

It is impossible to #include "IImagesToVideoConverter.cs". The C++ compiler cannot understand c# code. You need to put ac# project and a c++ project in the same solution, reference the c# project from the c++ project, and (i think) #using <the.dll>

including a C# source in a C++ compile makes no sense. They are different languages, why would you ever expect this to work?

Perhaps you want to make a COM interface between them, in which case you use a #import directive.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM