Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Raspberry Pi / [SOLVED] Tier 2 wont compile on RPi2

Author
Message
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 19th Aug 2019 12:08
I am trying to make a Tier 2 console app on RPi2 with AGKC for Pi, but I get a lot of compiler errors. I have installed Codeblocks, I use the GCC compiler, I have opened the console template from AppGameKit, I have set include directories to ../../common/include and ../../bullet. Is there anything else I have to do to get Tier 2 apps running?

I have hooked my exercise bike up to my Pi, but Tier 1 app seems to be locked at 60 fps max, but I need more timer precision for current speed in KM/h, so I was hoping to make a console app for this.
13/0

The author of this post has marked a post as an answer.

Go to answer

Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 19th Aug 2019 12:57 Edited at: 19th Aug 2019 12:58
These are the errors:

||=== Build: Debug in test (compiler: GNU GCC Compiler) ===|
/home/pi/AGKPi/Tier2/apps/test/main.cpp|66|warning: multi-line comment [-Wcomment]|
../../common/include/Common.h|420|error: ‘FILE’ does not name a type|
../../common/include/cHashedList.h||In member function ‘unsigned int AGK::cHashedList<T>::HashIndexStr(const char*) const’
../../common/include/cHashedList.h|152|error: there are no arguments to ‘strlen’ that depend on a template parameter, so a declaration of ‘strlen’ must be available [-fpermissive]|
../../common/include/cHashedList.h|152|note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)|
../../common/include/cHashedList.h||In member function ‘void AGK::cHashedList<T>::AddItem(T*, const char*)’
../../common/include/cHashedList.h|374|error: there are no arguments to ‘strlen’ that depend on a template parameter, so a declaration of ‘strlen’ must be available [-fpermissive]|
../../common/include/Thread.h|20|error: ‘STDCALL’ declared as an ‘inline’ field|
../../common/include/Thread.h|20|error: expected ‘;’ at end of member declaration|
../../common/include/Thread.h|20|error: ISO C++ forbids declaration of ‘EntryPoint’ with no type [-fpermissive]|
../../common/include/Network.h|32|error: ‘cLock’ does not name a type|
../../common/include/Network.h|35|error: expected ‘)’ before ‘*’ token|
../../common/include/Network.h||In destructor ‘AGK::cAutoLock::~cAutoLock()’
../../common/include/Network.h|44|error: ‘m_pLock’ was not declared in this scope|
../../common/include/Network.h|51|error: ‘cSpinLock’ does not name a type|
../../common/include/Network.h|54|error: expected ‘)’ before ‘*’ token|
../../common/include/Network.h||In destructor ‘AGK::cAutoSLock::~cAutoSLock()’
../../common/include/Network.h|63|error: ‘m_pLock’ was not declared in this scope|
../../common/include/Network.h|70|error: ‘AGKSocket’ does not name a type|
../../common/include/Network.h|75|error: ‘cLock’ does not name a type|
../../common/include/Network.h|96|error: ‘AGKSocket’ has not been declared|
../../common/include/Network.h|112|error: ‘Broadcaster’ does not name a type|
../../common/include/Network.h|113|error: ‘Broadcaster’ does not name a type|
../../common/include/Network.h|114|error: ‘cNetworkListener’ does not name a type|
../../common/include/Network.h|117|error: ‘cLock’ does not name a type|
../../common/include/Network.h|145|error: ‘AGKSocket’ does not name a type|
../../common/include/Network.h|165|error: ‘AGKSocket’ has not been declared|
../../common/include/Network.h|199|error: ‘cLock’ does not name a type|
../../common/include/Network.h|215|error: ‘cLock’ does not name a type|
../../common/include/Network.h|236|error: expected class-name before ‘{’ token|
../../common/include/Network.h|268|error: ‘Broadcaster’ does not name a type|
../../common/include/Network.h|269|error: ‘Broadcaster’ does not name a type|
../../common/include/Network.h|270|error: ‘cNetworkListener’ does not name a type|
../../common/include/Network.h|271|error: ‘cNetworkListener’ does not name a type|
../../common/include/Network.h|272|error: ‘AGKSocket’ does not name a type|
../../common/include/Network.h|274|error: ‘BroadcastListener’ does not name a type|
../../common/include/Network.h|275|error: ‘BroadcastListener’ does not name a type|
../../common/include/Network.h|276|error: ‘AGKSocket’ does not name a type|
../../common/include/Network.h|283|error: ‘cLock’ does not name a type|
../../common/include/Network.h|291|error: ‘cLock’ does not name a type|
../../common/include/Network.h|293|error: ‘cLock’ does not name a type|
../../common/include/Network.h|303|error: ‘AGKSocket’ has not been declared|
../../common/include/cSprite.h||In constructor ‘AGK::cSpriteFrame::cSpriteFrame()’
../../common/include/cSprite.h|60|error: ‘memset’ was not declared in this scope|
../../common/include/cSprite.h||In constructor ‘AGK::cSpriteFrame::cSpriteFrame(const AGK::cSpriteFrame*)’
../../common/include/cSprite.h|61|error: ‘memcpy’ was not declared in this scope|
../../common/include/3DMath.h||In member function ‘void AGK::AGKMatrix3::Set(const float*)’
../../common/include/3DMath.h|149|error: ‘memcpy’ was not declared in this scope|
../../common/include/3DMath.h||In member function ‘AGK::AGKMatrix3& AGK::AGKMatrix3::operator=(const AGK::AGKMatrix3&)’
../../common/include/3DMath.h|172|error: ‘memcpy’ was not declared in this scope|
../../common/include/3DMath.h||In member function ‘AGK::AGKMatrix3 AGK::AGKMatrix4::GetMat3() const’
../../common/include/3DMath.h|206|error: ‘memcpy’ was not declared in this scope|
../../common/include/3DMath.h||In member function ‘void AGK::AGKMatrix4::Set(const float*)’
../../common/include/3DMath.h|210|error: ‘memcpy’ was not declared in this scope|
../../common/include/3DMath.h||In member function ‘AGK::AGKMatrix4& AGK::AGKMatrix4::operator=(const AGK::AGKMatrix4&)’
../../common/include/3DMath.h|222|error: ‘memcpy’ was not declared in this scope|
../../common/include/Skeleton2D.h||In member function ‘virtual void AGK::Anim2DKeyFrameRotationCurved::Interpolate(AGK::Anim2DKeyFrameRotation*, float, float&)’
../../common/include/Skeleton2D.h|156|error: ‘fabs’ was not declared in this scope|
../../common/include/Skeleton2D.h||In member function ‘virtual void AGK::Anim2DKeyFramePositionCurved::Interpolate(AGK::Anim2DKeyFramePosition*, float, float&, float&)’
../../common/include/Skeleton2D.h|235|error: ‘fabs’ was not declared in this scope|
../../common/include/Skeleton2D.h||In member function ‘virtual void AGK::Anim2DKeyFrameScaleCurved::Interpolate(AGK::Anim2DKeyFrameScale*, float, float&, float&)’
../../common/include/Skeleton2D.h|303|error: ‘fabs’ was not declared in this scope|
../../common/include/cFile.h|36|error: ‘FILE’ does not name a type|
../../common/include/cSound.h|109|error: ‘cSpinLock’ does not name a type|
../../common/include/cSound.h|125|error: ‘cSpinLock’ does not name a type|
../../common/include/ZipFile.h|39|error: ‘NULL’ was not declared in this scope|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build failed: 50 error(s), 1 warning(s) (0 minute(s), 8 second(s)) ===|
13/0
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 20th Aug 2019 10:12
I have tried a fresh install and I got Tier 1 apps running but I still can't compile Tier 2 apps.
13/0
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 29th Aug 2019 14:29
It looks like GCC isn't being sent the necessary preprocessor parameters. If you look in the makefile that comes with the template_pi_console app then you will see the parameter -DIDE_PI which is necessary to activate the Pi specific includes. You may be able to get CodeBlocks to use the makefile which should solve the problem.
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 29th Aug 2019 14:52
Thank you Paul I am no master of C++, although I have been able to make servers in Linux Tier 2 that runs un-interrupted 24/7 Now I can get on with my exercise bike I will post images here when I am further Most things work, but I would like KM/h to be more accurate I didn't know I could look in makefiles to find what options are needed, now I do, thanks a bunch
13/0
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 1st Sep 2019 13:29
I have added all files, I use the Makefile, but it can't find class app, I've been trying all morning to get it to build with no luck


-------------- Build: Debug in test (compiler: GNU GCC Compiler)---------------

g++ -Wall -fexceptions -g -DIDE_PI -I../../common/include -I../../bullet -c /home/pi/AGKPI/C++/apps/template_pi_console/Core.cpp -o obj/Debug/Core.o
g++ -Wall -fexceptions -g -DIDE_PI -I../../common/include -I../../bullet -c /home/pi/AGKPI/C++/apps/template_pi_console/template.cpp -o obj/Debug/template.o
g++ -o bin/Debug/test obj/Debug/Core.o obj/Debug/template.o ../../platform/pi/Lib/Release/libAGKPi.a
/home/pi/AGKPI/C++/apps/template_pi_console/Core.cpp:66:30: warning: multi-line comment [-Wcomment]
case 94: key = 220; break; // \
^
/home/pi/AGKPI/C++/apps/template_pi_console/template.cpp:14:6: error: no declaration matches ‘void app::Loop()’
void app::Loop (void)
^~~
In file included from /home/pi/AGKPI/C++/apps/template_pi_console/template.cpp:2:
/home/pi/AGKPI/C++/apps/template_pi_console/template.h:20:7: note: candidate is: ‘int app::Loop()’
int Loop( void );
^~~~
/home/pi/AGKPI/C++/apps/template_pi_console/template.h:11:7: note: ‘class app’ defined here
class app
^~~
In file included from ../../bullet/LinearMath/btVector3.h:21,
from ../../common/include/../../bullet/BulletCollision/CollisionDispatch/btCollisionWorld.h:80,
from ../../common/include/../../bullet/btBulletCollisionCommon.h:22,
from ../../common/include/../../bullet/btBulletDynamicsCommon.h:20,
from ../../common/include/agk.h:54,
from /home/pi/AGKPI/C++/apps/template_pi_console/template.h:5,
from /home/pi/AGKPI/C++/apps/template_pi_console/template.cpp:2:
../../bullet/LinearMath/btScalar.h:337:14: warning: ‘btInfinityMask’ defined but not used [-Wunused-variable]
static int btInfinityMask = 0x7F800000;
^~~~~~~~~~~~~~
Process terminated with status 1 (0 minute(s), 10 second(s))

In file included from ../../bullet/LinearMath/btVector3.h:21,
from ../../common/include/../../bullet/BulletCollision/CollisionDispatch/btCollisionWorld.h:80,
from ../../common/include/../../bullet/btBulletCollisionCommon.h:22,
from ../../common/include/../../bullet/btBulletDynamicsCommon.h:20,
from ../../common/include/agk.h:54,
from /home/pi/AGKPI/C++/apps/template_pi_console/Core.cpp:2:
../../bullet/LinearMath/btScalar.h:337:14: warning: ‘btInfinityMask’ defined but not used [-Wunused-variable]
static int btInfinityMask = 0x7F800000;
^~~~~~~~~~~~~~
Process terminated with status 0 (0 minute(s), 11 second(s))
1 error(s), 3 warning(s) (0 minute(s), 11 second(s))
13/0
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 12th Sep 2019 18:16
I have also tried to just sudo make, but this does not work either, it says something about /home/pi/AGKPI/C++/apps/template_pi_console/template.cpp:14:6: error: no declaration matches ‘void app::Loop()’
void app::Loop (void)
13/0
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 21st Sep 2019 15:11
I have downloaded the newest version, went straight to the template for the console app, typed sudo make, but I still just get this:

pi@raspberrypi:~/AGKPi/Tier2/apps/template_pi_console $ sudo make
mkdir -p build/obj
g++-4.8 -DIDE_PI -c -I../../common/include -I../../common -I../interpreter -I../../bullet -I../../bullet/BulletCollision/CollisionShapes -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -o build/obj/template.o template.cpp -O2 -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -fsigned-char
template.cpp:14:6: error: prototype for ‘void app::Loop()’ does not match any in class ‘app’
void app::Loop (void)
^
In file included from template.cpp:2:0:
template.h:20:7: error: candidate is: int app::Loop()
int Loop( void );
^
make: *** [Makefile:36: build/obj/template.o] Error 1
pi@raspberrypi:~/AGKPi/Tier2/apps/template_pi_console $

13/0
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 24th Sep 2019 10:09
I don't have any answer, but I am also interested in getting C++ Tier 2 to run on Raspberry Pi. I am glad, I at least did get it to run on Windows in Visual Studio 2019 without compiler errors. Still don't know how to use it in Android Studio.
I also hope, that I would get the C++ code from Windows running in the environment of a Raspberry Pi.
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 10th Nov 2019 15:00
Any news on this issue? As said earlier, a fresh install of Raspbian and AppGameKit and then sudo make of the console template produces mentioned error.
13/0
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 27th Nov 2019 11:35 Edited at: 27th Nov 2019 11:35
I'm bumping this thread in hopes that someone can tell me if they can compile Tier 2/C++ on their RPi, and if so, how they achieved it
13/0
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 26th May 2020 21:34 Edited at: 26th May 2020 21:36
This post has been marked by the post author as the answer.
The fix was rather easy, it seems like a small change has been made in template.h, I just changed a return type from int to void.

this candidate -> template.h:20:7: error: candidate is: int app::Loop()
had to be: void app::Loop()
13/0

Login to post a reply

Server time is: 2024-04-19 23:47:10
Your offset time is: 2024-04-19 23:47:10