Weird compilation behavior after starting LPCXpresso 7 (missing: -specs=redlib.specs flag)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Weird compilation behavior after starting LPCXpresso 7 (missing: -specs=redlib.specs flag)

647 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by OldManVimes on Mon Mar 10 12:15:43 MST 2014
Hello support,

I've noticed something weird after migrating to LPCXpresso v7.0.0 [Build 92] [2014-02-20].
My project targets an LPC1227 using the MCU compiler and the CodeRed library.

If I start the IDE, perform "Clean Project" followed by a "Build Project" I get compilation errors related to "_printf" not being defined. _printf gets used in my code (yes I know what I'm doing). My guess is that the compilation does not use the MCU compiler/settings. I can compile as much as I like, but the result is the same. It keeps failing with the same errors.

To fix this, I open the project properties and then go to  the "C/C++ Build" tab. Then I press "Cancel" (this is exactly what I do!). If I then compile, it succeeds. Note that this does not touch the .project file and it is not being checked out as a result of opening the properties.

My project file uses a managed makefile and uses the external builder.

Output from a failed compilation:
arm-none-eabi-gcc -D__REDLIB__ -DNDEBUG -D__CODE_RED -DCORE_M0 -D__USE_ROMDIVIDE -D__USE_CMSIS=CMSIS_CORE_LPC12xx -D__LPC12XX__ -DCR_INTEGER_PRINTF -I"C:\Users\xxx\Documents\LPCXpresso_7.0.0_92\workspace\xxx\inc" -I"C:\Users\xxx\Documents\LPCXpresso_7.0.0_92\workspace\xxx\inc\CMSIS" -Os -g -Wall -Werror -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -std=gnu99 -mcpu=cortex-m0 -mthumb -D__REDLIB__ -MMD -MP -MF"src/accelerometer.d" -MT"src/accelerometer.d" -o "src/accelerometer.o" "../src/accelerometer.c"
../src/accelerometer.c: In function 'accelerometerReadData':
Invoking: MCU C Compiler
../src/accelerometer.c:116:3: error: implicit declaration of function '_printf' [-Werror=implicit-function-declaration]
   Dprintf ("ADXL344_trigger(%u)", nofFifoEntries);

And from a succeeding compilation:
arm-none-eabi-gcc -D__REDLIB__ -DNDEBUG -D__CODE_RED -DCORE_M0 -D__USE_ROMDIVIDE -D__USE_CMSIS=CMSIS_CORE_LPC12xx -D__LPC12XX__ -DCR_INTEGER_PRINTF -I"C:\Users\xxx\Documents\LPCXpresso_7.0.0_92\workspace\xxx\inc" -I"C:\Users\xxx\Documents\LPCXpresso_7.0.0_92\workspace\xxx\inc\CMSIS" -Os -g -Wall -Werror -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -std=gnu99 -mcpu=cortex-m0 -mthumb -D__REDLIB__ -specs=redlib.specs -MMD -MP -MF"src/accelerometer.d" -MT"src/accelerometer.d" -o "src/accelerometer.o" "../src/accelerometer.c"

Note: xxx has been added to protect the innocent.

Question: why is the -specs flag missing from the compiler invocation until the C/C++ build tab in the project properties has been opened?
0 Kudos
9 Replies

598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tom asdfghjkl on Fri Apr 11 02:12:25 MST 2014
The project I'm working on has an identical problem when the switch was made from v6.1.4_194 to v7.1.1_125.

When starting LPCXpresso and then cleaning & building the project, it results in undefined references to _impure_ptr and swbuf_r, both originating from a putchar() call, where purchar is in fact not defined in redlib/include/stdio.h, but in arm-none-eabi/include/stdio.h.

But when I then go to project settings, to the C/C++ build tab, hit cancel, and then clean & build, it compiles succesfully.

Just like OldManVibes' project, it is the case that -specs=redlib.specs is not passed the in the first compilation, but is passed in the second compilation. I'm guessing that this is what's causing the problem in my case too.
0 Kudos

598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by OldManVimes on Tue Mar 11 12:28:08 MST 2014
Thanks for the support. I might just try that.
Bye.
0 Kudos

598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Mar 11 10:46:41 MST 2014
We have tried repeatedly to reproduce your problem (including using your .cproject file) and have failed - it works correctly every time.

We use Subclipse and not Subversive. We have never seen a problem with Subclipse. Perhaps you want to try that instead?
0 Kudos

598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by OldManVimes on Tue Mar 11 10:28:41 MST 2014
Hello support,

Funny thing. I was setting up a copy of my project without version control in a new workspace so I could strip the contents to send to you.
I first tried a compilation and that just works. So then I figured there might be a relation to the .workspace directory contents. I setup a completely new workspace with version control for my projects and it failed again.

The difference between the two situations is version control. The workspace that has no issue has no link to version control. I'm using SVN. So I could send you a skeleton project, but I don't think you will be able to find anything using that. I now suspect there is some relation to the SVN plugin.

I've added a screenshot for the SVN plugin version info.
0 Kudos

598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Mar 10 15:53:29 MST 2014
Can you provide the cproject, project files as, is, and all of the source files but with no content. I.e. Delete the content of all source file. This will allow us to load the project to see what is going on. We won't need to build the project.
0 Kudos

598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by OldManVimes on Mon Mar 10 14:13:27 MST 2014
Sympathetic to that request, but not going to happen. I can't give you any more.
0 Kudos

598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Mar 10 14:06:30 MST 2014
Sorry, but to be able to reproduce the problem, we need the entire project, not just on file.
0 Kudos

598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by OldManVimes on Mon Mar 10 13:25:19 MST 2014
Hello support,

The project was copied from LPCXpresso 6.1.4_194
I did update the settings a bit to make them compatible for the newer environment, but it is not a new project.

I've added the project file, but changed the project name inside the file. For the rest it is identical to what I've got in version control.

Thanks,
Vimes
0 Kudos

598 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Mar 10 12:26:22 MST 2014
How did you create the project? Did you port it from a previous release? Can you post the (broken) project?
0 Kudos