Go back to Richel Bilderbeek's homepage.

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

 

 

 

 

 

(C++) Compile error

 

Error emitted by the compiler, that prevents program execution. A compile warning starts program execution anyway.

 

Prefer compile errors to runtime errors [1]. Compile cleanly at high warning levels [2].

 

 

 

 

 

  1. OKAYQt CreatorWindows ::swprintf has not been declared
  2. OKAYC++ BuilderWindows _algo.c: Call to undefined function 'rand'
  3. OKAYC++ BuilderWindows _algo.c: Cannot modify a const object
  4. OKAYC++ BuilderWindows _algobase.h: Cannot convert 'const int' to 'MyClass *'
  5. ?OKAYCommand lineWindows _popen is not a member of std
  6. TODOQt CreatorWindows 'assert' was not declared in this scope
  7. ?FAILCommand lineUbuntu boost/filesystem.hpp: No such file or directory
  8. FAILC++ BuilderWindows borland.hpp: Only member functions may be 'const' or 'volatile'
  9. FAILC++ BuilderWindows bzconfig.h: Unknown compiler
  10. OKAYWtQt CreatorUbuntu cc1plus: internal compiler error: Segmentation fault
  11. ?OKAYCommand lineWindows CLK_TCK was not declared in this scope
  12. OKAYQt CreatorUbuntuNDS 'consoleInitDefault' was not declared in this scope
  13. FAILQt CreatorUbuntu 'Container::value_type' is not a type
  14. OKAYC++ BuilderWindows 'cout' is not a member of 'std'
  15. OKAYCommand lineWindows duplicate symbol
  16. FAILC++ BuilderWindows enable_if_does_not_work_on_this_compiler<void>
  17. OKAYC++ BuilderWindows 'endl' is not a member of 'std'
  18. FAILC++ BuilderWindows iterator.hpp: Invalid template argument list
  19. OKAYQt CreatorUbuntu jconfig.h: No such file or directory
  20. ?OKAYQt CreatorUbuntu jpeglib.h: No such file or directory
  21. ?FAILQt CreatorUbuntu 'jpeg_read_image' was not declared in this scope
  22. OKAYC++ BuilderWindows Multithreaded RTL must be selected
  23. OKAYC++ BuilderWindows 'MyPolicy::MyMethod' is not a direct base class of 'MyClass<MyPolicy>'
  24. OKAYQt CreatorUbuntu No matching function for call to 'ptr_fun'
  25. OKAYC++ BuilderWindows Only member functions may be 'const' or 'volatile'
  26. OKAYQt CreatorUbuntu openssl/conf.h: No such file or directory
  27. OKAYC++ BuilderWindows 'operator+' not implemented in type 'std::map<int,double>' for arguments of type 'int'
  28. ?FAILQt CreatorUbuntu QCanvas: No such file or directory
  29. OKAYQt CreatorUbuntu Request for member 'mX' in 'w', which is of non-class type 'Widget()'
  30. ?OKAYC++ BuilderWindows shared_ptr.hpp: Call to undefined function 'assert'
  31. OKAYC++ BuilderWindows shared_ptr.hpp: Cannot convert 'Y *' to 'Widget *'
  32. OKAYC++ BuilderWindows Size of @_STL@%vector%78_STL@... is unknown or zero
  33. ?FAILCommand lineUbuntu stdio.h:430: error: expected initializer before 'throw'
  34. OKAYQt CreatorUbuntuNDS 'SUB_BG0_CR' was not declared in this scope
  35. OKAYC++ BuilderWindows tuple_basic.hpp: Multiple declaration for 'element<N,T>'
  36. ?OKAYQt CreatorUbuntu Undefined reference to '[anything]'
  37. OKAYQt CreatorCygwinWindows UnicodeQt4.h:197: error: call of overloaded 'toLower(UChar32&)' is ambiguous
  38. FAILC++ BuilderWindows utilities.hpp: Invalid template argument list
  39. FAILC++ BuilderWindows Your compiler and/or configuration is unsupported by this verions of uBLAS
  40. ?FAILCommand lineUbuntu wchar.h:718: error: expected initializer before 'throw'

 

 

 

 

 

Qt Creator How to let compile warnings be treated like compile errors in Qt Creator?

 

In the project file, add the following line:

 

QMAKE_CXXFLAGS += -Werror

 

 

 

 

 

References

 

  1. Herb Sutter, Andrei Alexandrescu. C++ coding standards: 101 rules, guidelines, and best practices. ISBN: 0-32-111358-6. Item 14: 'Prefer compile- and link-time errors to run-time errors'.
  2. Herb Sutter, Andrei Alexandrescu. C++ coding standards: 101 rules, guidelines, and best practices. 2005. ISBN: 0-32-111358-6. Item 1: 'Compile cleanly at high warning levels'.

 

 

 

 

 

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

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict