Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » jni.h can't be found
jni.h can't be found [message #161701] Wed, 11 January 2006 17:00 Go to next message
Eclipse UserFriend
Originally posted by: c.m.valdivia.gmail.com

I just installed cdt in my eclipse (windows). I got it working for a
simple hello world. But I then tried the following code:

#include <iostream>
#include <jni.h>

using namespace std;

int main() {
cout << "Hello, world" << endl;
}

And the compile failed due to the #include <jni.h>. My compiler is MinGW.
I'm not sure what is happening. I've tried adding /jdk1.4.2_10/include
into the include system environment variable and played with the linker.
But I really don't know what I'm doing. I'm very new to c/c++. I searched
earlier posts, but nobody seemed to ask this particular question. Thanks
for any help.
Re: jni.h can't be found [message #161704 is a reply to message #161701] Wed, 11 January 2006 18:56 Go to previous messageGo to next message
Eclipse UserFriend
CDT 3.0.1? Right click on your project and select "Properties". Under
the GCC C++ Compilers you'll see "Directories". Click the Add button and
add your path. If you're adding the include directory, you'll probably
also have to include the win32 subdirectory, as jni.h just includes
another file from that directory. However, on my system, going to that
trouble just leads to yet other dependency problems. Bottom line, I
don't have this problem you're seeing as CygWin seemed to install enough
for mine to compile cleanly without specifying any beyond the default
set of directories. But at least now you know how to specify
directories... I hope that gets you further along.
--
RDS

carlos wrote:
> I just installed cdt in my eclipse (windows). I got it working for a
> simple hello world. But I then tried the following code:
> #include <iostream>
> #include <jni.h>
>
> using namespace std;
>
> int main() {
> cout << "Hello, world" << endl;
> }
>
> And the compile failed due to the #include <jni.h>. My compiler is
> MinGW. I'm not sure what is happening. I've tried adding
> /jdk1.4.2_10/include into the include system environment variable and
> played with the linker. But I really don't know what I'm doing. I'm very
> new to c/c++. I searched earlier posts, but nobody seemed to ask this
> particular question. Thanks for any help.
>
Re: jni.h can't be found [message #161732 is a reply to message #161704] Thu, 12 January 2006 10:36 Go to previous message
Eclipse UserFriend
Originally posted by: c.m.valdivia.gmail.com

Much appreciated. That did the trick.
Previous Topic:Mixed project
Next Topic:Variables Output
Goto Forum:
  


Current Time: Sun May 11 22:40:07 EDT 2025

Powered by FUDForum. Page generated in 0.15363 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top