0

I seem to continually see compile errors in mine and the projects of others where, in particular, size_t is detected as redefined. Sometimes this can be traced back to an x86/x64 mismatch but often it seems to make no sense at all and be the result of a whole nested collection of includes I am not responsible for.

The Visual C++ error returned is powerfully unhelpful, simply suggesting redefinition without pointing out where the first definition happened. I am looking for a way of finding all definitions that are actually participating in my build and detecting the error. I have looked at the header file, it is protected from redefinition so that leaves me with no more ideas.

The present project is building an Arduino project in VC++. I have removed all connection to the default GCC headers, only using the Arduino header paths, and only including a single header file, Arduino.h, once. Strangely, with no headers included at all, size_t is defined, but with Arduino.h it is. A corollary question would be where is this definition coming from?

J Collins
  • 2,106
  • 1
  • 23
  • 30
  • 1
    Define `size_t` as a macro expanding to `!@#` (or any random garbage) in project settings or on command line. You'll get a syntax error on the first line the compiler encounters that mentions `size_t`. – Igor Tandetnik Jun 09 '14 at 20:34
  • I like that, not elegant but cunning and effective. – J Collins Jun 10 '14 at 20:16

0 Answers0