Can't build a qt project using qtservice - qt

I'm trying to use QtService from QtSolution in a Qt project.
I've unzipped it and run:
configure.bat -library
qmake
mingw32-make
the debug and release dll were placed inside C:\Qt\2010.03\qt\bin\
Examples were correctly built .
I added this line at the bottom of my .pro file:
include(../QtSolutions/qtservice/src/qtservice.pri)
and I was able to browse the qtservice's sources from the project source tree.
When I try to build my project I get:
Running build steps for project EMCSolutionCrawler...
Configuration unchanged, skipping QMake step.
Starting: C:/Qt/2010.03/mingw/bin/mingw32-make.exe -w
mingw32-make: Entering directory `C:/Progetti/EMCSolutionCrawler'
c:\qt\2010.03\qt\bin\qmake.exe -spec ..\..\Qt\2010.03\qt\mkspecs\win32-g++ -win32 -o Makefile EMCSolutionCrawler.pro
mingw32-make: Leaving directory `C:/Progetti/EMCSolutionCrawler'
mingw32-make: Entering directory `C:/Progetti/EMCSolutionCrawler'
C:/Qt/2010.03/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Progetti/EMCSolutionCrawler'
g++ -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_QTSERVICE_IMPORT -DQT_DLL -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT ../QtSolutions/qtservice/src/QtService.cpp -o ../QtSolutions/qtservice/src/QtService
mingw32-make[1]: Leaving directory `C:/Progetti/EMCSolutionCrawler'
mingw32-make: Leaving directory `C:/Progetti/EMCSolutionCrawler'
In file included from ../QtSolutions/qtservice/src/QtService.cpp:47:
../QtSolutions/qtservice/src/qtservice.h:50:35: error: QtCore/QCoreApplication: No such file or directory
In file included from ../QtSolutions/qtservice/src/QtService.cpp:48:
../QtSolutions/qtservice/src/qtservice_p.h:50:30: error: QtCore/QStringList: No such file or directory
../QtSolutions/qtservice/src/QtService.cpp:51:25: error: QtCore/QTimer: No such file or directory
../QtSolutions/qtservice/src/QtService.cpp:52:26: error: QtCore/QVector: No such file or directory
../QtSolutions/qtservice/src/QtService.cpp:53:27: error: QtCore/QProcess: No such file or directory
../QtSolutions/qtservice/src/QtService.cpp:426:25: error: qtservice.moc: No such file or directory
In file included from ../QtSolutions/qtservice/src/QtService.cpp:47:
../QtSolutions/qtservice/src/qtservice.h:73: error: ISO C++ forbids declaration of 'Q_DECLARE_PRIVATE' with no type
../QtSolutions/qtservice/src/qtservice.h:74: error: expected ';' before 'public'
../QtSolutions/qtservice/src/qtservice.h:80: error: ISO C++ forbids declaration of 'QString' with no type
../QtSolutions/qtservice/src/qtservice.h:80: error: expected ',' or '...' before '&' token
../QtSolutions/qtservice/src/qtservice.h:86: error: 'QString' does not name a type
../QtSolutions/qtservice/src/qtservice.h:87: error: 'QString' does not name a type
../QtSolutions/qtservice/src/qtservice.h:88: error: 'StartupType' does not name a type
../QtSolutions/qtservice/src/qtservice.h:89: error: 'QString' does not name a type
../QtSolutions/qtservice/src/qtservice.h:91: error: ISO C++ forbids declaration of 'QString' with no type
../QtSolutions/qtservice/src/qtservice.h:91: error: expected ',' or '...' before '&' token
../QtSolutions/qtservice/src/qtservice.h:110: error: ISO C++ forbids declaration of 'Q_DECLARE_PRIVATE' with no type
../QtSolutions/qtservice/src/qtservice.h:111: error: expected ';' before 'public'
../QtSolutions/qtservice/src/qtservice.h:125: error: 'ServiceFlags' has not been declared
../QtSolutions/qtservice/src/qtservice.h:125: error: ISO C++ forbids declaration of 'Q_DECLARE_FLAGS' with no type
../QtSolutions/qtservice/src/qtservice.h:127: error: expected ';' before 'QtServiceBase'
../QtSolutions/qtservice/src/qtservice.h:130: error: 'QString' does not name a type
...
What am I missing?
Environment infomation:
Qt 4.6.3 (mingw - LGPL)
Windows XP SP3
QtService 2.6
Thank you for your time.

Just a guess: I don't see a include -IC:\Qt\2010.03\qt\include in your call of g++. So the compiler can't find the Qt Headers. I tink there is something wrong in your EMCSolutionCrawler.pro.

Related

GO-QT Binding g++: error: unrecognized command line option ‘-marm’

I am using QT Binding/Wrapper for Go in my project. Project is compiling fine for amd64 but when I try to compile project for arm devices, it gives me below error
github.com/therecipe/qt/core
# github.com/therecipe/qt/core
g++: error: unrecognized command line option ‘-marm’
Please find below my go environment variables setup
GOARCH="arm"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/minhaj/GoLang"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
GOARM=""
CC="arm-linux-gnueabi-gcc"
GOGCCFLAGS="-fPIC -marm -pthread -fmessage-length=0 -fdebug-prefix-
map=/tmp/go-build277718108=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

Why are there undefined references to PPP_GetInterface, PPP_ShutdownModule, and PPP_InitializeModule

I am trying compile a pexe file using the portable native client. I am following the instructions at this page:
https://developer.chrome.com/native-client/devguide/devcycle/building
I am trying to build a pexe and link it with a static lib as shown on the page. My command line is as follows.
/home/adev/opt/nacl_sdk/pepper_37/toolchain/linux_pnacl/bin/pnacl-clang++ -o pim-pnacl.pexe pim-pnacl.o -L/home/adev/opt/nacl_sdk/pepper_37/lib/pnacl/Release -lppapi_cpp -lppapi -L../libpidec -lpidec
and I get the following errors.
/home/adev/opt/nacl_sdk/pepper_37/toolchain/linux_pnacl/sdk/lib/libppapi_stub.a: error: undefined reference to 'PPP_GetInterface'
/home/adev/opt/nacl_sdk/pepper_37/toolchain/linux_pnacl/sdk/lib/libppapi_stub.a: error: undefined reference to 'PPP_ShutdownModule'
/home/adev/opt/nacl_sdk/pepper_37/toolchain/linux_pnacl/sdk/lib/libppapi_stub.a: error: undefined reference to 'PPP_InitializeModule'
For the record, the problem was in the pim-pnacl.o it needed to be compiled with the -c flag. This is the correct way to compile a single .o file:
/home/adev/opt/nacl_sdk/pepper_37/toolchain/linux_pnacl/bin/pnacl-clang++ -o pim-pnacl.o pim-pnacl.cc -O2 -I/home/adev/opt/nacl_sdk/pepper_37/include -c
I had omitted the -c and this caused linker problems.

How to build Quazip 0.5.1 on Windows 7?

I'm trying to build the quazip libary (version 0.5.1) on Windows 7 (32-bit) with Qt 5.0.1 32-Bit LGPL installed.
When i run in the Qt-Commandprompt:
qmake
mingw32-make
with the directory set to the folder in which I extracted Quazip (C:\Qt\quazip-0.5.1\quazip), I get the following error-log:
C:\Qt\quazip-0.5.1\quazip>mingw32-make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory 'C:/Qt/quazip-0.5.1/quazip'
g++ -Wl,-s -shared -mthreads -Wl,--out-implib,release\libquazip.a -o release\qua
zip.dll object_script.quazip.Release -LC:\Qt\Qt5\5.0.1\mingw47_32\lib -lQt5Core
./release\unzip.o:unzip.c:(.text+0x1008): undefined reference to `crc32'
./release\unzip.o:unzip.c:(.text+0x10aa): undefined reference to `inflate'
./release\unzip.o:unzip.c:(.text+0x10da): undefined reference to `crc32'
./release\unzip.o:unzip.c:(.text+0x1110): undefined reference to `crc32'
./release\unzip.o:unzip.c:(.text+0x1327): undefined reference to `inflateEnd'
./release\unzip.o:unzip.c:(.text+0x1727): undefined reference to `get_crc_table'
./release\unzip.o:unzip.c:(.text+0x186f): undefined reference to `inflateInit2_'
./release\zip.o:zip.c:(.text+0xac7): undefined reference to `crc32'
./release\zip.o:zip.c:(.text+0xb7c): undefined reference to `deflate'
./release\zip.o:zip.c:(.text+0xcdf): undefined reference to `deflate'
./release\zip.o:zip.c:(.text+0xef5): undefined reference to `deflateEnd'
./release\zip.o:zip.c:(.text+0x13a8): undefined reference to `get_crc_table'
./release\zip.o:zip.c:(.text+0x1af9): undefined reference to `deflateInit2_'
./release\quaadler32.o:quaadler32.cpp:(.text+0x2e): undefined reference to `adle
r32'
./release\quaadler32.o:quaadler32.cpp:(.text+0x61): undefined reference to `adle
r32'
./release\quaadler32.o:quaadler32.cpp:(.text+0xa1): undefined reference to `adle
r32'
./release\quaadler32.o:quaadler32.cpp:(.text+0xb1): undefined reference to `adle
r32'
c:/qt/qt5/tools/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64
-mingw32/bin/ld.exe: ./release\quaadler32.o: bad reloc address 0x0 in section `.
rdata$_ZTI13QuaChecksum32[__ZTI13QuaChecksum32]'
collect2.exe: error: ld returned 1 exit status
Makefile.Release:106: recipe for target 'release\quazip.dll' failed
mingw32-make[1]: *** [release\quazip.dll] Error 1
mingw32-make[1]: Leaving directory 'C:/Qt/quazip-0.5.1/quazip'
makefile:34: recipe for target 'release' failed
mingw32-make: *** [release] Error 2
But in my Zlib-Folder (C:\Qt\Qt5\5.0.1\Src\qtbase\src\3rdparty\zlib) are all this listed files installed.
.
As I tried to solve the problem, I have added into the quazip.pro and into the quazip.pri:
INCLUDEPATH += $$[QT_INSTALL_PREFIX]/src/3rdparty/zlib
, how it is suggested here.
All other solutiuons I have found on Google so far aren't helping.
I hope someone of you can help me.
Greetings,
LVreg
The problem is that QuaZIP can not find the zlib library. You should include the path of the headers an also the libraries when you run qmake:
qmake "INCLUDEPATH+=C:/Qt/Qt5/5.0.1/Src/qtbase/src/3rdparty/zlib" "LIBS+=-LC:/Qt/Qt5/5.0.1/Src/qtbase/src/3rdparty/zlib -lz"
mingw32-make
There is a full explanation in my blog if you want to check it out: http://www.antonioborondo.com/2014/10/22/zipping-and-unzipping-files-with-qt/
Here is what worked for me (QuaZip 0.7 on Windows 7 compiled with MSVC13 32 bits):
In the command line type:
SET INCLUDE=<PathToZib\include>;%INCLUDE%
SET LIB=<PathToZib\lib>;%LIB%
qmake PREFIX=<FolderWhereInstallWillPutFiles> LIBS+=<PathToZib\lib>/zdll.lib
nmake
nmake install
everything between <> must be changed to your applicable path
NOTE:
in the LIBS+= part use / instead of \ as folders delimiter
try to make the lib of quazip on windows - look here:
https://www.maefloresta.com/wiki/doku.php?id=quazip_windows
but - try the following command - instead of "make" take "mingw32-make".

compile qt-webkit with mingw32-make for bisecting

I started a bisect qtwebkit and when I try to compile it in the first stage it gave me the following exception. I tried using a older qmake but still it gives the same exception. What does this really mean and how can I fix it.
g++ -c -Wall -Wreturn-type -fno-strict-aliasing -Wcast-align -Wchar-subscripts -Wformat-security -Wreturn-type -Wno-unused-parameter -Wno-sign-compare -Wno-switch -Wno-switch-enum -Wundef -Wmissing-noreturn -Winit-self -frtti -fexceptions -mthreads -DUNICODE -DQT_LARGEFILE_SUPPORT -DBUILDING_QT__=1 -DWTF_USE_ACCELERATED_COMPOSITING -DUSE_SYSTEM_MALLOC -DNDEBUG -D_HAS_TR1=0 -DBUILDING_QT__ -DBUILDING_JavaScriptCore -DBUILDING_WTF -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\include" -I"." -I"..\..\webkit" -I"assembler" -I"bytecode" -I"bytecompiler" -I"debugger" -I"interpreter" -I"jit" -I"parser" -I"pcre" -I"profiler" -I"runtime" -I"wtf" -I"wtf\symbian" -I"wtf\unicode" -I"yarr" -I"API" -I"ForwardingHeaders" -I"generated" -I"\include\QtWebKit" -I"pcre" -I"\JavaScriptCore\tmp" -I"..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"c:\QtSDK1.2\mingw\include" -I"c:\QtSDK1.2\mingw\include" -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\MainThreadQt.o wtf\qt\MainThreadQt.cpp In file included from wtf\qt\MainThreadQt.cpp:72:
tmp\moc\debug_shared/MainThreadQt.moc:13:2: error: #error "This file was generated using the moc from 4.8.0. It"
tmp\moc\debug_shared/MainThreadQt.moc:14:2: error: #error "cannot be used with the include files from this version of Qt."
tmp\moc\debug_shared/MainThreadQt.moc:15:2: error: #error "(The moc has changed too much.)"
In file included from wtf\qt\MainThreadQt.cpp:72:
tmp\moc\debug_shared/MainThreadQt.moc:42: error: no 'void WTF::MainThreadInvoker::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)' member function declared in class 'WTF::MainThreadInvoker'
tmp\moc\debug_shared/MainThreadQt.moc:55: error: 'const QMetaObjectExtraData WTF::MainThreadInvoker::staticMetaObjectExtraData' is not a static member of 'class WTF::MainThreadInvoker'
tmp\moc\debug_shared/MainThreadQt.moc:56: error: 'qt_static_metacall' was not declared in this scope
tmp\moc\debug_shared/MainThreadQt.moc:57: error: too many initializers for 'const QMetaObjectExtraData'
tmp\moc\debug_shared/MainThreadQt.moc:61: error: 'staticMetaObjectExtraData' was not declared in this scope
tmp\moc\debug_shared/MainThreadQt.moc:62: error: too many initializers for 'QMetaObject::<anonymous struct>'
tmp\moc\debug_shared/MainThreadQt.moc: In member function 'virtual int WTF::MainThreadInvoker::qt_metacall(QMetaObject::Call, int, void**)':
tmp\moc\debug_shared/MainThreadQt.moc:88: error: 'qt_static_metacall' was not declared in this scope
mingw32-make[2]: *** [tmp/obj/debug_shared/MainThreadQt.o] Error 1
mingw32-make[2]: Leaving directory `C:/Qt/qtGITSource/qt/src/3rdparty/webkit/JavaScriptCore'
mingw32-make[1]: *** [debug-all] Error 2
mingw32-make[1]: Leaving directory `C:/Qt/qtGITSource/qt/src/3rdparty/webkit/JavaScriptCore'
mingw32-make: *** [sub-JavaScriptCore-make_default-ordered] Error 2
IMHO ll. 2,3 is important:
error "This file was generated using the moc from 4.8.0. It"
error "cannot be used with the include files from this version of Qt."
Your reach a version less than qt 4.8 and all your moc-files were generated in a previous build by moc v4.8. You have to clean your build directory and restart your build command (ensure you use a proper version of qmake, moc etc.).

:: error: collect2: ld returned 1 exit status with QT and opengl

I'm trying to use a QGLWidget in a QT application, and I've added the "QT += opengl" line into the .pro file but I am now getting :: error: collect2: ld returned 1 exit status when I attempt to compile my program
the compile output shows the following,
Running build steps for project MapEditor...
Configuration unchanged, skipping qmake step.
Starting: "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" -w
mingw32-make: Entering directory `C:/Qt/2010.05/MapEditor-build-desktop'
C:/Qt/2010.05/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Qt/2010.05/MapEditor-build-desktop'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\MapEditor.exe debug/Main.o debug/window.o debug/glwidget.o debug/moc_window.o debug/moc_glwidget.o -L"c:\Qt\2010.05\qt\lib" -lglu32 -lopengl32 -lgdi32 -luser32 -lmingw32 -lqtmaind -lQtOpenGLd4 -lQtGuid4 -lQtCored4
mingw32-make[1]: Leaving directory `C:/Qt/2010.05/MapEditor-build-desktop'
mingw32-make: Leaving directory `C:/Qt/2010.05/MapEditor-build-desktop'
debug/moc_glwidget.o:moc_glwidget.cpp:(.rdata$_ZTV8GLWidget[vtable for GLWidget]+0x14): undefined reference to `GLWidget::~GLWidget()'
debug/moc_glwidget.o:moc_glwidget.cpp:(.rdata$_ZTV8GLWidget[vtable for GLWidget]+0x18): undefined reference to `GLWidget::~GLWidget()'
debug/moc_glwidget.o:moc_glwidget.cpp:(.rdata$_ZTV8GLWidget[vtable for GLWidget]+0x118): undefined reference to `non-virtual thunk to GLWidget::~GLWidget()'
debug/moc_glwidget.o:moc_glwidget.cpp:(.rdata$_ZTV8GLWidget[vtable for GLWidget]+0x11c): undefined reference to `non-virtual thunk to GLWidget::~GLWidget()'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\MapEditor.exe] Error 1
mingw32-make: *** [debug] Error 2
The process "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" exited with code %2.
Error while building project MapEditor (target: Desktop)
When executing build step 'Make'
and my .pro file contains the following,
TARGET = MapEditor
TEMPLATE =app
QT += opengl
SOURCES += \
Main.cpp \
window.cpp \
glwidget.cpp
HEADERS += \
window.h \
glwidget.h
Check you .pro file (i.e. project file) that u have added all the class files and header files in SOURCES and HEADERS tags.[For this purpose run qmake command from build menubar options]
Also check that u have declared the Q_OBJECT macro in the starting of your glwidget class.
It looks like some file is missing. Did you add this to your header?
#include <QtOpenGL>

Resources