title: LINK: fatal error LNK 1104: cannot open file 'LIBCMT.lib'
body: <p>Please help, I have spent all day trying to make my c++ app compile.</p>
  
  <p>My project contains one source file: Foo.cpp.  Here is its code:</p>
  
  <pre><code>#include &lt;jni.h&gt;
  #include &lt;com_Foo.h&gt;
  
  JNIEXPORT jint JNICALL Java_com_Foo_add
  (JNIEnv * env, jobject obj, jint x, jint y)
  {
      return x+y;
  }
  </code></pre>
  
  <p>as you can see I was trying to use JNI, but I don't think that has anything to do with the problem.  Here is what I tried on the command line:</p>
  
  <pre><code>C:\Users\michael\cworkspace\foo&gt;cl -LD Foo.cpp -FeFoo.dll
  Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
  Copyright (C) Microsoft Corporation.  All rights reserved.
  
  Foo.cpp
  Microsoft (R) Incremental Linker Version 10.00.30319.01
  Copyright (C) Microsoft Corporation.  All rights reserved.
  
  /dll
  /implib:Foo.lib
  /out:Foo.dll
  Foo.obj
  LINK : fatal error LNK1104: cannot open file 'LIBCMT.lib'
  </code></pre>
  
  <p>In my environment I have set: </p>
  
  <p>INCLUDE:
  C:_\include;C:\frankenstein\includes;C:\Program Files\Java\jdk1.6.0_24\include;C:\Program Files\Java\jdk1.6.0_24\include\win32;C:_\include\win32;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include</p>
  
  <p>LIBPATH:
  C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib</p>
  
  <p>I checked in the lib directory, it contains a "libcmt.lib" file.  Don't know if it is case sensitive, but I know that I never changed anything in the visual studio files or directories.</p>
  
  <p>Would somebody please tell me how I can make this work?</p>