Pas d'idée d'intitulé représentatif ;)
Salut!
Bon, j'ai un petit probleme pour le moment, je tente de retransformé mes fichiers en orienté objets. J'ai un petit robot, que j'initialisais et configurais dans mon main.
Je veut retransformé ca en une classe robot, hors du main, et je me prends des erreurs dont je ne vois pas le fondement, car le code dans le main marche parfaitement bien.
Citation:
class Robot
{
public :
Robot();
11 ArRobot robot;
12 ArSonarDevice sonarDev;
ArActionLimiterForwards limiterAction("speed limiter near", 300, 600, 250);
ArActionLimiterForwards limiterFarAction("speed limiter far", 300, 1100, 400);
15 ArActionLimiterTableSensor tableLimiterAction ;
ArActionGoto gotoPoseAction("goto");
};
Robot::Robot()
{
22 robot.addRangeDevice(&sonarDev);
robot.addAction(&tableLimiterAction, 100);
robot.addAction(&limiterAction, 95);
25 robot.addAction(&limiterFarAction, 90);
robot.addAction(&gotoPoseAction, 50);
}
Citation:
Envoyé par console
/home/chris/TFE/Classe/lib/Robot.cpp:15: error: expected identifier before string constant
/home/chris/TFE/Classe/lib/Robot.cpp:15: error: expected ‘,’ or ‘...’ before string constant
/home/chris/TFE/Classe/lib/Robot.cpp:17: error: expected identifier before string constant
/home/chris/TFE/Classe/lib/Robot.cpp:17: error: expected ‘,’ or ‘...’ before string constant
/home/chris/TFE/Classe/lib/Robot.cpp:19: error: expected identifier before string constant
/home/chris/TFE/Classe/lib/Robot.cpp:19: error: expected ‘,’ or ‘...’ before string constant
/home/chris/TFE/Classe/lib/Robot.cpp: In constructor ‘Robot::Robot()’:
/home/chris/TFE/Classe/lib/Robot.cpp:27: error: ISO C++ forbids taking the address of an unqualified or parenthesized non-static member function to form a pointer to member function. Say ‘&Robot::limiterAction’
/home/chris/TFE/Classe/lib/Robot.cpp:27: error: no matching function for call to ‘ArRobot::addAction(ArActionLimiterForwards (Robot::*)(int), int)’
je suis une quiche en C++ , so please helppp ^^:bug: