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. Using mix of C and C++ languages in one project. How?
Forum Updated to NodeBB v4.3 + New Features

Using mix of C and C++ languages in one project. How?

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 3 Posters 1.2k 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.
  • B Offline
    B Offline
    bogong
    wrote on last edited by bogong
    #1

    Hello all!
    My project contain both languages C and C++. I am trying to migrate on Qt Creator from CLion. Is there any way to use C and C++ in one project in Qt Creator? I've not found yet mixed solution for using both of this languages.
    Could someone to give right ways for solving this migration issue?

    aha_1980A VRoninV 2 Replies Last reply
    0
    • B bogong

      Hello all!
      My project contain both languages C and C++. I am trying to migrate on Qt Creator from CLion. Is there any way to use C and C++ in one project in Qt Creator? I've not found yet mixed solution for using both of this languages.
      Could someone to give right ways for solving this migration issue?

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi@bogong, welcome.

      Which project type (CMake, QMake, QBS) are you using?

      I've multiple qmake projects with mixed C/C++ files and that works flawlessy.

      Qt has to stay free or it will die.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bogong
        wrote on last edited by bogong
        #3

        For now I have no constant type. I am experimenting and choosing right one. All that I've been trying to build under QMake type.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bogong
          wrote on last edited by
          #4

          Could you share type and project configuration that you are using for it? And beside all of it I have custom build based on "make" and "Makefiles".

          B 1 Reply Last reply
          0
          • VRoninV Offline
            VRoninV Offline
            VRonin
            wrote on last edited by
            #5

            CMake uses the file extension to chose the language. .c is C, .cpp is C++

            "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
            ~Napoleon Bonaparte

            On a crusade to banish setIndexWidget() from the holy land of Qt

            1 Reply Last reply
            1
            • B bogong

              Hello all!
              My project contain both languages C and C++. I am trying to migrate on Qt Creator from CLion. Is there any way to use C and C++ in one project in Qt Creator? I've not found yet mixed solution for using both of this languages.
              Could someone to give right ways for solving this migration issue?

              VRoninV Offline
              VRoninV Offline
              VRonin
              wrote on last edited by
              #6

              @bogong said in Using mix of C and C++ languages in one project. How?:

              I am trying to migrate on Qt Creator from CLion

              AFAIK CLion uses CMake and Qt Creator is able to open CMake projects directly so there should be no need for a big migration

              "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
              ~Napoleon Bonaparte

              On a crusade to banish setIndexWidget() from the holy land of Qt

              1 Reply Last reply
              1
              • B bogong

                Could you share type and project configuration that you are using for it? And beside all of it I have custom build based on "make" and "Makefiles".

                B Offline
                B Offline
                bogong
                wrote on last edited by
                #7

                @bogong said in Using mix of C and C++ languages in one project. How?:

                Could you share type and project configuration that you are using for it? And beside all of it I have custom build based on "make" and "Makefiles".

                @VRONIN The Cmake strict dependency that why I am migrating from CLion.

                VRoninV 1 Reply Last reply
                0
                • B bogong

                  @bogong said in Using mix of C and C++ languages in one project. How?:

                  Could you share type and project configuration that you are using for it? And beside all of it I have custom build based on "make" and "Makefiles".

                  @VRONIN The Cmake strict dependency that why I am migrating from CLion.

                  VRoninV Offline
                  VRoninV Offline
                  VRonin
                  wrote on last edited by
                  #8

                  @bogong said in Using mix of C and C++ languages in one project. How?:

                  The Cmake strict dependency that why I am migrating from CLion.

                  Just as a disclaimer, while qmake will always remain available, Qt6 will use CMake as main build system

                  "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                  ~Napoleon Bonaparte

                  On a crusade to banish setIndexWidget() from the holy land of Qt

                  1 Reply Last reply
                  1
                  • B Offline
                    B Offline
                    bogong
                    wrote on last edited by bogong
                    #9

                    @VRONIN Is it - "My project contain both languages C and C++. I am trying to migrate on Qt Creator from CLion." looking like I am using QT?

                    1 Reply Last reply
                    0
                    • VRoninV Offline
                      VRoninV Offline
                      VRonin
                      wrote on last edited by
                      #10

                      You posted in General and Desktop, not in Tools so yes, it's fair to assume so.
                      Nevertheless, Qt Creator based on Qt6 will very likely use CMake as default project (once again, qmake will still be supported and available)

                      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                      ~Napoleon Bonaparte

                      On a crusade to banish setIndexWidget() from the holy land of Qt

                      1 Reply Last reply
                      1

                      • Login

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