Fatal error qmainwindow no such file or directory

I'm trying to compile a qt project using terminal (Linux) qmake, but I'm getting the follwoing error message: I tried to follow this manual: https://doc.qt.io/qt-5/qmake-manual.html mainwindow.h #ifndef MAINWINDOW_H #define MAINWINDOW_H #include QT_BEGIN_NAMESPACE
  • Home
  • Forum
  • Qt
  • Newbie
  • «QMainWindow: No such file or directory» error: Compiling using qmake only.

  1. 19th January 2020, 23:28


    #1

    Default «QMainWindow: No such file or directory» error: Compiling using qmake only.

    I’m trying to compile a qt project using terminal (Linux) qmake, but I’m getting the follwoing error message:
    I tried to follow this manual: https://doc.qt.io/qt-5/qmake-manual.html

    mainwindow.h

    1. #ifndef MAINWINDOW_H

    2. #define MAINWINDOW_H

    3. #include <QMainWindow>

    4. QT_BEGIN_NAMESPACE

    5. namespace Ui { class MainWindow; }

    6. QT_END_NAMESPACE

    7. {

    8. Q_OBJECT

    9. public:

    10. MainWindow(QWidget *parent = nullptr);

    11. ~MainWindow();

    12. private:

    13. Ui::MainWindow *ui;

    14. };

    15. #endif // MAINWINDOW_H

    To copy to clipboard, switch view to plain text mode 

    mainwindow.cpp

    1. #include "mainwindow.h"

    2. #include "ui_mainwindow.h"

    3. MainWindow::MainWindow(QWidget *parent)

    4. , ui(new Ui::MainWindow)

    5. {

    6. ui->setupUi(this);

    7. }

    8. MainWindow::~MainWindow()

    9. {

    10. delete ui;

    11. }

    To copy to clipboard, switch view to plain text mode 

    main.cpp

    1. #include "mainwindow.h"

    2. #include <QApplication>

    3. int main(int argc, char *argv[])

    4. {

    5. MainWindow w;

    6. w.show();

    7. return a.exec();

    8. }

    To copy to clipboard, switch view to plain text mode 

    main.pro

    1. HEADERS += mainwindow.h

    2. SOURCES += mainwindow.cpp

    3. SOURCES += main.cpp

    To copy to clipboard, switch view to plain text mode 

    [rob@archrob qteste]$ qmake main.pro
    [rob@archrob qteste]$ make
    g++ -c -pipe -O2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o mainwindow.o mainwindow.cpp
    In file included from mainwindow.cpp:1:
    mainwindow.h:4:10: fatal error: QMainWindow: No such file or directory
    4 | #include <QMainWindow>
    | ^~~~~~~~~~~~~
    compilation terminated.
    make: *** [Makefile:663: mainwindow.o] Error 1


  2. 20th January 2020, 02:15


    #2

    Default Re: «QMainWindow: No such file or directory» error: Compiling using qmake only.

    Add QT += widgets to your .pro file.

    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click «Go Advanced» and then the «#» icon to insert the tags. Paste your code between them.


  3. 20th January 2020, 02:55


    #3

    Default Re: «QMainWindow: No such file or directory» error: Compiling using qmake only.

    Quote Originally Posted by d_stranz
    View Post

    Add QT += widgets to your .pro file.

    Ok, but now I’m getting this:
    [quote][/[rob@archrob qteste]$ make
    g++ -c -pipe -O2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -Wall -Wextra -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtCore -I. -I/usr/lib/qt/mkspecs/linux-g++ -o mainwindow.o mainwindow.cpp
    mainwindow.cpp:2:10: fatal error: ui_mainwindow.h: No such file or directory
    2 | #include «ui_mainwindow.h»
    | ^~~~~~~~~~~~~~~~~
    compilation terminated.
    make: *** [Makefile:668: mainwindow.o] Error 1quote]


  4. 20th January 2020, 09:14


    #4

    Default Re: «QMainWindow: No such file or directory» error: Compiling using qmake only.

    Add this line to pro file :

    1. FORMS += mainwindow.ui

    To copy to clipboard, switch view to plain text mode 


  5. 20th January 2020, 17:06


    #5

    Default Re: «QMainWindow: No such file or directory» error: Compiling using qmake only.

    And next will come the error about «Ui:: MainWindow» class being undefined because the one that -has- been defined has been put into a Qt namespace.

    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click «Go Advanced» and then the «#» icon to insert the tags. Paste your code between them.


