This repository was archived by the owner on Mar 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
ppu-g++ compile std::thread #2
Copy link
Copy link
Closed
Description
Trying to compile std::thread
docker run -i --rm mlafeldt/ps3dev bash -s <<EOF
echo "#include <iostream>
#include <thread>
// Function to be executed by the thread
void threadFunction(int threadID) {
std::cout << "Thread " << threadID << " is executing" << std::endl;
}
int main() {
// Creating a thread and passing a function to execute
std::thread t1(threadFunction, 1);
// Joining the thread to the main thread
t1.join();
// Output a message from the main thread
std::cout << "Main thread is executing" << std::endl;
return 0;
}" > oo.cpp
ppu-g++ oo.cpp -o oo -std=c++11
EOFoutput
oo.cpp: In function 'void threadFunction(int)':
oo.cpp:6:18: error: 'Thread' was not declared in this scope
oo.cpp:6:42: error: 'is' was not declared in this scope
oo.cpp:6:45: error: expected ';' before 'executing'
oo.cpp: In function 'int main()':
oo.cpp:11:5: error: 'thread' is not a member of 'std'
oo.cpp:11:17: error: expected ';' before 't1'
oo.cpp:14:5: error: 't1' was not declared in this scope
oo.cpp:17:18: error: 'Main' was not declared in this scope
oo.cpp:17:23: error: expected ';' before 'thread'
Metadata
Metadata
Assignees
Labels
No labels