Make mistakes: Missing Included in C ++ Script?
I was just helped on how to compile this script a few minutes ago on SO, but I managed to get errors. I'm just a beginner in C ++ and have no idea what erros means or how to fix it.
This is a script . I read the comments of some users that they changed parts #include
, but that seems to be exactly what the script has, see this comment .
[root@localhost wkthumb]# qmake-qt4 && make
g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -I. -I. -o main.o main.cpp
main.cpp:5:20: error: QWebView: No such file or directory
main.cpp:6:21: error: QWebFrame: No such file or directory
main.cpp:8: error: expected constructor, destructor, or type conversion before ‘*’ token
main.cpp:11: error: ‘QWebView’ has not been declared
main.cpp: In function ‘void loadFinished(bool)’:
main.cpp:18: error: ‘view’ was not declared in this scope
main.cpp:18: error: ‘QWebSettings’ has not been declared
main.cpp:19: error: ‘QWebSettings’ has not been declared
main.cpp:20: error: ‘QWebSettings’ has not been declared
main.cpp: In function ‘int main(int, char**)’:
main.cpp:42: error: ‘view’ was not declared in this scope
main.cpp:42: error: expected type-specifier before ‘QWebView’
main.cpp:42: error: expected `;' before ‘QWebView’
make: *** [main.o] Error 1
I have a web kit on my Fedora Core 10 machine: qt-4.5.3-9.fc10.i386 qt-Devel-4.5.3-9.fc10.i386
Thanks everyone for the help
source to share
The error message indicates that the compiler cannot find what you are trying to include, i.e. <QWebView>
... A way to tell the compiler where to look is with a flag -I
to indicate the directories included (they are not recursive).
You are currently installing the following sources:
- -I / USR / Library / Qt4 / mkspecs / Linux-g ++
- -I.
- -I / usr / include / QtCore
- -I / usr / include / QtGui
- -I / usr / include
You need to find where QWebView
on your system and add the include path to the command line (or set QWebView to one of the above).
General note. When you get a lot of errors like this, focus on the first or second. Later bugs (for example ‘QWebView’ has not been declared
) are likely to be resolved by fixing the missing include bug.
source to share