你好,我读了所有其他的问题,但在我的脑海中没有清除,请,对不起,如果卑鄙的重复问题,但我没有办法解决这个问题。
我使用QT 5在Ubuntu机器上与G++/GCC。因此,我正在编译,并得到了以下错误:
src/rolebit.cpp:279:26: error: variable 'startWindowImpl mainWin' has initializer but incomplete type
startWindowImpl mainWin(myConfig,myLog);因此,在rolebit.cpp文件中,我有了以下实现:
#ifdef QML_CLIENT
//START THE QML SWITCH HERE
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <QApplication>
#include <boost/shared_ptr.hpp>
#include "configfile.h"
#include "qmlwrapper.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
boost::shared_ptr<ConfigFile> myConfig;
myConfig.reset(new ConfigFile(argv[0], false));
QmlWrapper myQml(myConfig);
return app.exec();
},但在这之后,我有了以下几行:
#else
// START OF OLD QT-WIDGETS GUI SECTION
#include <boost/asio.hpp>
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <qapplication.h>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#endif
#include <QtGui>
#include <QtCore>
#ifdef __APPLE__
#if QT_VERSION < 0x050000
#include <QMacStyle>
#endif
#endif
#include <curl/curl.h>
#include "session.h"
#include "startwindowimpl.h"
#include "configfile.h"
#include "log.h"
#include "startsplash.h"
#include "game_defs.h"
#include <net/socket_startup.h>
#include <third_party/qtsingleapplication/qtsingleapplication.h>
#ifdef _MSC_VER
#ifdef _DEBUG
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#define ENABLE_LEAK_CHECK() \
{ \
int tmpFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); \
tmpFlag |= _CRTDBG_LEAK_CHECK_DF; \
_CrtSetDbgFlag(tmpFlag); \
}
#endif
#endif
#ifndef ENABLE_LEAK_CHECK
#define ENABLE_LEAK_CHECK()
#endif我遇到的问题是:
startWindowImpl mainWin(myConfig,myLog);那么,我需要做些什么来工作?
提前谢谢你
发布于 2016-06-28 13:35:35
看起来startWindowImpl类是在“startwindow.h”中完全声明的,但是在代码的第一部分中没有行#include "startwindowimpl.h"。因此,当QML_CLIENT为#defined时,不包含这个标头,这使得类startWindowImpl的完整声明变得未知。
https://stackoverflow.com/questions/38077201
复制相似问题