How does work target in compilation (in C) ? I am working on a project and I failed on that #error You have to define a target in your compiler project properties.
And I wonder what was exacly target in compilation and how does it works.
My compiler is GCC
EDIT
here is my error: In file included from ../../../RefFT/Common/src/SIGPROC_COMMON_ippdefs.h:55:0, from ../../../RefFT/Common/src/SIGPROC_COMMON_memory_alloc.c:36: ../../../../../../../Generic/Common/Include/target_definition.h:195:6: error: #error You have to define a target in your compiler project properties. #error You have to define a target in your compiler \\
In file included from ../../../RefFT/Common/src/SIGPROC_COMMON_ippdefs.h:55:0, from ../../../RefFT/Common/src/SIGPROC_COMMON_memory_alloc.c:36: ../../../../../../../Generic/Common/Include/target_definition.h:195:6: error: #error You have to define a target in your compiler project properties. #error You have to define a target in your compiler \\
I work on a project that was compile for Iphone Target (might be compile with xcode) and I want to compile it with gcc.
Here is a part of the target_definition.h
#ifdef _X86_VC6_TARGET_
#define TARGET X86_VC6_TARGET
#elif defined _X86_VC7_1_TARGET_
#define TARGET X86_VC7_1_TARGET
#elif defined _X86_VC8_TARGET_
#define TARGET X86_VC8_TARGET
#elif defined _X86_VC9_TARGET_
#define TARGET X86_VC9_TARGET
#elif defined _X86_VC11_TARGET_
#define TARGET X86_VC11_TARGET
#elif defined _X86_VC12_TARGET_
#define TARGET X86_VC12_TARGET
#elif defined _X86_GCC_3_2_2_TARGET_
#define TARGET X86_GCC_3_2_2_TARGET
#elif defined _X86_GCC_4_1_1_TARGET_
#define TARGET X86_GCC_4_1_1_TARGET
#elif defined _MACOS_TARGET_
#define __macos__
#define TARGET MACOS_TARGET
#elif defined _X86_MACOS_GCC_4_2_1_TARGET_
#define __macos__
#define TARGET X86_MACOS_GCC_4_2_1_TARGET
#elif defined _X86_MSYS_GCC_4_4_1_TARGET_
#define TARGET X86_MSYS_GCC_4_4_1_TARGET
#elif defined _ARM11_IPHONEOS_GCC_4_2_1_TARGET_
#define TARGET ARM11_IPHONEOS_GCC_4_2_1_TARGET
#elif defined _IPHONEOS_TARGET_
#define TARGET IPHONEOS_TARGET
#elif defined _ARM9_VE4_TARGET_
#define TARGET ARM9_VE4_TARGET
#elif defined _ARM9_VC8_TARGET_
#define TARGET ARM9_VC8_TARGET
#elif defined _ARM9_GCC_TARGET_
#else
#error You have to define a target in your compiler \
You don't say what compiler verson or OS, but from the code, you need to define the appropriate identifier (probably by using the -D
flag passed to gcc
via your makefile).
Here's the ones for GCC:
_X86_GCC_3_2_2_TARGET_
_X86_GCC_4_1_1_TARGET_ << Probably this one for Linux
_X86_MACOS_GCC_4_2_1_TARGET_
_X86_MSYS_GCC_4_4_1_TARGET_ << Or this one for Windows
_ARM11_IPHONEOS_GCC_4_2_1_TARGET_
_ARM9_GCC_TARGET_
Your code expects one of several preprocessor macros to be externally defined, presumably to help it choose among various compiler-specific optimizations or non-standard features. That you receive such an error when trying to build the project with make
suggests either a poor or incomplete build system, or having skipped steps in some kind of pre-build configuration process. Possibly both.
It might be that you can get past this particular issue by doing something like this:
make CFLAGS=-D_X86_GCC_4_1_1_TARGET_=1
instead of a bare make
, but you really ought to read the builder / installer documentation, as there is probably a better way to go about it, and there may be other things you need to do.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.