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. porting a project from Eclipse to QtCreator causes mysterious errors
Forum Updated to NodeBB v4.3 + New Features

porting a project from Eclipse to QtCreator causes mysterious errors

Scheduled Pinned Locked Moved General and Desktop
9 Posts 3 Posters 2.9k Views 2 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.
  • Q Offline
    Q Offline
    qtNiko
    wrote on last edited by
    #1

    hi,
    I want to transfer a Qt-project from Eclipse CDT Helios, Qt Integration, on Linux to QtCreator on Win 7. With Eclipse the project builds without any errors. With QtCreator there are errors like e.g.:

    Code --> errormessage
    #define ULONG unsigned long --> duplicate 'unsigned'
    #define FLOAT float --> multiple types in one declaration
    #define INT short int --> multiple types in one declaration

    There are many more errors. But these errors with the #defines I do not understand at all.

    Has somebody an idea what could be wrong here?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by mcosta
      #2

      Hi and welcome to devnet?

      both Eclipse and Qt Creator are configured to use the same compiler??

      Do you used Eclipse to build also on Windows??

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qtNiko
        wrote on last edited by
        #3

        Eclipse is used only on Linux. Eclipse uses gcc.

        I guess, Qt Creator uses MinGW. For the installation of Qt Creator I selected the MinGW version. But in the configuration settings (Einstellungen) for the compiler MinGW and MS Visual C++ are shown - "automatically selected".

        Meantimes most of the errors are eliminated. The problem was that many of my '#defines' used names which are also defined in minwindef.h, and minwindef.h seems to be included by some Qt Creator programs.

        There is one remaining problem:
        '#define DOUBLE double ' results in the error 'multiple types in one declaration'. But DOUBLE is not defined in minwindef.h.

        When I have found the final solution I will mark this topic als solved and describe the solution. Hopefully I will find it :-(

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mcosta
          wrote on last edited by
          #4

          Hi,

          the problem is not related to the IDE but to the compiler.
          It fails to build if you use both compilers (MinGW and Visual C++)??

          Once your problem is solved don't forget to:

          • Mark the thread as SOLVED using the Topic Tool menu
          • Vote up the answer(s) that helped you to solve the issue

          You can embed images using (http://imgur.com/) or (http://postimage.org/)

          1 Reply Last reply
          0
          • Q Offline
            Q Offline
            qtNiko
            wrote on last edited by
            #5

            I am not sure about the compilers.

            In Eclipse I saw 'gcc' in the properties.
            And for Qt Creator I selected the MinGW version. So hopefully Qt Creator uses MinGW.
            In an early try I had installed the MS Visual C++ version of Qt Creator. But then there were many more errors. Therefore I chose the MinGW version.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mcosta
              wrote on last edited by
              #6

              Just to clarify: Qt Creator is an IDE and is independent from the compiler; the Qt version to choose depends to the compiler

              Once your problem is solved don't forget to:

              • Mark the thread as SOLVED using the Topic Tool menu
              • Vote up the answer(s) that helped you to solve the issue

              You can embed images using (http://imgur.com/) or (http://postimage.org/)

              1 Reply Last reply
              0
              • Q Offline
                Q Offline
                qtNiko
                wrote on last edited by
                #7

                I doubt that it is the compiler.
                A compiler just compiles what it is told to.
                The IDE tells the compiler what to compile.

                Most problems came up because anywhere - I don't know where - the header file minwindef.h has been included. For sure, nowhere in my project this file is included. I did not know it at all. So it must have been the IDE which included it for any purpose.
                I guess that it is the different Qt version. On Linux (Eclipse) it is Qt 4.7 and on win7 (Qt Creator) it is Qt 5.3.

                M 1 Reply Last reply
                0
                • Q qtNiko

                  I doubt that it is the compiler.
                  A compiler just compiles what it is told to.
                  The IDE tells the compiler what to compile.

                  Most problems came up because anywhere - I don't know where - the header file minwindef.h has been included. For sure, nowhere in my project this file is included. I did not know it at all. So it must have been the IDE which included it for any purpose.
                  I guess that it is the different Qt version. On Linux (Eclipse) it is Qt 4.7 and on win7 (Qt Creator) it is Qt 5.3.

                  M Offline
                  M Offline
                  mcosta
                  wrote on last edited by mcosta
                  #8

                  @qtNiko said:

                  I doubt that it is the compiler.
                  A compiler just compiles what it is told to.
                  The IDE tells the compiler what to compile.

                  Not true! Qt Creator is simply a IDE: it runs qmake and then make (no magic stuff).
                  The build process of Qt projects is controlled by qmake that is a tool independent by IDE

                  Most problems came up because anywhere - I don't know where - the header file minwindef.h has been included. For sure, nowhere in my project this file is included. I did not know it at all. So it must have been the IDE which included it for any purpose.

                  minwindef.h is part of MinGW header files

                  I guess that it is the different Qt version. On Linux (Eclipse) it is Qt 4.7 and on win7 (Qt Creator) it is Qt 5.3.

                  You can simply build your project manually on both platform running:

                  1. qmake <project_file>.pro
                  2. make

                  both Eclipse and Qt Creator run the same sequence when you build a Qt project.

                  Once your problem is solved don't forget to:

                  • Mark the thread as SOLVED using the Topic Tool menu
                  • Vote up the answer(s) that helped you to solve the issue

                  You can embed images using (http://imgur.com/) or (http://postimage.org/)

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    mchinand
                    wrote on last edited by mchinand
                    #9

                    You've changed, platforms (Linux to Windows), IDE (Eclipse to Qt Creator), compiler (gcc to mingw), and Qt version (Qt4.7 to Qt 5.3). Running qmake with a different spec file (determined by your platform and compiler) can affect the compiler options and includes. Have you read the Qt4 to Qt5 porting guide?

                    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