Similar Threads

  1. Replies: 6

    Last Post: 6th December 2020, 18:06

  2. Replies: 12

    Last Post: 19th August 2015, 19:50

  3. Replies: 15

    Last Post: 6th March 2015, 14:34

  4. Replies: 2

    Last Post: 20th September 2013, 23:47

  5. Replies: 3

    Last Post: 15th February 2010, 18:27

Bookmarks

Bookmarks


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
  • BB code is On
  • Smilies are On
  • [IMG] code is On
  • [VIDEO] code is On
  • HTML code is Off

Forum Rules

Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.

Fatal error qmainwindow no such file or directory

I tried to make my first application qith Qt, Creator, Qt Widgets Application, I didn’t add anythin, only the code that Qt automatically produces exist in the project.
But it gives this error when I run it: error: C1083: Cannot open include file: ‘QMainWindow’: No such file or directory.
How can I fix this?

It’s Win 7, Qt Creator 4.2.1.

It sounds like your kit isn’t set up properly.

It’s in the settings somewhere I don’t have access to Qt Creator right now to check, but there is a place to configure your kits. Make sure it points to your Qt kit you want to use i.e. 5.8.

Then the build should work properly. If someone with more Creator knowledge comes by fill free to give more detailed info. 🙂

Also check that your .pro file contains QT += widgets .

It does contain ‘QT += widgets’.
I put in the PATH Env. Variable: C:mingw32bin and worked.

Did you install a custom MinGW version rather that the on proposed with Qt ?

It does contain ‘QT += widgets’.
I put in the PATH Env. Variable: C:mingw32bin and worked.

Be careful with custom mingw’s like that. Qt does not work with a lot of mingw versions. I find most builds target a specific mingw and going outside that specific one leads to compilation issues and problems.

Not saying it will happen but it’s definitely something to be careful of.

The proper fix is to make sure your Qt Creator can see your kit, i.e. the mingw that Qt installed, in it’s settings.

Either way though, glad it’s working. 🙂 Just know if you start having weird problems, you may need to look at compiler.

The proper fix is to make sure your Qt Creator can see your kit, i.e. the mingw that Qt installed, in it’s settings.
I think you ‘re right, and this is what I want, the proper fix, not just a fix.
But you know, I was struggling for hours to make Qt Creator work, and when I finally made it work, I was soo excited!

How can I make it work with the proper settings? (compiler etc..)
Has Qt Creator a MingW in it’s folders?
Why doesn’t it find it automatically?

Did you install a custom MinGW version rather that the on proposed with Qt ?

The mingw I installed in C:mingw32, is irrelevant to Qt Creator. (which mingw version is proposed for Qt? Is it the mingw-builds i686-4.8.2-release-posix-dwarf-rt_v3-rev3 according to this? If this is the one, then I ‘m very lucky!! This is the mingw version installed in C:mingw32!!)
I had it installed before I installed Qt Creator and I used it with NetBeans.

Here is the list of the compilers, the first in the list is the one that was added after I modified the PATH variable (as I mentioned above)

And the list of kits:

@Panoss From the picture you posted I can see that Qt creator recognized MinGW.
The second picture shows that you have issues with two of your Kits: Desctop and Unnamed.
You should check them. Which of these Kits are you using?
It is better to use MinGW which is provided with Qt: just use Qt Maintenance Tool to install Qt for MinGW and MinGW. I never had any issues with this combination.

just use Qt Maintenance Tool to install Qt.

What is Qt Maintenance tool?

