Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

compile error in keil but success in yotta because of C++11 #75

Open
sunsmilearm opened this issue Feb 17, 2016 · 6 comments
Open

compile error in keil but success in yotta because of C++11 #75

sunsmilearm opened this issue Feb 17, 2016 · 6 comments
Labels

Comments

@sunsmilearm
Copy link

I tried the mbed client example and exported it into keil. This project can be compiled in yotta but failed in Keil. The error is about the new C++11 feature "=delete" in the code committed in "core-util". Like "PoolAllocator(const PoolAllocator&) = delete;"
Error message is
C:\mbed-client-examples-master-new\mdk\mbed-client-examples-master-new\Project_files\yotta_modules\core-util\core-util\PoolAllocator.h(51): error: #65: expected a ";"

I tried to add "--cpp11" in "options -> c/c++ -> Misc controls" but it still can't work.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 17, 2016

@sunsmilearm

How did you export to keil , manually? Are you using software packs? What are you CXX flags?
Can you share the console (get a log ?)? Is there --cpp flag anywhere? You can try to use command line to compile the file with the flags you have and find out why c++11 is not enabled.

We had this problem ,fixed in target-mbed-armcc : https://github.com/ARMmbed/target-mbed-armcc/commit/b4614ab3e4e4521cdcc126cab3c67febe8c66356

@sunsmilearm
Copy link
Author

@0xc0170
Here is the "Compiler control string" in the option of keil project. I added "--cpp11"

-c --cpu Cortex-M4.fp -g -O2 -Otime --apcs=interwork --split_sections -Ibuild\frdm-k64f-armcc\generated\include -I.\ -I.\yotta_modules\mbed-client -I.\yotta_modules\mbed-client-c -I.\yotta_modules\mbed-client-mbed-os -I.\yotta_modules\mbed-client-mbedtls -I.\yotta_modules\nanostack-libservice -I.\yotta_modules\mbed-drivers -I.\yotta_modules\sockets -I.\yotta_modules\mbed-hal -I.\yotta_modules\cmsis-core -I.\yotta_modules\ualloc -I.\yotta_modules\minar -I.\yotta_modules\core-util -I.\yotta_modules\compiler-polyfill -I.\yotta_modules\mbed-hal-freescale -I.\yotta_modules\mbed-hal-ksdk-mcu -I.\yotta_modules\uvisor-lib -I.\yotta_modules\mbed-hal-k64f -I.\yotta_modules\cmsis-core-freescale -I.\yotta_modules\cmsis-core-k64f -I.\yotta_modules\mbed-hal-frdm-k64f -I.\yotta_modules\dlmalloc -I.\yotta_modules\minar-platform -I.\yotta_modules\minar-platform-mbed -I.\yotta_modules\sal -I.\yotta_modules\sal-stack-lwip -I.\yotta_modules\sal-driver-lwip-k64f-eth -I.\yotta_modules\sal-iface-eth -I.\yotta_modules\mbedtls -I.\yotta_modules\cmsis-core\cmsis-core -I.\yotta_modules\mbed-drivers\mbed -I.\yotta_modules\cmsis-core-k64f\cmsis-core-k64f -I.\yotta_modules\mbed-hal\mbed-hal -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\common\phyksz8081 -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\drivers\clock -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\drivers\enet -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\drivers\interrupt -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\drivers\pit -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\drivers\pit\common -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\adc -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\can -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\dac -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\dmamux -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\dspi -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\edma -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\enet -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\flextimer -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\gpio -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\i2c -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\llwu -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\lptmr -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\lpuart -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\mcg -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\mpu -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\osc -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\pdb -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\pit -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\pmc -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\port -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\rcm -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\rtc -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\sai -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\sdhc -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\sim -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\smc -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\uart -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\hal\wdog -I.\yotta_modules\mbed-hal-ksdk-mcu\mbed-hal-ksdk-mcu\TARGET_KSDK_CODE\utilities -I.\yotta_modules\mbed-hal-k64f\mbed-hal-k64f -I.\yotta_modules\mbed-hal-k64f\mbed-hal-k64f\device -I.\yotta_modules\mbed-hal-k64f\mbed-hal-k64f\MK64F12 -I.\yotta_modules\mbed-hal-frdm-k64f\mbed-hal-frdm-k64f -I.\yotta_modules\core-util\source --cpp11
-I C:\my\dev\mbed-client-examples-master-new\mdk\mbed-client-examples-master-new\Project_files\RTE
-I C:\Keil_v5\ARM\PACK\Keil\Kinetis_SDK_DFP\2.1.0
-I C:\Keil_v5\ARM\CMSIS\Include
-D__UVISION_VERSION="514" -DCPU_MK64FN1M0VLL12 -DCPU_MK64FN1M0VMD12 -DTARGET_K64F -DYOTTA_MODULE_NAME="core-util" -D__thumb2__ -DNDEBUG -DTOOLCHAIN_ARM -DTOOLCHAIN_ARM_STD -DMBED_OPERATORS --C99 -o ".\Output\core-util*.o" --depend ".\Output\core-util*.d"

@sunsmilearm
Copy link
Author

This is the doc about how to generate keil project.

http://www.keil.com/appnotes/files/an282.pdf

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 17, 2016

You think you can share the project , someone can test that ? I assume even simple blinky fails? I would use that control string for ARMCC and compile the core util header file which is causing this problem.

The string looks good to me. what version of keil do you have? Is yotta using the same ARMCC than your keil ?

You might get better support in their forums to this problem.

@ciarmcom
Copy link
Member

ARM Internal Ref: IOTSFW-2063

@fdu123
Copy link

fdu123 commented Mar 9, 2016

I think the problem is how to add --cpp11 to all sub projetcs in batch build. Because adding "--cpp11" in "options -> c/c++ -> Misc controls" applied only on the default project not to all projects in batch build.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants