H
H
hHup2018-04-04 21:57:10
C++ / C#
hHup, 2018-04-04 21:57:10

C++, working with .cpp?

#include <string.h>
#include "my_mega_pack_NativeCallsClass.h"

JNIEXPORT jint JNICALL Java_my_mega_pack_NativeCallsClass_printString
(JNIEnv * jenv, jobject jobj, jstring jstr) {

  const char *string = jenv->GetStringUTFChars(jstr, 0);
  const int size = (unsigned)strlen(string);
  printf("Первый в Dll \n");
  jenv->ReleaseStringUTFChars(jstr, string);
  return size;
};


JNIEXPORT void JNICALL Java_my_mega_pack_NativeCallsClass_printOne
(JNIEnv *jenv, jobject jobj){
  printf("DLL => You are called PrintOne \n");

};


JNIEXPORT void JNICALL Java_my_mega_pack_NativeCallsClass_printTwo
(JNIEnv * jenv, jobject jobj, jint num) {
  printf("DLL => You are called PrintTwo with input param: %d\n ", num);
};

This is a file, and I compile the .h file into a Dll library, and after I work with it in Java code, the question is, can I call other c++ classes written by me from the code above, if so, will they compile are they in Dll too?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question