The problem with something like this:
agk::Print("Test 1" + agk::Str(test));
is that "Test 1" is constant in memory and returns a const char pointer. agk::Str() also returns char pointer and one thing you can not do in C/C++ is add two pointers.
Here's a solution:
// Main loop, called every frame
void app::Loop ( void )
{
int test = 1;
uString s("Test: ");
uString s2(agk::Str(test));
s += s2;
agk::Print("Hello World");
agk::Print(s);
agk::Sync();
}
You don't need to include anything extra as uString is appart of the AppGameKit libraries.
Quote: "if I do something like this it works."
I don't recommend programming like that (doesn't work on this end anyway). It doesn't work the way you think it does. Look up pointer arithmetic. What it's actually doing is offsetting the pointer.
Also, whenever creating a pointer, don't leave it uninitialised and then use it because you don't know what it's pointing to. If you can't think of something to assign it to upon declaration, assign it to null.
e.g
char *p = NULL;
I hope this isn't too baffling. C++ takes time to get used to and it's very specific. BASIC is far more lenient than C++ so it takes a while to get used to the strict rules.
If the strings are too much trouble and all you want to do is print them, you can also do this:
agk::PrintC("Test: "); agk::Print(agk::Str(1));
Hope this helps.