@Panoss If you used Qt Online Installer to install Qt then you have a tool in your Qt installation directory — Qt Maintenance Tool. You can use to update your installation, install other Qt versions and MinGW.

I didn’t use the Online installer.
I will uninstall my current Qt Creator and use the Online installer.

I ‘m currently installing it with the online installer.
It says it needs 6,32 (. )GB space for installation!
Now I remembered why I had rejected Qt Designer and tried to use NetBeans.
Anyway, I will install it for now, but later I will try the other way which is much more ‘economical’ when we ‘re talking about HDD space.

It finished the installation and I tried to make a Qt Application to test it.
But, no:
The program has unexpectedly finished.

I looked at kits:

@Panoss 6,32GB?! What did you select to install? QtCreator is around 240MB, I don’t think Netbeans is smaller. Qt 5.8 consumes 2,87GB on my machine.
Which of the Kits did you use? All auto-detected Kits are for Visual Studio, not MinGW! It looks like you installed several Qt versions for Visual Studio, why? You wanted to use MinGW, right?
Remove all Qt for Visual Studio and add Qt 5.8 for MinGW and make sure MinGW is selected under Qt/Tools in Qt Maintenance Tool.

@Panoss 6,32GB?! What did you select to install? QtCreator is around 240MB, I don’t think Netbeans is smaller. Qt 5.8 consumes 2,87GB on my machine.

I left the default settings.
Indeed, I saw multiple versions of Qt selected, but I thought ‘it’s the default, I’ll leave it as is’

Which of the Kits did you use? All auto-detected Kits are for Visual Studio, not MinGW! It looks like you installed several Qt versions for Visual Studio, why?

No, I didn’t want anything ike this. They automatically got installed. I ‘ll remove them.

You wanted to use MinGW, right?

Yeah. It’s just that I ‘m an absolute beginner and I’ve messed everything up!

Remove all Qt for Visual Studio and add Qt 5.8 for MinGW

and make sure MinGW is selected under Qt/Tools in Qt Maintenance Tool.

This is what I had selected in the beginning, but then I deselected MinGW under Qt/Tools and selected MinGW under Qt 5.8.
And worked, while with the previous selection didn’t.
(I noticed that when I selected the MinGW under Qt 5.8, automatically a MinGW under Qt/Tools was also selected )

jsulm I did as you said, I made a test Qt Applicaion, it run from the very first time!!
But, in the editor, it shows errors: words underlined with red color, others with yellow — light green color.
And red circles on the left.
But, despite these, the program compiles and runs!
Take a look at the picture to see what I mean:

EDIT: The errors disappeared! I didn’t do anything!

Might be the code model that wasn’t completely initialised yet.

By the way, since you have it working now, please mark the thread as solved using the «Topic Tools» button so that other forum members may know a solution has been found 🙂

Источник

Fatal error qmainwindow no such file or directory

I am trying to compile this for windows client.
I am using Qt 5.
But when I try to build it.
I get these errors —

I am new to Qt. Please help on how to fix this issue.

@sc0rp10n [UPDATE] I have fixed the above issue but now when I build, I get

After searching online, I know I need to add output directory or QTDIR but do not know where. Please help.

The project publishes .vcproj file which is wrong — it only must publish the .pro files where you generate your VisualStudio solution files from. Otherwise the paths to the Qt installation is not correct inside those files (as you can see). Throw away all .vcproj and .sln files and run qmake on the Qt command prompt after you installed the correct Qt version.

@Christian-Ehrlicher so i removed all those files, ran qmake -project in .client folder and then tried running qmake .pro . But I got error/warning:

So, now should I compile it in visual code?

Why? You should not re-create the pro file. You should run qmake -tp vc — see https://doc.qt.io/qt-5/qmake-running.html#general-options

@Christian-Ehrlicher the command you mentioned, does not do anything and just prints help of qmake . Here vc is prefix name (from what I understood through docs). But that would be different for mine. How to see that?
Also there is no default .pro file, so why shouldn’t I create it?

