Qt Forum

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

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    [Solved] Windows Port: mingw32 issue (C and C++)

    General and Desktop
    2
    5
    3919
    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.
    • X
      xtingray last edited by

      Hi everyone,

      Currently, I'm working on the Windows (7) port of my Qt project and I'm getting stuck with some message errors when I try to compile the first component (written in C) of my app:

      c:\qtsdk\mingw\bin..\lib\gcc\mingw32\4.4.0\include\c++\cstdlib:195:
      error: '::strtold' has not been declared
      c:\qtsdk\mingw\bin..\lib\gcc\mingw32\4.4.0\include\c++\cstdlib:215:
      error: '__gnu_cxx::strtold' has not been declared
      c:\qtsdk\mingw\bin..\lib\gcc\mingw32\4.4.0\include\c++\cwchar:245:
      error: '::wcstold' has not been declared
      c:\qtsdk\mingw\bin../lib/gcc/mingw32/4.4.0/include/c++/cwchar:262:
      error: '__gnu_cxx::wcstold' has not been declared

      Some context:

      • I have installed the Qt SDK with all its compounds
      • As plan B, I have installed Cygwin in other directory and I set it as toolchain for QtCreator, in case the Qt's gcc was missing a library.

      Do I have to do something else if my app includes a compound written in C? Any hint?

      Thanks!


      Qt Developer

      1 Reply Last reply Reply Quote 0
      • D
        dbzhang800 last edited by

        Hi,

        I could not figure out why cstdlib instead of stdlib.h is used in your C application.

        Debao

        1 Reply Last reply Reply Quote 0
        • X
          xtingray last edited by

          Interesting... I was looking for:

          % egrep -r cstdlib *

          and for:

          % egrep -r strtold *

          within the source code sub-directory and I couldn't find anything. So, just guessing, this message seems to be related to some conflict between the cygwin installation and QtCreator. I'll take a look deeper.


          Qt Developer

          1 Reply Last reply Reply Quote 0
          • X
            xtingray last edited by

            This is the compilation output related to the error:
            http://www.maefloresta.com/portal/files/gcc-error.txt

            After running some tests, I found out something very weird: the error is triggered as soon as the compiler finds an include reference of any Qt object. I was changing the order of the headers to verify the issue and it always happens with the first include line.
            I'm starting to think that the problem is related to my Qt installation and not to my code.

            Any hints?


            Qt Developer

            1 Reply Last reply Reply Quote 0
            • X
              xtingray last edited by

              Ok, finally I discovered what was wrong with my project settings:

              • I installed Cygwin to use it as alternative toolchain and to use the zlib headers required by my project
              • I included the PATH of the cygwin headers into my .pro file
              • In some way, the cygwin headers are incompatible with the Qt headers, generating the compilation error.

              To solve it:

              • I just copied the zlib.h/zconf.h files in a new directory, and then I set this new PATH into my .pro file. Now the compilation is clean!

              Qt Developer

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