I am trying to compile a C file with gcc. The code in header file will need specified architecture in order to compile.
#if defined( _8BIT_ARCHITECTURE )
#include "type8.h"
#elif defined( _16BIT_ARCHITECTURE )
#include "type16.h"
#elif defined( _32BIT_ARCHITECTURE )
#include "type32.h"
#else
#error ARCHITECTURE not defined
#endif
When using Visual Studio, I can configure the platform into 32-bit and it can build successfully. But how do I do the same thing with gcc commands?
I was trying to use:
gcc -m32 -c myFile.c -I /somePath/
But it keeps giving me the error statement:
#error ARCHITECTURE not defined
Adding -D_32BIT_ARCHITECTURE
fix the issue