I was pretty sure there was a .pro file in the github link you gave me.
Then you have to either fixup the vcproj by yourself where we can’t help or create two separate pro files for the both subdirs with qmake -project QT +=widgets and hope the automatically generated pro file is correct, then run qmake -tp vc to generate the vcproj files.

@Christian-Ehrlicher in first reply, you said to choose correct version of Qt, so which one should I choose?

so which one should I choose?

Don’t know which version — depends on what the repo needs. But it must be for MSVC.

@sc0rp10n the readme tells us: tested with Qt 5.10.1 (on windows):

@Christian-Ehrlicher The .pro file is already there for server client but for windows client it can not be used, because both are different. I am running qmake -project in windows client folder which creates a different file from the one already present in server client.

@J-Hilk ok, i am downloading it, can you tell me steps of command to run to build/compile the client? I don’t have much +ve experience with it. @Christian-Ehrlicher

Hello everybody. I have to admit that the @sc0rp10n problem was double-checked myself. I just can’t solve it, I ask for help from someone who might have an idea/solution on how to fix it! Thanks in advance. @Christian-Ehrlicher

@kalek33 hi and welcome to devnet,

The suggestions still holds: use

In the client folder to create the .pro file.

Then you can use Qt Creator to build it.

@SGaist Ok, thanks for the reply, but what you say, he has not already tried @sc0rp10n without success?

No, it’s the command to generate the Visual Studio project that failed.

@SGaist Sure, but why didn’t he succeed. and if he didn’t succeed either?

@SGaist Sure, but why didn’t he succeed. and if he didn’t succeed either?

You do realize that with the information given there’s no way to know ?

In between, you can either use Qt Creator to build the project using the pro file or install the Qt VS tools and import the project into Visual Studio. In any case, you are not locked out of progress.

@SGaist I’ve been trying for almost 24 hours, could you try it yourself and see if it gives you the same mistake pretty please?

No because I do not have a Windows machine at hand.
However my constations about missing information applies.

What did you exactly do ?
Which error messages did you got ?
Which version of Qt are you using ?

@SGaist I use 5.10.1 And the .pro file is already there for server client but for windows client it can not be used, because both are different. I am running qmake -project in windows client folder which creates a different file from the one already present in server client.

And what is the issue with that file ?
These two folders have different content so that’s normal the .pro files are different.

@SGaist I did this with Qt 5.10.1 MSVC 2015
I opened the .pro file in QtCreator and built TS3Tunnel.client
This is the error it gives

Should I install VS 2015 and uninstall 2019?
I have installed PortAudio from vcpkg

The opus error still comes if I run .vcpkgvcpkg install opus:x64-windows command to install opus. The opus.h is present after running this command in «C:srcvcpkginstalledx64-windowsincludeopus»

Also after installing opus the last warning error does not come, when I build from Qt creator

@SGaist after running the qmake command and building using QT creator what would I get as output? The exe file or do i need to do something else too after that to get exe file?

When I set Qt version in project setting in VS 2015’s Qt addin
I get this error

And my project gets deleted/empty kind of

It happens for both options

How project looks before setting the version

@SGaist after running the qmake command and building using QT creator what would I get as output? The exe file or do i need to do something else too after that to get exe file?

If your build succeeded, you have an application that you can run so just use the Run option of Qt Creator.

@SGaist Ok Qt creator was giving a lot more errors related to code issues only (what I assume)
So trying out with Qt 5.7 open source
but i get this error while building from VS 2015

Источник

That solved the header errors, but after that I got a whole bunch of other errors (had to give it the path to ui_notepad.h too). I’m sure the build failed. As I type this I’m still getting further errors in red font. Will update with a link to a log file that shows the full message once it’s done.

Edit: Never mind, the full message has too many errors so it ended up being too long for it to even all fit in the Command Prompt window. I tried to use the «>» character to redirect the output the file, but although the file got created there’s nothing in the file.

This is the full command I used to try to build it:

