Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) 'assert' was not declared in this scope

 

Qt CreatorWindows

 

Compile error.

 

 

 

 

Enviornment

 

Operating system(s):

IDE(s):

Project type:

Compiler(s):

Libraries used:

 

 

 

 

 

Code

 

#include <cassert>

int main()
{
  assert(1!=2);
}

 

 

 

 

 

Observations

 

On Windows, the location of cassert.h was 'C:\qt\2010.02.1\mingw\lib\gcc\mingw32\4.4.0\include\c++\cassert.h'. In cassert.h, assert.h was #included, but this file seems absent.

 

On Ubuntu, cassert was located at /usr/include/c++/4.4/cassert.h, assert.h at /usr/include/assert.h. I uploaded it to here and copied it to C:\qt\2010.02.1\mingw\lib\gcc\mingw32\4.4.0\include\c++\assert.h', but this fails.

 

 

 

 

 

Solution

 

 

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict