March 28, 2012

xtingray xtingray
Lab Rat
60 posts

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

 Signature 

—-
Gustav Gonzalez
Development Leader
.(JavaScript must be enabled to view this email address)

Tupi: Magia 2D
http://www.maefloresta.com
—-

4 replies

March 29, 2012

1+1=2 1+1=2
Hobby Entomologist
309 posts

Hi,

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

Debao

March 29, 2012

xtingray xtingray
Lab Rat
60 posts

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.

 Signature 

—-
Gustav Gonzalez
Development Leader
.(JavaScript must be enabled to view this email address)

Tupi: Magia 2D
http://www.maefloresta.com
—-

March 30, 2012

xtingray xtingray
Lab Rat
60 posts

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?

 Signature 

—-
Gustav Gonzalez
Development Leader
.(JavaScript must be enabled to view this email address)

Tupi: Magia 2D
http://www.maefloresta.com
—-

March 31, 2012

xtingray xtingray
Lab Rat
60 posts

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

—-
Gustav Gonzalez
Development Leader
.(JavaScript must be enabled to view this email address)

Tupi: Magia 2D
http://www.maefloresta.com
—-

 
  ‹‹ [self solved]Text lose highlight      Opening KDE Konsole from Qt and sending a command ››

You must log in to post a reply. Not a member yet? Register here!