• C

in something not a structure or union

Do we need to set up anything to avoid getting this message?
request for member `GetStringUTFChars' in something not a
structure or union????

D:\HelloWorld\src>gcc -c -o
HelloWorld.o -ID:/jbuilderX/jdk1.4/include -ID:/jbuilderX/jdk1.4/include
/win32 HelloWorldImp.c
HelloWorldImp.c: In function `Java_HelloWorld_checkProcess':
HelloWorldImp.c:49: request for member `GetStringUTFChars' in something not
a structure or union
HelloWorldImp.c:51: request for member `FindClass' in something not a
structure or union
HelloWorldImp.c:54: request for member `ReleaseStringUTFChars' in something
not a structure or union

HelloWorldImp.c:62: request for member `ReleaseStringUTFChars' in something
not a structure or union
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sjef BosmanGroupware ConsultantCommented:
Are you compiling Java with C compiler? You use dot-notation, so the C-compiler thinks you refer to structure or union members. I might be completely off, though...
JoseripAuthor Commented:
when compiling the  c program with dev-cpp this error is generated and trying to kill the
process which is running through c by creating dll  to access in java ..
Sjef BosmanGroupware ConsultantCommented:
Could you show us some code?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jaime OlivaresSoftware ArchitectCommented:
I guess you are trying to accesss java strings, usual way is to use something like this:

c_string = (*javaEnv)->GetStringUTFChars(javaEnv, java_string, 0);

    c_string is char * type
    javaEnv is JNIEnv * type
    java_string is jstring type

So maybe the problem is with 'env' structure

I think you have an extra dereference in there.  You should be able to say

   javaEnv->GetStringUTFChars(javaEnv, java_string, 0);

This is true in C as well as C++ because of some very clever struct design.  Basically, in C the env structure has a method table built into it.  Check out jni.h when you get a chance.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.