Import not recognized
Posted: Tue Apr 16, 2019 10:34 am
Hey my code is to generate a simple Thread which print something.
But here is a problem the Thread needs an Import but the Import dont get found:
SRC:
COMPILER:
But here is a problem the Thread needs an Import but the Import dont get found:
SRC:
Code: Select all
#include <iostream>
#include <thread>
using namespace std;
int main(){
cout << endl;
thread t3([]{cout << "Imma Thread" << endl;});
t3.join();
cout << endl;
}
Code: Select all
main.cpp
aarch64-none-elf-g++ -MMD -MP -MF /home/Anwender/Desktop/FuseeGelee/Threads/build/main.d -g -Wall -O2 -ffunction-sections -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -I/home/Anwender/Desktop/FuseeGelee/Threads/include -I/opt/devkitpro/portlibs/switch/include -I/opt/devkitpro/libnx/include -I/home/Anwender/Desktop/FuseeGelee/Threads/build -D__SWITCH__ -fno-rtti -fno-exceptions -c /home/Anwender/Desktop/FuseeGelee/Threads/source/main.cpp -o main.o
C:/Users/Anwender/Desktop/FuseeGelee/Threads/source/main.cpp: In function 'int main()':
C:/Users/Anwender/Desktop/FuseeGelee/Threads/source/main.cpp:12:3: error: 'thread' was not declared in this scope
thread t3([]{cout << "Hello C++11 from lambda function." << endl;});
^~~~~~
C:/Users/Anwender/Desktop/FuseeGelee/Threads/source/main.cpp:12:3: note: 'std::thread' is defined in header '<thread>'; did you forget to '#include <thread>'?
C:/Users/Anwender/Desktop/FuseeGelee/Threads/source/main.cpp:3:1:
+#include <thread>
C:/Users/Anwender/Desktop/FuseeGelee/Threads/source/main.cpp:12:3:
thread t3([]{cout << "Hello C++11 from lambda function." << endl;});
^~~~~~
C:/Users/Anwender/Desktop/FuseeGelee/Threads/source/main.cpp:12:69: error: expected primary-expression before ')' token
thread t3([]{cout << "Hello C++11 from lambda function." << endl;});
^
C:/Users/Anwender/Desktop/FuseeGelee/Threads/source/main.cpp:14:3: error: 't3' was not declared in this scope
t3.join();
^~
C:/Users/Anwender/Desktop/FuseeGelee/Threads/source/main.cpp:14:3: note: suggested alternative: 'tm'
t3.join();
^~
tm
make[1]: *** [/opt/devkitpro/devkitA64/base_rules:14: main.o] Error 1
make: *** [Makefile:165: build] Error 2