Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Calling the functions of Qt from the C++ files
QtWS25 Last Chance

Calling the functions of Qt from the C++ files

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 923 Views
  • 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 Offline
    J Offline
    jigar23
    wrote on last edited by
    #1

    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
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      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
      0
      • Q Offline
        Q Offline
        qxoz
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved