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



  • 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!



  • Hi,

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

    Debao



  • 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.



  • 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?



  • 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!

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.