Cl.exe and mt.exe but got "...MSVCR80.dll was not found. Re-installing..."

The compile and manifest were completed with no complaints but when I ran the code, I got "This application has failed to start because MSVCR80.dll was not found. Re-installing the application may fix this problem.".
Here is what I did:
Step 1: Compile and manifest
"%MSVCDir%\bin\cl.exe" /I"%JAVA_HOME%\include" /I"%JAVA_HOME%\include\win32" /MD /LD /FeBinless.dll ../info/binless/jni_binless.c ../jni_shared/jni_gen_c.c ../jni_entropy/jni_entropy_c.c ../jni_input/jni_input_c.c ../info/binless/binless_c.c ../../info/binless/BinlessOpenComp.c ../../info/binless/BinlessWarpComp.c ../../info/binless/BinlessEmbedComp.c ../../info/binless/BinlessInfoComp.c ../../shared/MatrixToHist2DComp.c ../../shared/Info2DComp.c ../../shared/sort_c.c ../../shared/gen_c.c ../../shared/hist_c.c ../../input/input_c.c ../../entropy/entropy_c.c ../../entropy/entropy_bub_c.c ../../entropy/entropy_chaoshen_c.c ../../entropy/entropy_ma_c.c ../../entropy/entropy_tpmc_c.c ../../entropy/entropy_jack_c.c ../../entropy/entropy_plugin_c.c ../../entropy/entropy_ww_c.c ../../entropy/variance_jack_c.c ../../entropy/variance_boot_c.c ../../entropy/entropy_nsb_c.cpp /link libxml2.lib libgsl.a libgslcblas.a >> binless-out.txt
mt.exe -manifest Binless.dll.manifest -outputresource:Binless.dll;2
The operating system is Windows XP and has the following environment variables:
PATH=%JAVA_HOME%\bin;%LIBXMLDir%\bin;%ICONVDir%\bin;%GNUWINDir%\bin;%WINSDKDir%\bin;%MSVCDir%\bin;%MSVCDir%\..\Common7\IDE;%ZLIBDir%\bin;%systemroot%\system32;%systemroot%;%systemroot%\system32\wbem
INCLUDE=%WINSDKDir%\include;%GNUWINDir%\include;%MSVCDir%\include;%MSVCDir%\PlatformSDK\include;%JAVA_HOME%\include;%JAVA_HOME%\include\win32;%LIBXMLDir%\include;%ICONVDir%\include;%ZLIBDir%\include
LIB=%WINSDKDir%\lib;%GNUWINDir%\lib;%MSVCDir%\lib;%MSVCDir%\PlatformSDK\lib;%LIBXMLDir%\lib;%ICONVDir%\lib;%ZLIBDir%\lib
where:
GNUWINDir=c:\project\lib\GnuWin32
ZLIBDir=c:\project\lib\zlib
ICONVDir=c:\project\lib\iconv
LIBXMLDir=c:\project\lib\libxml2
WINSDKDir=C:\Program Files\Microsoft SDKs\Windows\v6.0A
MSVCDir=C:\Program Files\Microsoft Visual Studio 9.0\VC
Step 2: Compile the Java jni code
javac -d ..\classes ..\server\Binless.java
Step 3: Run the code
java -classpath ..\classes jni.test.test_binless
Got: This application has failed to start because MSVCR80.dll was not found. Re-installing the application may fix this problem.
Any help is greatly appreciated. Thanks.

This is a Windows side-by-side issue not a JNI issue. As such it doesn't really
belong in this forum except as an object lesson to people who create JNI's.
I had these issues when I moved to Visual Studio 2005 - which, oddly enough,
was the version of the IDE where SxS support was not only introduced, but
enforced.
The fact that you tried to put a SxS folder in the PATH tells me you know
nothing about how SxS and manifests works. You need to learn about these
things and then your problems will become blushingly obvious.
The Binless.dll manifest must be embedded, and it must contain dependency
entries that specify the SxS requirements, including the version(s) of the
dependent libraries. Secondly, the specific version of the libraries must be
installed on the target system.
My guess is your manifest specifies a CRT version that's not installed on your
system and that is why the system is complaining. Look for the
Binless.dll.intermediate.manifest file. It will tell you what your dll expects.
Here's an example of a dll (debug version) manifest:
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level='asInvoker' uiAccess='false' />
      </requestedPrivileges>
    </security>
  </trustInfo>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.VC90.DebugCRT' version='9.0.30729.4148' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.VC90.DebugMFC' version='9.0.30729.4148' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type='win32' name='Microsoft.VC90.ATL' version='9.0.30729.4148' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
    </dependentAssembly>
  </dependency>
</assembly>Get [Dependency Walker|http://www.dependencywalker.com/] it's free. You will need it at some point.
Cheers,
Mike

Similar Messages

Maybe you are looking for

  • Error while posting messages to SOAP sender adapter SP 13

    Hi Friends,                 I have configured a SOAP sender adapter in XI 3.0 and is using the URL http://host:port/XISOAPAdapter/MessageServlet?channel=:BS_WEBSERVICE:CC_WEBSERVICE_SOAP to post the messages. When I open the URL in the browser I am g

  • URGENT: REGARDING SMART FORM CALLING FROM REPORT

    HI, I had made a report in which i have to display the output in smart form ,the problem is this i had delclared only 1 INTERNAL TABLE and i dont know how to display it in the smart form as i am new to it . if help me out with solution ,he or she wil

  • How do you delete On The Go playlists?

    I accidentely added like 4 playlists to On-The-Go...how do I delete them? Thanks.

  • OT: 2 Video card - Macpro quad

    Has anyone tried hooking up 4 monitors to one of the babies yet?

  • Modify LabelGraphics.js to extract other XMP metadata from images

    This script works flawlessly. However, I would like to be able to extract other XMP metadata than just //XMP description         case 2:             try{                 myLabel = myLink.linkXmp.description;             catch(myError){