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.
  • W Offline
    W Offline
    Wasee
    wrote on 23 Feb 2022, 09:58 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
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 23 Feb 2022, 10:00 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
      • W Offline
        W Offline
        Wasee
        wrote on 23 Feb 2022, 10:13 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 24 Feb 2022, 07:08
        0
        • C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 23 Feb 2022, 10:16 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
          • W Offline
            W Offline
            Wasee
            wrote on 23 Feb 2022, 10:23 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

            J 1 Reply Last reply 23 Feb 2022, 10:26
            0
            • W Wasee
              23 Feb 2022, 10:23

              @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

              J Online
              J Online
              jsulm
              Lifetime Qt Champion
              wrote on 23 Feb 2022, 10:26 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
              • W Offline
                W Offline
                Wasee
                wrote on 23 Feb 2022, 10:35 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

                J J 2 Replies Last reply 23 Feb 2022, 10:39
                0
                • W Wasee
                  23 Feb 2022, 10:35

                  @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

                  J Online
                  J Online
                  jsulm
                  Lifetime Qt Champion
                  wrote on 23 Feb 2022, 10:39 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
                  • W Wasee
                    23 Feb 2022, 10:35

                    @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

                    J Offline
                    J Offline
                    JonB
                    wrote on 23 Feb 2022, 12:38 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
                    • W Wasee
                      23 Feb 2022, 10:13

                      @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 24 Feb 2022, 07:08 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

                      1/10

                      23 Feb 2022, 09:58

                      • Login

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