0
votes

I'm creating a mixed mode C++ assembly. The assembly contains pointers to C++ unmanaged types and all the classes are C++/CLI types.

I have the option /clr on. However, whenever I build the DLL I get the warning:

warning LNK4044: unrecognized option '/clr'; ignored

This warning doesn't make sense to me as if I turned the /clr off it obviously could not be compiled as native c++ code. So how can the /clr option be unrecognized and ignored?

2

2 Answers

3
votes

/clr is a compiler flag, not a linker flag. (The fact that you're getting a LNK???? error indicates that you're attempting to pass this flag to the linker.)

0
votes

If you are working from inside Visual Studio then all you have to do is right click on the project and Configuration Properties -> General. Then on the right hand side under Project Details set "Common Language Runtime support" to "Common Language Runtime Support (/clr)". This will create a mixed mode C++ project.

This will not add the /clr flag to the linker.