Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.
This repository was archived by the owner on Mar 13, 2024. It is now read-only.

ppu-g++ compile std::thread #2

Description

@humbertodias

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
EOF

output

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'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions