title: Using managed code without using the '/clr' option on the calling Unmanaged C++
body: <p>I created a basic C++/CLI library, it has two classes. One is supposed to be the unmanaged wrapper that will be called through by regular C++ implementation. The CLI project builds correctly but when I try to call it I get the error: "C1190: managed targeted code requires a '/clr' option".
  I don't want to use the clr option on the C++ implementation. Am I doing something wrong?</p>
  
  <p>C++/CLI code:</p>
  
  <p><strong>ProcessorNative.cpp</strong></p>
  
  <pre><code>#include "StdAfx.h"
  #include &lt;vcclr.h&gt;
  #using &lt;mscorlib.dll&gt;
  #include "PreProcessorNative.h"
  #include "PreprocessorWrapper.h"
  
  namespace PreprocessorWrapper{
      PreProcessorNative::PreProcessorNative(){}
  
      PreProcessorNative::~PreProcessorNative(){}
  
      double PreProcessorNative::Test(double d){
          gcroot&lt;PreprocessorWrapper^&gt; _preProcessor = gcnew PreprocessorWrapper();
          return _preProcessor-&gt;Test(d);
      }
  }
  </code></pre>
  
  <p>ProcessorNative.h</p>
  
  <pre><code>namespace PreprocessorWrapper {
      public class __declspec(dllexport) PreProcessorNative
      {
      public:
          PreProcessorNative();
          ~PreProcessorNative();
          double Test(double p);
      };
  }
  </code></pre>
  
  <p>PreprocessorWrapper.h</p>
  
  <pre><code>namespace PreprocessorWrapper {
  
      public ref class PreprocessorWrapper
      {
      private:
  
      public:
          PreprocessorWrapper();
          double Test(double p);
      };
  };
  </code></pre>
  
  <p>PreprocessorWrapper.cpp</p>
  
  <pre><code>#include "stdafx.h"
  #include "PreprocessorWrapper.h"
  
  namespace PreprocessorWrapper{
      PreprocessorWrapper::PreprocessorWrapper(){
  
      }
  
      double PreprocessorWrapper::Test(double p){
          return p*p;
      }
  }
  </code></pre>
  
  <p>Regular C++ code:</p>
  
  <pre><code>#include "..\Preprocessor_Wrapper\PreprocessorNative.h"
  /*Just with the include I get the error, even before I try to use the class*/
  </code></pre>
  
  <p>P.S. I already added the .obj file path to the linker on the C++ project.</p>