Qt Forum

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

    Solved Compiling Qt Application with source code (no .pro file)

    Wiki Discussion
    4
    19
    2265
    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.
    • The Times
      The Times last edited by

      Hello, I recently got some source code from someone but I am failing to compile it. It contains the .cpp files, header files, .ui file and .qrc file but no .pro file.. Any help would be appreciated, thanks

      jsulm D 2 Replies Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion @The Times last edited by

        @The-Times You can simply create a default widget app with qrc resource file in QtCreator and copy its pro file, then adjust that pro file.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        The Times 3 Replies Last reply Reply Quote 4
        • jsulm
          jsulm Lifetime Qt Champion @The Times last edited by

          @The-Times You can simply create a default widget app with qrc resource file in QtCreator and copy its pro file, then adjust that pro file.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          The Times 3 Replies Last reply Reply Quote 4
          • D
            DJaq @The Times last edited by

            @The-Times
            Hello,

            1. You can create a new Qt Creator project and then add the source files into it (I'm not very familiar with QT Creator);
            2. Or you can create a new Visual Studio SLN from these sources, if you have the QT VS Addin, and then add the source files into it.

            You will have some settings to tweak after creating the project, but you should be able to compile something in a short amount of time. ^^

            1 Reply Last reply Reply Quote 1
            • The Times
              The Times @jsulm last edited by

              @jsulm Thanks for the reply! Unfortunately, I don't have the pro file available, what can I do in this case?

              jsulm 1 Reply Last reply Reply Quote 0
              • jsulm
                jsulm Lifetime Qt Champion @The Times last edited by

                @The-Times Please read once more what I wrote

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                The Times 1 Reply Last reply Reply Quote 0
                • The Times
                  The Times @jsulm last edited by

                  @jsulm Ohh sorry, I didn't fully read your sentence first time.. Thanks for taking the time to reply, will be trying this soon :)

                  1 Reply Last reply Reply Quote 0
                  • SGaist
                    SGaist Lifetime Qt Champion last edited by

                    Hi,

                    Another solution is to call "qmake -project" in the folder where these files are. It will build a basic .pro file based on these files. You will have to adjust some stuff like the modules to use.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    The Times 1 Reply Last reply Reply Quote 3
                    • The Times
                      The Times @jsulm last edited by

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • The Times
                        The Times @jsulm last edited by

                        @jsulm Thanks, I managed to create the .pro file and import it to VS. However when I build the solution, I get this error :
                        " Error 1 error MSB3073: The command ""D:\CHAI3D\Qt\5.5\msvc2013_64\bin\rcc.exe" --list "....\CHAI3D" > "x64\Debug\rcc_list.txt" 2> nul" exited with code 1. C:\Users\Krystal\AppData\Local\QtMsBuild\qtrcc.targets 74 5 MyGui"

                        Do you have any idea on how I could go on about resolving it?

                        jsulm 1 Reply Last reply Reply Quote 0
                        • The Times
                          The Times @SGaist last edited by

                          @SGaist Thanks for the reply! I believe I have successfully created the .pro file but when I try to compile the solution in VS studio, I get the following error:

                          error MSB3073: The command ""D:\CHAI3D\Qt\5.5\msvc2013_64\bin\rcc.exe" --list "....\CHAI3D" > "x64\Debug\rcc_list.txt" 2> nul" exited with code 1. C:\Users\krystal\AppData\Local\QtMsBuild\qtrcc.targets 74 5 MyGui

                          Do you have any idea why this is happening?

                          1 Reply Last reply Reply Quote 0
                          • jsulm
                            jsulm Lifetime Qt Champion @The Times last edited by

                            @The-Times Can you build a simple Qt app created via the app template, or a Qt example app?

                            https://forum.qt.io/topic/113070/qt-code-of-conduct

                            The Times 2 Replies Last reply Reply Quote 0
                            • The Times
                              The Times @jsulm last edited by

                              @jsulm Yes, I can build a simple Qt app, it runs as expected

                              jsulm 1 Reply Last reply Reply Quote 0
                              • jsulm
                                jsulm Lifetime Qt Champion @The Times last edited by

                                @The-Times Can you post your pro file?

                                https://forum.qt.io/topic/113070/qt-code-of-conduct

                                The Times 1 Reply Last reply Reply Quote 0
                                • The Times
                                  The Times @jsulm last edited by

                                  @jsulm Do you mean this?

                                  #-------------------------------------------------
                                  #
                                  # Project created by QtCreator 2021-02-10T10:04:29
                                  #
                                  #-------------------------------------------------
                                  
                                  QT       += core gui
                                  
                                  greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                                  
                                  TARGET = MyGui
                                  TEMPLATE = app
                                  
                                  
                                  SOURCES += main.cpp\
                                     ModelDemo.cpp \
                                     ModelWidget.cpp
                                  
                                  HEADERS  += \
                                     ui_modeldemo.h \
                                     ui_ModelWidget.h
                                  
                                  FORMS    += \
                                     ../../CHAI3D Application/Qt Program/external/ModelDemo.ui \
                                     ../../CHAI3D Application/Qt Program/external/ModelDemo.ui \
                                     ../../CHAI3D Application/Qt Program/external/ModelDemo.ui \
                                     ModelDemo.ui
                                  
                                  RESOURCES += \
                                     ../../CHAI3D Application/Qt Program/external/ModelDemo.qrc \
                                     ModelDemo.qrc
                                  
                                  DISTFILES += \
                                     ../../external/CHAI3D/CHAI3D-VS2013.vcxproj
                                  
                                  
                                  1 Reply Last reply Reply Quote 0
                                  • The Times
                                    The Times @jsulm last edited by

                                    @jsulm I just don't even know what to try to do to resolve this error:

                                    "error MSB3073: The command ""D:\CHAI3D\Qt\5.5\msvc2013_64\bin\rcc.exe" --list "....\CHAI3D" > "x64\Debug\rcc_list.txt" 2> nul" exited with code 1. C:\Users\krystal\AppData\Local\QtMsBuild\qtrcc.targets 74 5 MyGui"

                                    jsulm 1 Reply Last reply Reply Quote 0
                                    • jsulm
                                      jsulm Lifetime Qt Champion @The Times last edited by

                                      @The-Times I'm wondering why most of your files are two levels above the pro file (../../*), but ModelDemo.qrc is not? Same for ModelDemo.ui.
                                      Why don't you put the pro file into CHAI3D Application/Qt Program/external? Everything belonging to a project should be in same folder, else it's a mess.

                                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      The Times 2 Replies Last reply Reply Quote 1
                                      • The Times
                                        The Times @jsulm last edited by

                                        @jsulm Really, thanks for your help. I reordered the files and made sure to organize everything, and understood why the error was occurring. Now I am getting other different errors and this is starting to feel like a never-ending cycle

                                        1 Reply Last reply Reply Quote 0
                                        • The Times
                                          The Times @jsulm last edited by

                                          @jsulm Hi! It's me again :). Ahh finally, I just compiled it successfully! I couldn't have done it without you!

                                          jsulm 1 Reply Last reply Reply Quote 1
                                          • jsulm
                                            jsulm Lifetime Qt Champion @The Times last edited by

                                            @The-Times Happy coding!

                                            https://forum.qt.io/topic/113070/qt-code-of-conduct

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