Я работаю над упражнением в uni, и каждый раз, когда я пытаюсь скомпилировать main.cpp, я всегда получал такая же ошибка.C++ error:: -1: error: symbol (s) не найден для архитектуры x86_64 - в Qt-Creator
actor.h:
class Actor {
public:
Actor();
Actor(double x0, double y0);
void move();
double pos_x();
double pos_y();
static const int ARENA_W = 500;
static const int ARENA_H = 500;
};
plane.h (подкласс актера):
class Plane:Actor
{
public:
Plane();
Plane(double x0, double y0);
void move();
double pos_x();
double pos_y();
//int dx = 5;
static const int W = 50;
static const int H = 20;
private:
double x, y;
};
plane.cpp
#include "plane.h"
#include "actor.h"
Plane::Plane(double x0, double y0)
{
this ->x = x0;
this ->y = y0;
//this -> dx;
}
void Plane::move()
{
x = x + 2.5 ;
}
double Plane::pos_x()
{
return x;
}
double Plane::pos_y()
{
return y;
}
main.cpp
include "plane.h"
include"actor.h"
using namespace std;
int main(int argc, char *argv[])
{
Plane plane1(25.0, 5.0);
plane1.move();
double x = plane1.pos_x();
double y = plane1.pos_y();
cout << x << " , " << y<<endl;
}
Я видел, что есть много вопросов по этой проблеме, но я не исправил это. Можете ли вы мне помочь()? спасибо
Пожалуйста, после точной ошибки – Starl1ght
именно то, что символ (ы) не были найдены? – aschepler
Возможный дубликат [Сделать ошибку: Неопределенные символы для архитектуры x86 \ _64] (http://stackoverflow.com/questions/33488801/make-error-undefined-symbols-for-architecture-x86-64) – TheDarkKnight