em++ -Wall -std=c++17 -pedantic -I C:Qt5.13.1wasm_32include -I C:Qt5.13.1wasm_32includeQtWidgets -I E:programmingQtbuild-notepad-project-Desktop_Qt_5_13_1_MSVC2017_64bit-Debug main.cpp notepad.cpp -s WASM=1 -s EXPORT_ALL=1 -o notepad.html > ./build-log.txt

Edit: I ran this updated command just now:

em++ -Wall -std=c++17 -pedantic -I C:Qt5.13.1wasm_32include -I C:Qt5.13.1wasm_32includeQtWidgets -I E:programmingQtbuild-notepad-project-Desktop_Qt_5_13_1_MSVC2017_64bit-Debug -L C:Qt5.13.1wasm_32lib main.cpp notepad.cpp -s WASM=1 -s EXPORT_ALL=1 -o notepad.html

and got this message:

notepad.cpp:11:14: error: no member named 'actionNew' in 'Ui::Notepad'
        connect(ui->actionNew, &QAction::triggered, this, &Notepad::newDocument);
                ~~  ^
notepad.cpp:12:14: error: no member named 'actionOpen' in 'Ui::Notepad'
        connect(ui->actionOpen, &QAction::triggered, this, &Notepad::open);
                ~~  ^
notepad.cpp:13:14: error: no member named 'actionSave' in 'Ui::Notepad'
        connect(ui->actionSave, &QAction::triggered, this, &Notepad::save);
                ~~  ^
notepad.cpp:14:14: error: no member named 'actionSave_as' in 'Ui::Notepad'
        connect(ui->actionSave_as, &QAction::triggered, this, &Notepad::saveAs);
                ~~  ^
notepad.cpp:15:14: error: no member named 'actionPrint' in 'Ui::Notepad'
        connect(ui->actionPrint, &QAction::triggered, this, &Notepad::print);
                ~~  ^
notepad.cpp:16:14: error: no member named 'actionExit' in 'Ui::Notepad'
        connect(ui->actionExit, &QAction::triggered, this, &Notepad::exit);
                ~~  ^
notepad.cpp:17:14: error: no member named 'actionCopy' in 'Ui::Notepad'
        connect(ui->actionCopy, &QAction::triggered, this, &Notepad::copy);
                ~~  ^
notepad.cpp:18:14: error: no member named 'actionCut' in 'Ui::Notepad'
        connect(ui->actionCut, &QAction::triggered, this, &Notepad::cut);
                ~~  ^
notepad.cpp:19:14: error: no member named 'actionPaste' in 'Ui::Notepad'
        connect(ui->actionPaste, &QAction::triggered, this, &Notepad::paste);
                ~~  ^
notepad.cpp:20:14: error: no member named 'actionUndo' in 'Ui::Notepad'
        connect(ui->actionUndo, &QAction::triggered, this, &Notepad::undo);
                ~~  ^
notepad.cpp:21:14: error: no member named 'actionRedo' in 'Ui::Notepad'
        connect(ui->actionRedo, &QAction::triggered, this, &Notepad::redo);
                ~~  ^
notepad.cpp:22:14: error: no member named 'actionFont' in 'Ui::Notepad'
        connect(ui->actionFont, &QAction::triggered, this, &Notepad::selectFont);
                ~~  ^
notepad.cpp:23:14: error: no member named 'actionBold' in 'Ui::Notepad'
        connect(ui->actionBold, &QAction::triggered, this, &Notepad::setFontBold);
                ~~  ^
notepad.cpp:24:14: error: no member named 'actionUnderline' in 'Ui::Notepad'
        connect(ui->actionUnderline, &QAction::triggered, this, &Notepad::setFontUnderline);
                ~~  ^
notepad.cpp:25:14: error: no member named 'actionItalic' in 'Ui::Notepad'
        connect(ui->actionItalic, &QAction::triggered, this, &Notepad::setFontItalic);
                ~~  ^
notepad.cpp:26:14: error: no member named 'actionAbout' in 'Ui::Notepad'
        connect(ui->actionAbout, &QAction::triggered, this, &Notepad::about);
                ~~  ^
