I have a program exported from another IDE that builds
successfully when I open a command prompt and navigate to the folder containing
the program and enter make, but which fails when I try to build it in Eclipse.
Here is the console output from the Eclipse build:
=====================================================================
06:57:48 **** Build of configuration Debug for project adc2 ****
make all
Building file: ../mbed-rtos/rtx/HAL_CM.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections
-fdata-sections -g3 -std=gnu11 -MMD -MP -MF"mbed-rtos/rtx/HAL_CM.d" -MT"mbed-rtos/rtx/HAL_CM.o"
-c -o "mbed-rtos/rtx/HAL_CM.o" "../mbed-rtos/rtx/HAL_CM.c"
Finished building: ../mbed-rtos/rtx/HAL_CM.c
Building file: ../mbed-rtos/rtx/RTX_Conf_CM.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections
-fdata-sections -g3 -std=gnu11 -MMD -MP -MF"mbed-rtos/rtx/RTX_Conf_CM.d" -MT"mbed-rtos/rtx/RTX_Conf_CM.o"
-c -o "mbed-rtos/rtx/RTX_Conf_CM.o" "../mbed-rtos/rtx/RTX_Conf_CM.c"
../mbed-rtos/rtx/RTX_Conf_CM.c:59:6: error: #error "no target defined"
../mbed-rtos/rtx/RTX_Conf_CM.c:72:6: error: #error "no target defined"
../mbed-rtos/rtx/RTX_Conf_CM.c:134:6: error: #error "no target defined"
In file included from ../mbed-rtos/rtx/RTX_Conf_CM.c:264:0:
../mbed-rtos/rtx/RTX_CM_lib.h:34:19: fatal error: error.h: No such file or
directory
compilation terminated.
make: *** [mbed-rtos/rtx/RTX_Conf_CM.o] Error 1
06:57:49 Build Finished (took 844ms)
=====================================================================
Here is a portion of the code of RTX_Conf_CM.c where first error occurred:
#ifndef OS_TASKCNT
# if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) ||
defined(TARGET_LPC4088) || defined
(TARGET_LPC1347) || defined(TARGET_K64F) \
|| defined(TARGET_KL46Z) || defined(TARGET_STM32F407) ||
defined(TARGET_F407VG) || defined (TARGET_STM32F303VC) ||
defined(TARGET_LPC1549) || defined(TARGET_LPC11U68)
# define OS_TASKCNT 14
# elif defined(TARGET_LPC11U24) || defined(TARGET_LPC11U35_401) ||
defined(TARGET_LPC11U35_501) || defined(TARGET_LPC1114) \
|| defined(TARGET_LPC812) || defined(TARGET_KL25Z) ||
defined(TARGET_STM32F100RB) || defined
(TARGET_STM32F051R8)
# define OS_TASKCNT 6
# else
# error "no target defined"
# endif
#endif
It appears that OS_TASKCNT is defined when it shouldn't be. The same is true for
other constants for the errors at line 72 and 134. What would cause these
constants to have been assigned a value prematurely? The only place where they are defined is in the above code.
The fourth error is another puzzle; the file error.h does exist but is in
another folder containing system files and is found when the program is built
outside of Eclipse.
Any suggestions?