Hi all.
I am getting this error when compiling. But the compiler does not tell me where the error is. I am able to compile the files outside Qt creator.
It seems that the error is in this file - if I don't include it, then it will compile and run.
#ifndef DATABASE_H_
#define DATABASE_H_
#include <vector>
#include <VirtualSignal.h>
typedef enum : uint16_t
{
CONFIGURATIONVERSION = 0x0000,
NUMBER_OF_SIGNALS = 0x0001
} Signal;
class DataBase
{
public:
DataBase();
VirtualSignal& getData(Signal input);
uint64_t getSize();
private:
static std::vector<VirtualSignal> signals;
};
#endif /* DATABASE_H_ */
#ifndef DATABASE_H_
#define DATABASE_H_
#include <vector>
#include <VirtualSignal.h>
typedef enum : uint16_t
{
CONFIGURATIONVERSION = 0x0000,
NUMBER_OF_SIGNALS = 0x0001
} Signal;
class DataBase
{
public:
DataBase();
VirtualSignal& getData(Signal input);
uint64_t getSize();
private:
static std::vector<VirtualSignal> signals;
};
#endif /* DATABASE_H_ */
To copy to clipboard, switch view to plain text mode
and the implementation
#include "DataBase.h"
#define LOCAL_HOST 0x7F000001
std::vector<VirtualSignal> DataBase::signals;
DataBase::DataBase()
{
for (uint16_t n=0; n<NUMBER_OF_SIGNALS; n++)
signals.push_back(VirtualSignal(LOCAL_HOST, n));
}
VirtualSignal& DataBase::getData(Signal input)
{
return signals[input];
};
uint64_t DataBase::getSize()
{
return signals.size();
}
#include "DataBase.h"
#define LOCAL_HOST 0x7F000001
std::vector<VirtualSignal> DataBase::signals;
DataBase::DataBase()
{
for (uint16_t n=0; n<NUMBER_OF_SIGNALS; n++)
signals.push_back(VirtualSignal(LOCAL_HOST, n));
}
VirtualSignal& DataBase::getData(Signal input)
{
return signals[input];
};
uint64_t DataBase::getSize()
{
return signals.size();
}
To copy to clipboard, switch view to plain text mode
What am I missing?
Added after 43 minutes:
Oh. I figured it out. The variable signals is used somewhere in qt, so somehow they conflict.
Bookmarks