JNI HELP URGENT -- Problem when calling C++
Hi
I am creating one TempCalcJava file
class TempCalcJava {
public native void displayHelloWorld();
static {
System.loadLibrary("hello");
}
public static void main(String[] args) {
new TempCalcJava().displayHelloWorld();
}
}
and i create .class and .h file for this java file
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class TempCalcJava */
#ifndef _Included_TempCalcJava
#define _Included_TempCalcJava
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class:TempCalcJava
* Method:displayHelloWorld
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_TempCalcJava_displayHelloWorld
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif
and i create one .CPP file
#include <jni.h>
#include "TempCalcJava.h"
#include <iostream.h>
#include <stdio.h>
#include <math.h>
JNIEXPORT void JNICALL Java_TempCalcJava_displayHelloWorld(JNIEnv *, jobject)
{
cout<<" Hello C++ ";
}
When i creating the .dll for this .CPP file i got this error
C:\Program Files\Microsoft Visual Studio 8\VC>cl -Ic:\j2sdk1.4.2_09\include -Ic:
\j2sdk1.4.2_09\include\win32 -LD C:\Anand\Workcpp\TempCalcJavas.cpp -Fehello.dll
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
TempCalcJavas.cpp
C:\Anand\Workcpp\TempCalcJavas.cpp(1) : fatal error C1083: Cannot open include f
ile: 'iostream.h': No such file or directory
Any one give solution for this ?
I want to call c++ using JNI.

