1>------ Build started: Project: JulyView, Configuration: Release Win32 ------1>RCC julyview.qrc1>MOC singleapplication.h1>MOC julyview.h1>Compiling...1>qrc_julyview.cpp1>moc_singleapplication.cpp1>.\Release\moc_singleapplication.cpp(47) : warning C4273: 'staticMetaObject' : inconsistent dll linkage1> c:\julyview\julyview\release\../singleapplication.h(33) : see previous definition of 'public: static QMetaObject const SingleApplication::staticMetaObject'1>.\Release\moc_singleapplication.cpp(47) : error C2491: 'SingleApplication::staticMetaObject' : definition of dllimport static data member not allowed1>.\Release\moc_singleapplication.cpp(53) : warning C4273: 'SingleApplication::metaObject' : inconsistent dll linkage1> c:\julyview\julyview\release\../singleapplication.h(33) : see previous definition of 'metaObject'1>.\Release\moc_singleapplication.cpp(58) : warning C4273: 'SingleApplication::qt_metacast' : inconsistent dll linkage1> c:\julyview\julyview\release\../singleapplication.h(33) : see previous definition of 'qt_metacast'1>.\Release\moc_singleapplication.cpp(66) : warning C4273: 'SingleApplication::qt_metacall' : inconsistent dll linkage1> c:\julyview\julyview\release\../singleapplication.h(33) : see previous definition of 'qt_metacall'1>.\Release\moc_singleapplication.cpp(85) : warning C4273: 'SingleApplication::messageReceived' : inconsistent dll linkage1> c:\julyview\julyview\release\../singleapplication.h(41) : see previous definition of 'messageReceived'1>moc_julyview.cpp1>main.cpp1>julyview.cpp1>Generating Code...1>Build log was saved at "file://c:\JulyView\JulyView\release\BuildLog.htm"1>JulyView - 1 error(s), 5 warning(s)========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
#ifdef Q_OS_WIN# ifdef SINGLE_APPLICATION_DLL# ifdef SINGLE_APPLICATION_BUILD_LIB# define SINGLE_APPLICATION_EXPORT Q_DECL_EXPORT# else# define SINGLE_APPLICATION_EXPORT Q_DECL_IMPORT# endif# endif#endif#ifndef SINGLE_APPLICATION_EXPORT# define SINGLE_APPLICATION_EXPORT#endif
#ifdef Q_OS_WIN# ifdef SINGLE_APPLICATION_DLL# ifndef SINGLE_APPLICATION_BUILD_LIB# define SINGLE_APPLICATION_EXPORT Q_DECL_EXPORT# else# define SINGLE_APPLICATION_EXPORT Q_DECL_IMPORT# endif# endif#endif#ifndef SINGLE_APPLICATION_EXPORT# define SINGLE_APPLICATION_EXPORT#endif
LIB_CONFIG = staticlib#LIB_CONFIG = dll
LocalThread::LocalThread(quintptr socketDescriptor, const QString& name, QObject* parent) : QThread(parent){ this->socketDescriptor = socketDescriptor; this->name = name;}LocalThread::~LocalThread(){}void LocalThread::run(){ QLocalSocket socket; if(!socket.setSocketDescriptor(socketDescriptor) || socket.state() != QLocalSocket::ConnectedState) return; // send app_id to client if(!writeMessage(&socket, name)) return; // wait to messages from client while(socket.state() == QLocalSocket::ConnectedState) { if(socket.waitForReadyRead(1000)) {// ... } }}