How can I add C++ Source Files and Headers to a C# .Net project? -


this question has answer here:

i want make use of hidapi library home-brewed usb device. rather having compile vc++ project own .dll , reference in .net project have, prefer have code present within .net project , able reference directly.

the reason want avoid having .dll referencing .dll, , instead have single .dll file.

i've done in reverse, sort of, have used c# class within c++ program when doing jni stuff.

is trying here possible? there idiots guide using c++ in .net projects somewhere?

wait, there yes answer, it's evil:

how mix c# , c++ code in single assembly?

if c++ code not compiled /clr:safe (i.e. compiled /clr or /clr:pure), following:

1) compile c++ code .obj files

2) compile c# code .netmodule, using /addmodule reference c++ .obj files

3) link c# netmodule directly c++ object files using c++ linker create mixed language assembly

also this: linking native c++ c# applications

yeah, don't that.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -