Grrr!
Eclipse findet den Pfad zu #include<string> nicht findet.
Gleicher Fall wie hier:
http://stackoverflow.com/questions/7905025/string-could-not-resolved-error-in-eclipse-for-c
So ist das halt mit der freien Software, die stets ohne
Qualitätssicherung rausgehauen wird. Yoo, Hauptsache über den grünen
Klee gelobt.
Jetzt hab ich aber noch ein zweites, viel merkwürdigeres Problem:
Angefangen habe ich dieses C++ Projekt mit einem Hallo-Welt Led-Blinker.
Schon vor dem kompilieren kam der Fehler:
1 | blinkLed.turnOn();
|
2 | timer.sleep(BLINK_ON_TICKS);
|
3 |
|
4 | blinkLed.turnOff();
|
5 | timer.sleep(BLINK_OFF_TICKS);
|
Invalid arguments '
Candidates are:
void sleep()
' main.cpp /test_c++/src line 82 Semantic Error
Wegbekommen habe ich ihn indem ich eine .h Datei in .hpp geändert habe.
Zufall? Jetzt sehe ich den Fehler wieder.
Das hier steht in Timer.hpp:
1 | #ifndef TIMER_H_
|
2 | #define TIMER_H_
|
3 |
|
4 | #include "cmsis_device.h"
|
5 |
|
6 | // ----------------------------------------------------------------------------
|
7 |
|
8 | class Timer
|
9 | {
|
10 | public:
|
11 | typedef uint32_t ticks_t;
|
12 | static constexpr ticks_t FREQUENCY_HZ = 1000u;
|
13 |
|
14 | private:
|
15 | static volatile ticks_t ms_delayCount;
|
16 |
|
17 | public:
|
18 | // Default constructor
|
19 | Timer() = default;
|
20 |
|
21 | inline void
|
22 | start(void)
|
23 | {
|
24 | // Use SysTick as reference for the delay loops.
|
25 | SysTick_Config(SystemCoreClock / FREQUENCY_HZ);
|
26 | }
|
27 |
|
28 | static void sleep(ticks_t ticks);
|
29 |
|
30 | inline static void
|
31 | tick(void)
|
32 | {
|
33 | // Decrement to zero the counter used by the delay routine.
|
34 | if (ms_delayCount != 0u)
|
35 | {
|
36 | --ms_delayCount;
|
37 | }
|
38 | }
|
39 | };
|
40 |
|
41 | // ----------------------------------------------------------------------------
|
42 |
|
43 | #endif // TIMER_H_
|
Und die Schalter:
-DDEBUG -DUSE_FULL_ASSERT -DSTM32F407xx -DUSE_HAL_DRIVER
-DHSE_VALUE=8000000 -I"../include" -I"../system/include"
-I"../system/include/cmsis" -I"../system/include/stm32f4-hal"
-std=gnu++11 -fabi-version=0 -fno-exceptions -fno-rtti
-fno-use-cxa-atexit -fno-threadsafe-statics
Hab eben -x ausprobiert, kein Erfolg.
Jemand ne Idee?