notepad.cpp:29:6: error: division by zero in preprocessor expression
#if !QT_CONFIG(printer)
     ^~~~~~~~~~~~~~~~~~
C:Qt5.13.1wasm_32includeQtCore/qglobal.h:86:30: note: expanded from macro 'QT_CONFIG'
#define QT_CONFIG(feature) (1/QT_FEATURE_##feature == 1)
                            ~^~~~~~~~~~~~~~~~~~~~~
notepad.cpp:53:21: error: use of undeclared identifier 'QFileDialog'
        QString fileName = QFileDialog::getOpenFileName(this, "Open the file");
                           ^
notepad.cpp:54:2: error: unknown type name 'QFile'
        QFile file(fileName);
        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
shared:ERROR: 'C:/emsdk/upstream/binclang++.exe -target wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=1 -D__EMSCRIPTEN_minor__=38 -D__EMSCRIPTEN_tiny__=46 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -nostdsysteminc -Xclang -isystemC:emsdkupstreamemscriptensystemincludelibcxx -Xclang -isystemC:emsdkupstreamemscriptensystemliblibcxxabiinclude -Xclang -isystemC:emsdkupstreamemscriptensystemincludecompat -Xclang -isystemC:emsdkupstreamemscriptensysteminclude -Xclang -isystemC:emsdkupstreamemscriptensystemincludelibc -Xclang -isystemC:emsdkupstreamemscriptensystemliblibcmuslarchemscripten -Xclang -isystemC:emsdkupstreamemscriptensystemlocalinclude -Wall -std=c++17 -pedantic -IC:Qt5.13.1wasm_32include -IC:Qt5.13.1wasm_32includeQtWidgets -IE:programmingQtbuild-notepad-project-Desktop_Qt_5_13_1_MSVC2017_64bit-Debug -DEMSCRIPTEN notepad.cpp -Xclang -isystemC:emsdkupstreamemscriptensystemincludeSDL -c -o C:UsersOsmanAppDataLocalTempemscripten_temp_ytz6wkipnotepad_1.o -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr' failed (1)

I was trying to follow the Notepad tutorial in the Getting Started guide on the Qt website. Haven’t gotten through the whole thing.

I think so, because when i tried to run CMake, there are something output said failed and not found, i will let you know.
This is the output of CMake:

-- Checking for C++11 compiler
-- Checking for C++11 compiler - available
-- Eigen 3.3.4 found (include: /home/joshuajano/openMVG/src/third_party/eigen)
-- Flann 1.8.4 found (include: /home/joshuajano/openMVG/src/third_party/flann/src/cpp/flann)
-- CoinUtils 2.10.13 found (include: /home/joshuajano/openMVG/src/dependencies/osi_clp/CoinUtils/src)
-- Clp 1.16.10 found (include: /home/joshuajano/openMVG/src/dependencies/osi_clp/Clp/src)
-- Osi 0.107.8 found (include: /home/joshuajano/openMVG/src/dependencies/osi_clp/Osi/src/Osi)
-- Lemon 1.3 found (include: /home/joshuajano/openMVG/src/third_party/lemon/lemon)
-- Could NOT find COIN (missing:  COIN_INCLUDE_DIR COIN_CBC_LIBRARY COIN_CBC_SOLVER_LIBRARY COIN_CGL_LIBRARY COIN_CLP_LIBRARY COIN_COIN_UTILS_LIBRARY COIN_OSI_LIBRARY COIN_OSI_CBC_LIBRARY COIN_OSI_CLP_LIBRARY) 

   ===============================================================
   Ceres-solver configuration.
   ===============================================================
-- Detected Ceres version: 1.13.0 from /home/joshuajano/openMVG/src/third_party/ceres-solver/include/ceres/version.h
-- Eigen 3.3.4 found (include: /home/joshuajano/openMVG/src/third_party/eigen)
-- Found Eigen version 3.3.4: /home/joshuajano/openMVG/src/third_party/eigen

   ===============================================================
   Disabling the use of Eigen as a sparse linear algebra library.
   This does not affect the covariance estimation algorithm 
   which can still use the EIGEN_SPARSE_QR algorithm.
   ===============================================================

