platformio / platform-ststm8

ST STM8: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/ststm8
Apache License 2.0
40 stars 26 forks source link

MAC platform = ststm8 build error: 'long float' is invalid #15

Closed hzhh110 closed 3 years ago

hzhh110 commented 4 years ago

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:168:1: error: 'long float' is invalid

hzhh110 commented 4 years ago

In file included from src/main.cpp:1: In file included from /Users/huangzhenhui/.platformio/packages/framework-arduinoststm8/cores/sduino/Arduino.h:23: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdlib.h:94: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:168:1: error: 'long float' is invalid long double ^ In file included from src/main.cpp:1: In file included from /Users/huangzhenhui/.platformio/packages/framework-arduinoststm8/cores/sduino/Arduino.h:26: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/math.h:301: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:133:26: error: 'long float' is invalid extern int __fpclassifyl(long double); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:176:47: error: 'long float' is invalid

postpersonality commented 4 years ago

https://community.platformio.org/t/begginer-in-platform-io-need-help-with-programming-stm8/9078/4

The solution is to use main.c instead of main.cpp

valeros commented 3 years ago

Sduino doesn't support C++ sources. Please use .c extension for source files.