Jump to content

  • Log In with Google      Sign In   
  • Create Account


"Undefined reference to" error on NDK


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 SM ForeveR   Members   -  Reputation: 138

Like
0Likes
Like

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?

[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

Edited by Marusu, 19 June 2012 - 12:48 AM.


Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS