Guess I should have searched for the awnser then
Looks like I managed to compile the template and it is running on my device, now I just have to add my own code to it. Thanks for the help as allways.
Also, to get the extras library, you have to install it thru the SDK manager unless you have done that before. Just a note for anyone else trying to do this. I think I will add this to the template wiki because that has been the best source of information about this
Edit: Looks like im not out of the water yet, when I try to compile the app thru cygwin, it seems like none of the #includes for my own classes has worked.
This is the log.txt file:
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function app::~app():jni/template.h:15: error: undefined reference to 'Player::~Player()'
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function app::~app():jni/template.h:15: error: undefined reference to 'World::~World()'
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function app::~app():jni/template.h:15: error: undefined reference to 'World::~World()'
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function app::Begin():jni/template.cpp:23: error: undefined reference to 'WD::setupData()'
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function app::Begin():jni/template.cpp:26: error: undefined reference to 'Player::begin()'
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function app::Loop():jni/template.cpp:32: error: undefined reference to 'I::update()'
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function app::Loop():jni/template.cpp:68: error: undefined reference to 'GF::updateTime()'
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function app::Loop():jni/template.cpp:43: error: undefined reference to 'Player::getX()'
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function app::Loop():jni/template.cpp:43: error: undefined reference to 'Player::getY()'
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function app::Loop():jni/template.cpp:45: error: undefined reference to 'Player::update()'
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function app::Loop():jni/template.cpp:57: error: undefined reference to 'World::load()'
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function app::Loop():jni/template.cpp:63: error: undefined reference to 'Player::Spawn()'
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function app::Loop():jni/template.cpp:65: error: undefined reference to 'Player::load()'
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function app::Loop():jni/template.cpp:48: error: undefined reference to 'World::generate(int)'
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function app::Loop():jni/template.cpp:53: error: undefined reference to 'GF::speedMod'
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function app::Loop():jni/template.cpp:53: error: undefined reference to 'I::pTX'
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function app::Loop():jni/template.cpp:53: error: undefined reference to 'I::pTY'
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function _GLOBAL__sub_I_template.cpp:jni/template.h:20: error: undefined reference to 'World::World()'
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function _GLOBAL__sub_I_template.cpp:jni/template.h:20: error: undefined reference to 'Player::Player()'
C:/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/android_player/template.o: in function _GLOBAL__sub_I_template.cpp:jni/template.h:20: error: undefined reference to 'World::~World()'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/libandroid_player.so] Error 1
And this is the template.h file which I believe is the problem
#ifndef _H_APP
#define _H_APP
// Include AGK libraries
#include "agk.h"
//App includes
#include "GF.h"
#include "World.h"
#include "Player.h"
#include "WD.h"
#include "I.h"
// Global values for the app
class app
{
public:
// constructor
app() { memset ( this, 0, sizeof(app)); }
// main app functions - mike to experiment with a derived class for this..
void Begin( void );
void Loop( void );
void End( void );
protected:
World world;
private:
bool debug; //True if the debug info should be displayed
int programState;
Player player;
};
extern app App;
#endif
The first error I get says that it can't find the constructor/deconstructor for the Player class when I create the object "player".
This is the player class
#pragma once
#include "agk.h"
#include <vector>
#include "World.h"
#include "Tile.h"
#include "Waypoint.h"
#include "I.h"
class Player
{
public:
Player(void);
~Player(void);
void begin(); //Function which acts as a constructor while the issues with them persist
void Spawn();
void update();
void load();
float getX();
float getY();
//Pointer to the world
World* world;
std::vector<Waypoint>* path;
private:
//Media variables
int joystick;
int SID;
//Position variables
float x;
float y;
int tileX;
int tileY;
float angle;
int spawnX;
int spawnY;
bool hasPath; //True if the player has a path to walk which is generated by the pathfinder
int cWaypoint; //The current waypoint on the path
float speed;
};
All of the cpp / h files are in the jni directory which as far as I know is where I should put them. Have I done something wrong or is cygwin/gcc (im guessing GCC is the comiler we are using) more strict than visual studio when it comes to including things?