Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Calling the functions of Qt from the C++ files

    General and Desktop
    3
    3
    800
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jigar23 last edited by

      I have my own C++ file random.cc that includes files

      @#include <QMainWindow>
      #include <QApplication>@

      I build my C++ file as

      @g++ random.cc mainwindow.cpp -I ../qt/5.3/gcc_64/include/QtWidgets/ -I ../qt/5.3/gcc_64/include -fPIC@

      However, it throws the following error:

      @mainwindow.cpp:2:27: fatal error: ui_mainwindow.h: No such file or directory
      #include "ui_mainwindow.h"@

      Is there a way to prebuild the file ui_mainwindow.h.?

      1 Reply Last reply Reply Quote 0
      • dheerendra
        dheerendra Qt Champions 2022 last edited by

        This is path issue. Compilation is not able to find the ui_main* files. You can use uic tool generate the ui_main*.h files and keep it where you require. Or you can use UI_DIR directive in pro file to keep you ui_main*.h into specific directory.

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply Reply Quote 0
        • Q
          qxoz last edited by

          Can you show your *.pro file
          and what IDE you are using?

          1 Reply Last reply Reply Quote 0
          • First post
            Last post