Appendix A - Compiler Settings
The following are sample compiler configuration (in the Options → C/C++ Compilers
settings). They are used only to run the preprocessor.
Note: eCv may be supplied with some predefined compiler configurations, so you may not need to set these up yourself.
Microsoft Visual C++ or Visual C++ Express
- executable is "C:/Program Files/Microsoft Visual Studio ###/vc/bin/cl.exe" where ### depends on the version you installed (8 for 2005, 9.0 for 2008 and 10.0 for 2010)
- additional path for executable files is "C:/Program Files/Microsoft Visual Studio ###/Common7/IDE"
- language is C90 or C++ as desired (C99 is not supported)
- char is signed unless the /J compiler option is used, in which case it is unsigned
- wchar_t is unsigned
- sizes for char, short, int, long, long long are 8, 16, 32, 32, 64 respectively
- sizes for float, double, long double are 32, 64, 64 respectively
- pointer size is 32 bits when using the 32-bit compilers, or 64 bits when using the 64-bit compilers
- integer division rounds towards zero
- include path intro is "/I" (that's capital i as in Include)
- include path separator is " /I" (that's capital i as in Include; note the extra space at the start)
- #define intro is "/D"
- #define separator is " /D" (note the extra space)
- preprocessor command for C90 is: "/P /nologo /Za /TC $d $i $x $f".
- preprocessor command for C++ is: "/P /nologo /Za /TP $d $i $x $f".
Under 64-bit Windows, replace "Program Files" in all the above by "Program Files (x86)".
gcc
- executable is "cpp" (this runs the preprocessor directly) - if you are running under Windows via MinGW or Cygwin, then use "cpp.exe" and provide the full path
- additional path for executable files - under Windows this should be the folder containing file cc1.exe
- language is C90, C99 or C++ as desired
- for modern versions of gcc, the sizes for various types and the signedness of plain char and wchar_t are as defined by the Application Binary Interface for the platform you are targeting
(the signedness of plain char can be overridden by compiler options -funsigned-char and -fsigned-char,
and wchar_t can be forced to be equivalent to unsigned short int with -fshort-wchar)
- integer division rounds towards zero
- include path intro is "-I " (that's capital i as in Include)
- include path separator is " -I " (that's capital i as in Include; note the extra space at the start)
- #define intro is "-D "
- #define separator is " -D " (note the extra space at the start)
- preprocessor command for C90 is: "-x c -std=c90 -o $o $d $i $x $f".
- preprocessor command for C99 is: "-x c -std=c99 -o $o $d $i $x $f".
- preprocessor command for C++ is: "-x c -std=c++98 -o $o $d $i $x $f".
Important: some of the header files for gcc use non-standard syntax of the form __attribute__((...)).
In order to hide this syntax from eCv, file eCv.h #defines __attribute__(_x) as a null macro when both __ECV__ and
__GNUC__ are defined. However, certain gcc-related header files (e.g. _mingw.h) contain the line "#undef
__attribute__". You will need to remove any such lines, or surround them with #ifndef __ECV__ ... #endif.
eCv Manual, Version 7.0, February 2017.
© 2017 Escher Technologies Limited. All rights reserved.