Questions tagged [include-guards]

Anything related to C/C++ include guards technique, i.e. a technique employing C-preprocessor conditional compilation features in order to prevent multiple inclusion of header files in C/C++ source files.

Anything related to C/C++ include guards technique, i.e. a technique employing C-preprocessor conditional compilation features in order to prevent multiple inclusion of header files in C/C++ source files.

185 questions
-1
votes
1 answer

Why is it Possible in C/C++ to Include a Header Multiple Times?

Considering the efforts it goes to add include guards to each header file and the added possibilities of errors they introduce (e.g. using the same macro name in more than one file), why are they not build into the language as default…
pooya13
  • 2,060
  • 2
  • 23
  • 29
-1
votes
2 answers

error C2027: use of undefined type, with multiple files

I am aware there are multiple questions regarding this problem but none provides a solution under my constraints. I am working on a project where a header file mips_cpu.h with a certain API is given. I am intended to develope its implementation…
gorilon
  • 424
  • 3
  • 12
-2
votes
2 answers

Avoiding multiple includes c++

My header files are structured as follows base.h / \ / \ utilities.h parameters.h \ / \ / kernels.h …
lefe
  • 147
  • 1
  • 10
-2
votes
1 answer

How reordering include directories solves macro redefinition issue?

I know there are many post on macro redefinition issues but I still cannot understand how the reorder fix the problem. When my project has includes in this order in VC++ Directories->Include Directories like shown in here and in C/C++ -> General ->…
-3
votes
1 answer

Header Guard Issues - Getting Swallowed Alive

I'm totally at wit's end: I can't figure out how my dependency issues. I've read countless posts and blogs and reworked my code so many times that I can't even remember what almost worked and what didnt. I continually get not only redefinition…
gjnave
  • 479
  • 4
  • 14
1 2 3
12
13