#include #include "dogcore.h" #include "datacollector.h" DataCollectorShm *dataColShm; bool load_shm() { key_t key; int shmid; if((key = ftok(SHM_PATH,static_cast(SHM_PORT))) == -1){ return false; } if((shmid = shmget(key,sizeof(DataCollectorShm),IPC_CREAT|0666))==-1){ return false; } dataColShm = static_cast(shmat(shmid,nullptr,0)); return true; } int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); if(load_shm()){ DogCore *dogcore = new DogCore(nullptr); dogcore->start(); }else{ exit(1); } return a.exec(); }