June 30th, 2009, 06:27 PM
How to use an unmanaged C library from a VC++ CLI project
I need to access two external APIs: one a native C interface (no classes), the other a C# .NET assembly. I have build a CLI Windows Forms project in VC++ 2008 that can access the .NET assembly.
When I attempt to link the LIB file for the native DLL, I get the message,
LNK1313: ijw/native module detected; cannot link with pure modules
I have tried different compiler and linker settings of /CLI, but without success.
Tried: Options>Linker>Advanced>CLRImageType = Force IJW (was Default) & rebuild
Result: fatal error: LINK1309: pure module detected AssemblyInfo.cpp
Tried: AssemblyInfo.cpp > Options > C/C++>General>Compile with CLR support = /clr (was /clrure)
Result: command-line option '/clrure' inconsistent with precompiled header
How do I force the precomipled header to recompile? Build <solution> didn't work.
Am I going about this the right way?
Is there some header, assembly, compiler option, #pragma statement or other step that I am missing for mixing managed C++ with an unmanaged C library?
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.