Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[Solved] Windows Port: mingw32 issue (C and C++)
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:
error: '::strtold' has not been declared
error: '__gnu_cxx::strtold' has not been declared
error: '::wcstold' has not been declared
error: '__gnu_cxx::wcstold' has not been declared
- 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?
dbzhang800 last edited by
I could not figure out why cstdlib instead of stdlib.h is used in your C application.
Interesting... I was looking for:
% egrep -r cstdlib *
% 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:
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.
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!