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

Discussion in 'Java' started by Murrgon, Jun 8, 2004.

  1. Murrgon

    Murrgon Guest

    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
     
    Murrgon, Jun 8, 2004
    #1
    1. Advertising

  2. Murrgon

    Murrgon Guest

    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.
     
    Murrgon, Jun 8, 2004
    #2
    1. Advertising

  3. 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
     
    Gordon Beaton, Jun 8, 2004
    #3
  4. Murrgon

    Roedy Green Guest

    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.
     
    Roedy Green, Jun 9, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rmac
    Replies:
    2
    Views:
    1,033
  2. Replies:
    0
    Views:
    346
  3. Eric
    Replies:
    8
    Views:
    457
    Ed Morton
    Apr 10, 2004
  4. Adam
    Replies:
    29
    Views:
    721
    srepmub
    Apr 3, 2009
  5. Adam
    Replies:
    3
    Views:
    301
    R. David Murray
    Mar 18, 2009
Loading...

Share This Page