[Erledigt] JNI Linkproblem

Ich kämpf gerade mit JNI rum und irgendwie will das gerade nicht so wie ich es will.
Die Bibliothek lief, bis ich eine 2. Methode eingebaut hab. Seitdem kann ich sie nicht mehr überreden zu funktionieren.

  static
  {
    System.loadLibrary("Application");
  }

  public WindowsApplication()
  {
    // System.getProperties().list(System.out);
    systemtraymenu = SystemTray.getDefaultSystemTray();
  }


  public native String getUserSaveDir();

  public native String getSystemSaveDir();

C++ Datei


#include <shlobj.h>
#include "WindowsInfos.h"
//#include "stdafx.h"
//#ifdef __cplusplus
//extern "C" {
//#endif


JNIEXPORT jstring JNICALL Java_de_eagleside_util_application_WindowsXPApplication_getUserSaveDir
  (JNIEnv * env, jobject){
	TCHAR path[255];
	SHGetFolderPath( NULL, CSIDL_LOCAL_APPDATA, 
				 NULL, 0, path );
	return env->NewStringUTF(path);
	
}


JNIEXPORT jstring JNICALL Java_de_eagleside_util_application_WindowsXPApplication_getSystemSaveDir
(JNIEnv *env, jobject){	
	TCHAR path[255];
	SHGetFolderPath( NULL, CSIDL_COMMON_APPDATA, 
				 NULL, 0, path );
	return env->NewStringUTF(path);
	
}
//#ifdef __cplusplus
//}
//#endif

Header

#include <jni.h>
/* Header for class de_eagleside_util_application_WindowsApplication */

#ifndef _Included_de_eagleside_util_application_WindowsApplication
#define _Included_de_eagleside_util_application_WindowsApplication
#ifdef __cplusplus
extern "C" {
#endif
#undef de_eagleside_util_application_WindowsApplication_SINGLETON_APPLICATION_DISABLE
#define de_eagleside_util_application_WindowsApplication_SINGLETON_APPLICATION_DISABLE 0L
#undef de_eagleside_util_application_WindowsApplication_SINGLETON_APPLICATION_DO_NOTHING
#define de_eagleside_util_application_WindowsApplication_SINGLETON_APPLICATION_DO_NOTHING 1L
#undef de_eagleside_util_application_WindowsApplication_SINGLETON_APPLICATION_PARSE_ARGUMENTS
#define de_eagleside_util_application_WindowsApplication_SINGLETON_APPLICATION_PARSE_ARGUMENTS 2L
/*
 * Class:     de_eagleside_util_application_WindowsApplication
 * Method:    getUserSaveDir
 * Signature: ()Ljava/lang/String;
 */
JNIEXPORT jstring JNICALL Java_de_eagleside_util_application_WindowsApplication_getUserSaveDir
  (JNIEnv *, jobject);

/*
 * Class:     de_eagleside_util_application_WindowsApplication
 * Method:    getSystemSaveDir
 * Signature: ()Ljava/lang/String;
 */
JNIEXPORT jstring JNICALL Java_de_eagleside_util_application_WindowsApplication_getSystemSaveDir
  (JNIEnv *, jobject);

#ifdef __cplusplus
}
#endif
#endif

Achja und das alles läuft auf Windows und soll mit VS6 kompiliert werden.

Wie saß denn vorher aus (hab mich auch schon oft mit JNI “rumgeärgert”)? Und wann tritt der Fehler auf?

Vorher war nur eine Methode drin, sonst war es identisch.
Der Fehler tritt auf wenn ich die beiden Methoden meiner Klasse aufrufen will.

Aber die richtige DLL wird schon geladen!?

Jo sonst würde er ja sagen das er die nicht findet :wink:
Er meckert nur über den Methodenaufruf.

Verdammt, Header und CPP waren nicht synchron :smiley:
Ich hatte die Klasse geändert, jetzt gehts.

HeHe, sowas hatte ich schon vermutet :smiley: