I have this issue with other pages.... I have this in charactr.h
#pragma once
class charactr
{
public:
//Functions
charactr();
void CreateBall();
//Variables
int charc;
};
I have this in character.cpp
#include "charactr.h"
#include "template.h"
void charactr::createBall()
{
agk::LoadImage(1, "RedBall.png");
agk::CreateSprite(1,1);
agk::SetSpriteSize(1,15.0,15.0);
agk::SetSpriteOffset( 1,7.5,7.5);
agk::SetSpritePositionByOffset(1,25,25);
agk::Print("It Works");
}
I then tried to put the function into the main program
// Includes, namespace and prototypes
#include "template.h"
#include "charactr.h"
using namespace AGK;
app App;
// Begin app, called once at the start
void app::Begin( void )
{
agk::SetDisplayAspect(-1);
int keyboard=agk::GetKeyboardExists();
if (keyboard!=1){
agk::AddVirtualJoystick(2,85.0,85.0,15.0);
agk::AddVirtualButton(1, 10, 90, 10 );
createBall();
}
}
// Main loop, called every frame
void app::Loop ( void )
{
agk::Sync();
}
// Called when the app ends
void app::End ( void ){
Eclipse says it's fine but Cygwin gives this error:
$ /cygdrive/c/Android/android-ndk-r8c/ndk-build 2>log.txt
Compile arm : android_player <= main.c
Compile++ arm : android_player <= Core.cpp
Compile++ arm : android_player <= template.cpp
/cygdrive/c/Android/android-ndk-r8c/build/core/build-binary.mk:263: recipe for target `obj/local/armeabi/objs/android_player/template.o' failed
and log.txt says:
jni/template.cpp: In member function 'void app::Begin()':
jni/template.cpp:14:13: error: 'CreateBall' was not declared in this scope
make: *** [obj/local/armeabi/objs/android_player/template.o] Error 1
I've tried everything and tried to emulate this post with character.cpp and character.h and android.mk which is all the info it had:
http://forum.thegamecreators.com/?m=forum_view&t=201167&b=46
Thanks in advance for the help!!!!!