- include right Headers - 5 Updates
- Nice graphs, how to write? - 1 Update
- "Code behaving differently in C90, C99, C11, C++98, and C++11" - 1 Update
- NoFussXML - Free, lightweight C++ XML library - 1 Update
- Why not designated initializers in C++? - 3 Updates
Paavo Helde <myfirstname@osa.pri.ee>: Jul 25 09:12PM +0300 > from main.cpp:1: > Sub.h:4:7: error: previous definition of 'class Sub' > class Sub : public Base { You need to protect your header files against multiple inclusion. Nowadays in practice it is just OK to put in the start of each header file: #pragma once |
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Jul 25 09:56PM +0200 On 25.07.2016 21:14, Jerry Stuckle wrote: > Just beware that not all compilers support #pragma once. There is a list in Wikipedia. In practice, a compiler that doesn't support `#pragma once` is one that quite likely also has many other quirks, i.e. not a good idea to use it. >
Subscribe to:
Post Comments (Atom)
|
No comments:
Post a Comment