Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How do I get javah.exe to not mangle the function names?

Reply
Thread Tools

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

 
 
Murrgon
Guest
Posts: n/a
 
      06-08-2004
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
 
Reply With Quote
 
 
 
 
Murrgon
Guest
Posts: n/a
 
      06-08-2004
Murrgon wrote:
> 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.
 
Reply With Quote
 
 
 
 
Gordon Beaton
Guest
Posts: n/a
 
      06-08-2004
On Tue, 08 Jun 2004 12:24:26 -0400, Murrgon wrote:
> 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

--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      06-09-2004
On Tue, 08 Jun 2004 12:24:26 -0400, Murrgon <>
wrote or quoted :

>JNIEXPORT jfloat JNICALL Java___0005cDebug_0005cInterface_GetTimeValue


See http://mindprod.com/jgloss/jni.html

you are not invoking Javah correctly.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IDE seems to mangle html 4.0 entities Xavier J ASP .Net 1 11-13-2009 08:50 AM
Mangle function name with decorator? Adam Python 29 04-03-2009 01:11 PM
Re: Mangle function name with decorator? Adam Python 3 03-18-2009 05:22 PM
Why Does C++ Name-Mangle Identifiers? Karl Heinz Buchegger C++ 20 11-05-2004 10:31 AM
utility to intentionally mangle function names? Eric C Programming 8 04-10-2004 07:29 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57