when i complie it dosent seem to fint my box2d.h.
the game compiles for android and pc ok.
any ideas?
10x
Inline headers have trouble being found when compiling for Android unfortunately - I never found a way around it beyond putting everything into one gbas file...
You can link C headers via the "cmp" command line compiler options "-I" & "-include"(Google GCC command line options for more info) via the project settings on Android ro any platform for that matter.
Here's mine...
-I"C:\Coding Folder\Projects\GLBasic\LIBS\Csrc" -include vectron.h
This header has other sub headers, "opengl.h" for example. I can then add openGL commands in my inline C without worrying about GL definitions.
i added the command and i get this new error:
In file included from D:/puppetfull/puppets (2)/Box2D.h:64,
from <command-line>:0:
D:/puppetfull/puppets (2)/Source/Common/b2Settings.h: In function 'float32 b2MixFriction(float32, float32)':
D:/puppetfull/puppets (2)/Source/Common/b2Settings.h:167: error: 'sqrtf' was not declared in this scope
In file included from D:/puppetfull/puppets (2)/Source/Collision/Shapes/b2Shape.h:22,
from D:/puppetfull/puppets (2)/Source/Collision/Shapes/b2CircleShape.h:22,
from D:/puppetfull/puppets (2)/Box2D.h:66,
is it becuse box2d.h load's more C Code?
any ideas? did any of you compile android with the box2d port for glbasic ?
10x
SQRTF is a Windows thing - I suspect Box2D that comes with GLBasic isn't compatible with Android.
You could change all occurances to sqrt but you might end up with further problems.
Or you could create your own function somewhere with the following routine :
float sqrtf(float value)
{
return sqrt(value);
}
Sqrtf(), now that's a strange one, I usually only use sqrt(), so I had to look it up. Apparently it seems sqrtf() strictly will only accept floats, while sqrt() accepts all floating point types, eg. doubles etc. I think Mr T's solution should be fine but im kinda surprised that this issue hasn't appeared before when folk were doing their iOS apps with this lib?
Or perhaps you need to activate some #define variables...
just do
#ifdef ANDROID
#define sqrtf sqrt
#endif
in the box2d.h file.