Error phenomenon

Recently, due to the need of the project , Want to learn QWebView Use . So we simply built a Qt engineering , And write the following code :

#include <QApplication>
#include <QtWebKitWidgets/QWebView>
#include <QUrl> int main(int argc, char *argv[])
{
QApplication a(argc, argv); QWebView view;
view.load(QUrl("http://www.baidu.com"));
view.show(); return a.exec();
}

.pro Also added in the file webkit modular :

QT       += webkitwidgets

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = TestBrowser
TEMPLATE = app SOURCES += main.cpp

  

The compilation errors are as follows (File not found: main.obj):

Obviously the link is wrong . But the program is so simple , Obviously it has nothing to do with the program itself .

Causes and solutions

I checked it on the Internet for a while , I didn't find any relevant information . use Qt5 and QWebView I found several blog articles for keyword search , It just solved the problem . original Qt5 Chinese vs Webkit Modules are reorganized :QWebView 、QWebFrame、QWebPage、QWebInspector When these classes are moved to QtWebKitWidgets modular , No longer in QtWebKit Modules ; and QWebHistory And so on QtWebkit Module . So in .pro One of the items in the document has to be modified :

QT       += webkitwidgets

   Save the changes and compile , Successfully passed , Get a primitive ” browser “:

Reference material

  • http://blog.csdn.net/ccf19881030/article/details/18220447

QWebView stay Qt 5.x There is a compiler error in :File not found: main.obj More articles about

  1. stay Sublime Text 2 Compile and run in Java Program , As well as the output Chinese error solution

    Sublime Text 2 It's my favorite text editor for coding , If you try to use it, I believe you will like it too . In this article, we will discuss how to Sublime Text 2 Compile and run in Java Program . First step : ...

  2. from C++ To Qt( Command line compilation )good

    from C++ To Qt Reprinted from :http://hi.baidu.com/cyclone/blog/item/8f8f08fa52d22f8758ee9006.html Qt yes C++ The library of ,Qt stay an ...

  3. from C++ To Qt( Command line compilation , Explain the principles )

    Qt yes C++ The library of ,Qt stay ansi C++ On the basis of this, the paper makes a little expansion . But it seems to be more impetuous in China , learn Qt Many of them are even basic C++ How to compile seems unclear . This article abandons IDE or qmake.cmake And so on , ...

  4. Fedora15 The structures, QT Development environment and compilation QT

    I've seen a lot linux Compiled on qt The article , Actually, directly through yum install qt It's the most convenient , Please refer to <yum install qt> But initial contact fedora, To learn how to linux Compiled on . Install open source code , So we have to ...

  5. Qt5 Adding Q_OBJECT After that, we found the reason for the compilation error

    stay Qt In the process of writing , For example, when multithreading uses signal slot , Need to add Q_OBJECT, But after adding it, I find that the compiler always makes mistakes . as follows : class ThreadSxxx : public QThread { Q_OBJECT ...

  6. Qt sprintf_s Function formatting string error

    Qt sprintf_s Function formatting string error The emergence of problems : I am here VS On the use of c C++ Write cross platform functions Migration to Qt above appear sprintf_s Function formatting error . I thought it was a coding problem   Search over and over again Qt Random code asked ...

  7. Fedora15 The structures, QT Development environment and compilation QT( One key ahead of time ,qt Compile all required libraries yum install gcc-c++ libXtst-devel freetype freetype-devel fontconfig-devel libXrender-devel )

    I've seen a lot linux Compiled on qt The article , Actually, directly through yum install qt It's the most convenient , Please refer to <yum install qt> But initial contact fedora, To learn how to linux Compiled on . Install open source code , So we have to ...

  8. Android Studio2.1.2 Java8 Reference in the environment Java Library Compilation error

    Reprint please indicate the source :http://www.cnblogs.com/LT5505/p/5685242.html problem : stay Android Studio2.1.2+Java8 Under the environment of , quote Java Librar ...

  9. protobuf Solutions to compilation errors (iOS,OSX)

    protobuf Recently used protobuf, There's a problem changing the compiler tool . Now attach the solution The build process Full reference https://github.com/alexeyxo/protobuf-objc Compilation error ...

Random recommendation

  1. jackson Easy to use , Object turn json,json Transfer object ,json turn list

    add to jackson rely on : // https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core compile g ...

  2. Java One of the basic groups of useful classes —— Use regular expressions to find and replace (SearchAndReplace)

    Console program . Use regular expressions to perform find and replace operations , Just call Matcher Object's find() Method , You can call appendReplacement() Method to replace the matching subsequence . In the new StringBu ...

  3. ID3 Algorithm Decision tree generation (1)

    # coding:utf-8 import matplotlib.pyplot as plt import numpy as np import pylab def createDataSet(): ...

  4. jQuery Bind the same event to multiple elements

    Mode one : // hypothesis $("#div1", "#divN") There are multiple objects $("#div1", "#divN").each(f ...

  5. Swift3.0 Server development ( Four ) MySQL Database connection and operation

    In this blog, let's talk about MySQL Database connection and operation . If you don't have MySQL Database , You need to install MySQL database . stay Mac OS Use in brew The package manager does MySQL It's extremely convenient to install . install MySQL Of ...

  6. Remote debugger is in a background tab which may cause apps to perform slowly. Fix this by foregrounding the tab (or opening it in a separate window).

    On the first code : /** * Sample React Native App * https://github.com/facebook/react-native * * @format * @flow * ...

  7. QT in Widgets-Scene3d Example learning

    QT The example that comes with widgets-scene3d The implementation is based on Widget Use... In your application qml 3d The function of the scene , On this basis, I , take basicshapes-cpp To embed : The relevant code is as follows :  C++ C ...

  8. Tips make: There is nothing to do for `all&#39;

    Tips make: There is nothing to do for `all'. make clean once , The compilation process has .

  9. spring mvc mongoDb

    http://www.cnblogs.com/dennisit/p/3372568.html System environment : operating system :  windows xp Count   According to the   library :  mongodb2.0.6 drive dynamic package : S ...

  10. DIOCP Open source project - Using queues +0MQ+ Multi process logic processing , Build stability , Efficient , Distributed server

    Recently, I've been thinking about how to make people based on DIOCP Write stable server program on . Many friends ask me , you DIOCP Is it stable , Can I use it as a three tier server ? That's what I said at the time , I can only promise DIOCP The stability of the underlying communication . To tell the truth ...