-- A library with BLAS API found.
-- Found LAPACK library: /usr/lib/liblapack.so;/usr/lib/libf77blas.so;/usr/lib/libatlas.so
-- Found BLAS library: /usr/lib/libf77blas.so;/usr/lib/libatlas.so
-- Building without SuiteSparse.
-- Found CXSparse in: ../cxsparse/Include, building with CXSparse.
-- Google Flags disabled; no tests or tools will be built!
-- Compiling minimal glog substitute into Ceres.
-- Using minimal glog substitute (include): internal/ceres/miniglog
-- Disabling Schur specializations (faster compiles)
-- Building with OpenMP.
-- Looking for C++ include unordered_map
-- Looking for C++ include unordered_map - not found
-- Looking for C++ include tr1/unordered_map
-- Looking for C++ include tr1/unordered_map - found
-- Found tr1/unordered_map/set in std::tr1 namespace.
-- Looking for C++ include memory
-- Looking for C++ include memory - found
-- Performing Test HAVE_SHARED_PTR_IN_STD_NAMESPACE
-- Performing Test HAVE_SHARED_PTR_IN_STD_NAMESPACE - Failed
-- Performing Test HAVE_SHARED_PTR_IN_TR1_NAMESPACE
-- Performing Test HAVE_SHARED_PTR_IN_TR1_NAMESPACE - Failed
-- Looking for C++ include tr1/memory
-- Looking for C++ include tr1/memory - found
-- Performing Test HAVE_SHARED_PTR_IN_TR1_NAMESPACE_FROM_TR1_MEMORY_HEADER
-- Performing Test HAVE_SHARED_PTR_IN_TR1_NAMESPACE_FROM_TR1_MEMORY_HEADER - Success
-- Found shared_ptr in std::tr1 namespace using <tr1/memory> header.
-- Building Ceres as a static library.
-- Enabling CERES_NO_SUITESPARSE in Ceres config.h
-- Enabling CERES_RESTRICT_SCHUR_SPECIALIZATION in Ceres config.h
-- Enabling CERES_USE_OPENMP in Ceres config.h
-- Enabling CERES_HAVE_PTHREAD in Ceres config.h
-- Enabling CERES_HAVE_RWLOCK in Ceres config.h
-- Enabling CERES_TR1_UNORDERED_MAP in Ceres config.h
-- Enabling CERES_TR1_MEMORY_HEADER in Ceres config.h
-- Enabling CERES_TR1_SHARED_PTR in Ceres config.h
-- Do not build any example.
   ===============================================================
   Ceres-solver configuration end.
   ===============================================================
-- 
-- Configured Eigen 3.3.4
-- 
** Found Qt5, GUI modules will be build


** OpenMVG version: 1.4.0
** Build Shared libs: OFF
** Build OpenMVG tests: ON
** Build OpenMVG softwares: ON
** Build OpenMVG GUI softwares: ON
** Build OpenMVG documentation: ON
** Build OpenMVG samples applications: ON
** Build OpenMVG openGL examples: OFF
** Enable code coverage generation: OFF
** Enable OpenMP parallelization: ON
** Build OpenCV+OpenMVG samples programs: OFF
** Use OpenCV SIFT features: OFF


-- CEREAL: (internal)
-- EIGEN: 3.3.4 (internal)
-- CERES: 1.13.0 (internal)
-- FLANN: 1.8.4 (internal)
-- LIBTIFF: 4.0.8 (external)
-- LIBPNG: 1.6.32 (external)
-- LIBJPEG (external)
-- CLP: 1.16.10 (internal)
-- COINUTILS: 2.10.13 (internal)
-- OSI: 0.107.8 (internal)
-- LEMON: 1.3 (internal)


-- Configuring done
-- Generating done
-- Build files have been written to: /home/joshuajano/openMVG_Build

Thank you for your attention

