How do I get javah.exe to not mangle the function names?

M

Murrgon

I am using javah.exe (Win2K platform) to generate function
prototypes for interfacing with java. If I run it from the
command line, it seems to work fine. However, I have set up
a custom build step in my project in VC6 and Javah.exe is
now generating function names that look like this:

JNIEXPORT jfloat JNICALL Java___0005cDebug_0005cInterface_GetTimeValue
(JNIEnv *, jobject);

When I run directly from the command line, I get this:

JNIEXPORT jfloat JNICALL Java_Interface_GetTimeValue
(JNIEnv *, jobject);

Here are my custom build rules:
javac -d $(OutDir) $(InputPath)
javah -o $(ProjDir)\JavaInterface\$(InputName).h $(OutDir)\$(InputName)

Now I want to know why the heck it is inserting "__0005cDebug_0005c"
into the names and how I can get rid of it.

Thanks
Murrgon
 
M

Murrgon

Murrgon said:
Now I want to know why the heck it is inserting "__0005cDebug_0005c"
into the names and how I can get rid of it.

Nevermind, i fixed it using the -classpath option for javah.exe.
 
G

Gordon Beaton

I am using javah.exe (Win2K platform) to generate function
prototypes for interfacing with java. If I run it from the command
line, it seems to work fine. However, I have set up a custom build
step in my project in VC6 and Javah.exe is now generating function
names that look like this:

JNIEXPORT jfloat JNICALL Java___0005cDebug_0005cInterface_GetTimeValue
(JNIEnv *, jobject);
Now I want to know why the heck it is inserting "__0005cDebug_0005c"
into the names

Because you told it to.
and how I can get rid of it.

javah needs the fully qualified name of the *class*, not the name of
the class *file*. Unless I'm mistaken, \u005c is a baskslash, which
seems to be part of a filename passed to javah.

Without knowing the contents of the variables in your custom build
rules, it's hard to be more specific. But if you display the actual
command line generated I'm sure you'll see a difference between that
and the one you ran manually.

/gordon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top