Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualMarusu

Posted 19 June 2012 - 12:48 AM

Hello,
now I use eclipse (with sequoyah) to write application with ndk for android.
I'm experiencing a strange problem where I can't succesfully include any classes into current cpp file which is invoked by android system.

My cpp fle looks like this:

#include "Core/Ghost.h"
#include "Multiplatform/PlatformAndroid.h"
#ifdef ANDROID
int g_nWidth, g_nHeight;
Ghost* ghost_;
Platform* platform_;
extern "C" {
void Java_com_ghost_Renderer_init(JNIEnv* env) {
  ghost_ = new Ghost();
}
void Java_com_ghost_Renderer_resize(JNIEnv* env, void* reserved, int w, int h) {
  ghost_->resize(w, h);
}
void Java_com_ghost_Renderer_render(JNIEnv* env, void* reserved) {
  ghost_->computeFrame();
}
};
#endif

Whenever I try to use variable "ghost_" I get "Undefined reference to Ghost::..."

Any Ideas what might be causing this?

[EDIT] Apparently it has something to do with mk file, because after adding Ghost.cpp to it, the error went from Ghost to Renderer object which is used in Ghost.cpp. Unfortunately even adding all files to mk file didn't solve the problem.
[EDIT2] It was a syntax error on Renderer object. Now it works. But still, does that mean, that whenewer I add new files to project, I will also have to add them to mk file?

Thank you,
Martin

#2Marusu

Posted 19 June 2012 - 12:30 AM

Hello,
now I use eclipse (with sequoyah) to write application with ndk for android.
I'm experiencing a strange problem where I can't succesfully include any classes into current cpp file which is invoked by android system.

My cpp fle looks like this:

#include "Core/Ghost.h"
#include "Multiplatform/PlatformAndroid.h"
#ifdef ANDROID
int g_nWidth, g_nHeight;
Ghost* ghost_;
Platform* platform_;
extern "C" {
void Java_com_ghost_Renderer_init(JNIEnv* env) {
  ghost_ = new Ghost();
}
void Java_com_ghost_Renderer_resize(JNIEnv* env, void* reserved, int w, int h) {
  ghost_->resize(w, h);
}
void Java_com_ghost_Renderer_render(JNIEnv* env, void* reserved) {
  ghost_->computeFrame();
}
};
#endif

Whenever I try to use variable "ghost_" I get "Undefined reference to Ghost::..."

Any Ideas what might be causing this?

[EDIT] Apparently it has something to do with mk file, because after adding Ghost.cpp to it, the error went from Ghost to Renderer object which is used in Ghost.cpp. Unfortunately even adding all files to mk file didn't solve the problem.

Thank you,
Martin

#1Marusu

Posted 18 June 2012 - 11:10 PM

Hello,
now I use eclipse (with sequoyah) to write application with ndk for android.
I'm experiencing a strange problem where I can't succesfully include any classes into current cpp file which is invoked by android system.

My cpp fle looks like this:

#include "Core/Ghost.h"
#include "Multiplatform/PlatformAndroid.h"
#ifdef ANDROID
int g_nWidth, g_nHeight;
Ghost* ghost_;
Platform* platform_;
extern "C" {
void Java_com_ghost_Renderer_init(JNIEnv* env) {
  ghost_ = new Ghost();
}
void Java_com_ghost_Renderer_resize(JNIEnv* env, void* reserved, int w, int h) {
  ghost_->resize(w, h);
}
void Java_com_ghost_Renderer_render(JNIEnv* env, void* reserved) {
  ghost_->computeFrame();
}
};
#endif

Whenever I try to use variable "ghost_" I get "Undefined reference to Ghost::..."

Any Ideas what might be causing this?

Thank you,
Martin

PARTNERS