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. How I can Run C code in QT creator?
Forum Updated to NodeBB v4.3 + New Features

How I can Run C code in QT creator?

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 5 Posters 760 Views 1 Watching
  • 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.
  • WaseeW Offline
    WaseeW Offline
    Wasee
    wrote on last edited by
    #1

    Hi everyone;
    I want to run C code in qt5, is it possible or not? If yes then how it can be done easily?

    Thanks

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      What problems do you face? It's not different than c++.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • WaseeW Offline
        WaseeW Offline
        Wasee
        wrote on last edited by
        #3

        @Christian-Ehrlicher
        This (https://github.com/analogdevicesinc/iio-oscilloscope) is opensource ADI API implemented in C + GTK I need to use few function then how can I can use them in QT.

        S 1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          And what's the actual problem then? Simply include the headers of the library and link against the libs.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          0
          • WaseeW Offline
            WaseeW Offline
            Wasee
            wrote on last edited by
            #5

            @Christian-Ehrlicher
            Thanks for your valuable response! Kindly give me very small example from this ADI API so that I can do it with ease.

            Thanks

            jsulmJ 1 Reply Last reply
            0
            • WaseeW Wasee

              @Christian-Ehrlicher
              Thanks for your valuable response! Kindly give me very small example from this ADI API so that I can do it with ease.

              Thanks

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Wasee Why do you ask in Qt forum for an example for an unrelated API?

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

              1 Reply Last reply
              0
              • WaseeW Offline
                WaseeW Offline
                Wasee
                wrote on last edited by
                #7

                @jsulm Hi;
                Because I didn't know about how to work with C in QT? If you have another from this API outside example of C with QT then you can quote.
                Thanks

                jsulmJ JonBJ 2 Replies Last reply
                0
                • WaseeW Wasee

                  @jsulm Hi;
                  Because I didn't know about how to work with C in QT? If you have another from this API outside example of C with QT then you can quote.
                  Thanks

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by jsulm
                  #8

                  @Wasee You are asking two different questions:

                  • How to use a library?
                  • How to use a specific API?

                  Do you understand that?

                  Using a library is not that hard. @Christian-Ehrlicher already told you what you need to do.
                  More information here: https://doc.qt.io/qtcreator/creator-project-qmake-libraries.html

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

                  1 Reply Last reply
                  1
                  • WaseeW Wasee

                    @jsulm Hi;
                    Because I didn't know about how to work with C in QT? If you have another from this API outside example of C with QT then you can quote.
                    Thanks

                    JonBJ Online
                    JonBJ Online
                    JonB
                    wrote on last edited by
                    #9

                    @Wasee said in How I can Run C code in QT creator?:

                    Because I didn't know about how to work with C in QT?

                    Qt is not a language. It's just some code written in C++. You call something written in C like you would from any C++ program, Qt is not relevant here.

                    1 Reply Last reply
                    0
                    • WaseeW Wasee

                      @Christian-Ehrlicher
                      This (https://github.com/analogdevicesinc/iio-oscilloscope) is opensource ADI API implemented in C + GTK I need to use few function then how can I can use them in QT.

                      S Offline
                      S Offline
                      SimonSchroeder
                      wrote on last edited by
                      #10

                      @Wasee said in How I can Run C code in QT creator?:

                      This (https://github.com/analogdevicesinc/iio-oscilloscope) is opensource ADI API implemented in C + GTK I need to use few function then how can I can use them in QT.

                      You say that this uses GTK. Since it is an oscilloscope I presume that it provides some widgets for display as well. If this is the case you cannot mix Qt and GTK for windowing. At least I wouldn't try it. And even if it works this will be way beyond your current experience level.

                      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