Я использую QT Creator 3.5.1 и QT 4.8.2 на хост-компьютере Ubuntu 14.04 LTS, я настроил свой BeagleBone Kit для кросс-компиляции ARM следующим образом:
QT для BeagleBone

я следую эти шаги, но я получаю сообщение об ошибке при попытке скомпилировать проект QT по умолчанию Ошибка QMainWindow

Я что-то пропустил? Если он не найден, он не находится там, где смотрит компилятор. Как вы это исправите?

Вот мой файл проекта

Картина моего проекта

6

Решение

Возможно, произошла ошибка при сборке qt из исходного кода или что-то отсутствует. Попробуйте искать QMainWindow.h в qt include dir. Похоже, что это в /usr/local/qt4.8.2-armhf/include, Например, вы можете искать, как это find * /usr/local/qt4.8.2-armhf/include/ | grep QMainWindow,

1

Другие решения

Использование Qt 5.8.0 на Win 7 / MSVC2015x64bit;

У меня была такая же проблема, и я нашел способ ее исправить, даже если она не самая умная:

1) Откройте файл projectname.pro

2) Между
QT += core gui
а также
greaterThan(QT_MAJOR_VERSION, X): QT += widgets
вставить QT += widgets

так что эта часть выглядит примерно так:

...
QT += core gui
QT += widgets
greaterThan(QT_MAJOR...

Сохраните и закройте файл .pro и дождитесь, пока Qt автоматически прочитает
файл-изменения и обновления сам.
(Если вы деактивировали это, попробуйте перезапустить Qt)

А также как это — замена «Х» в greaterThan(QT_MAJOR_VERSION, X): QT += widgets с номером пре-версии у меня нормально работает. (X = your_major_version - 1)

(В случае использования Qt 5.x поместите 4 вместо 5, используя Qt 3.x замените 3 на 2 и так далее …)

Я не знаю, если это также работает для других платформ …

Я надеюсь, что смогу помочь хотя бы одному человеку с такой же проблемой. 😉

Привет Зитро

2

Прежде всего вам нужно убедиться, что кросс-компилятор работает,
составить привет мир: std::cout << "hin" и запустить на устройстве, используя кросс-компилятор GCC из командной строки.

Второй шаг — убедиться, что qmake из кросс-скомпилированного Qt работает как положено, запустите /usr/local/qt4.8.2-armhf/bin/qmake path/to/your/pro/file && make если все работает то следующий шаг

В-третьих, наконец-то настройте свой Qt Creator

Смотри сюда: http://developer.toradex.com/how-to/how-to-set-up-qt-creator-to-cross-compile-for-embedded-linux

Вам нужно установить sysroot на правильное значение, например, в моем случае это:

/ USR / местные / oecore-i686 / sysroots / armv7ahf-VFP-неон-Ангстрем-линукс-gnueabi /

внутри этого каталога есть «bin» и «lib», полный исполняемых файлов arm и библиотек arm, это то, что «sysroot», это часть файловой системы вашего устройства, клонированная в ваш кросс-компилятор, которая помогает вам связывать ваши приложения. Также убедитесь, что вы установили правильный путь к qmake для кросс-компиляции в настройках создателя Qt, это должно выглядеть так: /usr/local/qt4.8.2-armhf/bin/qmake

0

Возможно, ваша версия QT Creator устарела. Проекты могут быть повреждены, если вы установите несовместимую с ними версию QT Creator. Вы можете скачать последнюю версию QT Creator в Центре программного обеспечения.

Вы также должны убедиться, что ваш QT обновлен. Проверьте с помощью Software Updater.

Я нашел это; Вы можете взглянуть на это: derekmolloy.ie/beaglebone/qt-with-embedded-linux-on-the-beaglebone/#Source_Code

0

В Windows убедитесь, что в папке вашего проекта нет странных символов, таких как: (,) или # …

0

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Fatal error python h нет такого файла или каталога
  • Fatal error python h file not found
  • Fatal error pthread h no such file or directory windows
  • Fatal error project1 dpr 5 could not compile used unit unit1 pas
  • Fatal error portaudio h no such file or directory

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии