ExtraGoofy
ExtraGoofy

Reputation: 41

QT Creator C++ MSVC15: Missing type specifier

This code worked before and it stopped without me making any changes to it. Here's my mainwindow.h:

#include <QMainWindow>
#include <QImage>
#include "videoengine.h"
#include "tracker.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void updateCoordinateLabels();

private:
    Ui::MainWindow *ui;
    VideoEngine *videoEngine;
    Tracker *tracker;
    void test();
};

I'm getting 3 error messages at the line Tracker *tracker;:

C2143: syntax error: missing ';' before '*'
C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C2238: unexpected token(s) preceding ';'

Tracker is a class that I defined and there are no issues with it according to QT. The type should be Tracker, I don't know why its assuming it might be int.

What am I doing wrong?

Upvotes: 0

Views: 359

Answers (1)

Eyal Cinamon
Eyal Cinamon

Reputation: 949

You haven't indicated which line in your code the error is relating to. Additionally you haven't shown all the code.

With that in mind, likely culprits:

Tracker might be defined within a namespace, so you need to fully qualify the type in your declaration.

You didn't run Qmake?

Upvotes: 1

Related Questions