1. 程式人生 > >海思3536SDK出現“pure virtual method called”的解決方法

海思3536SDK出現“pure virtual method called”的解決方法

程式碼如下:

#include <string>
#include <iostream>
#include <thread>
using namespace std;

void test(){
        cout << "thread .........." << endl;
}

int main(){
        std::thread t=std::thread(&test);
        t.join();
        cout << "**********" << endl;
        return 1;
}

有問題的編譯及輸出:

arm-hisiv400-linux-gnueabi-g++ ex1.cpp -o ex1  -std=c++11 -pthread

./ex1
pure virtual method called
terminate called without an active exception
Aborted

正確的編譯及輸出

arm-hisiv400-linux-gnueabi-g++ ex1.cpp -o ex1  -std=c++11 -pthread -mcpu=cortex-a7

~/gb # ./ex1
thread ..........
**********