Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Build problems(Constant defined prematurely, include file not found)
Build problems [message #1384845] Mon, 02 June 2014 13:42 Go to next message
Gary Richardson is currently offline Gary RichardsonFriend
Messages: 2
Registered: June 2014
Junior Member
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?


Re: Build problems [message #1396103 is a reply to message #1384845] Mon, 07 July 2014 21:59 Go to previous message
Martin Heine is currently offline Martin HeineFriend
Messages: 1
Registered: July 2014
Junior Member
I have exactly the same problem!

Runnung LPCXpresso v7.2.0 [Build 153] [2014-05-19]
When I am in debug mode, it compiles just fine. But as soon I try release build, I get the error message:

In file included from ../mbed-rtos/rtx/RTX_Conf_CM.c:262:0:
../mbed-rtos/rtx/RTX_CM_lib.h:34:19: fatal error: error.h: No such file or directory
#include "error.h"
^
compilation terminated.
make: *** [mbed-rtos/rtx/RTX_Conf_CM.o] Error 1


Previous Topic:info overlay window (F2 to focus) has black background and black font
Next Topic:Ubunut apt-get eclipse-cdt and no c++ projects available
Goto Forum:
  


Current Time: Tue Apr 23 15:56:52 GMT 2024

Powered by FUDForum. Page generated in 0.02644 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top