lundi 2 juillet 2018

C++11/C++14/C++17 not supported by nvcc?

I tried to compile this code:-

#include <vector>

using namespace std;

int main() {
    vector<int> v(5);
    iota(v.begin(), v.end(), 0);
}

And I compiled it with this command:-

D:\workspace\test>nvcc main.cpp --std=c++11

And I get this error:-

nvcc warning : The -std=c++11 flag is not supported with the configured host compiler. Flag will be ignored.
main.cpp
main.cpp(7): error C3861: 'iota': identifier not found

How can I use C++11 in my project which uses CUDA programming? (IN WINDOWS)

Also, compiling host code separately with g++ and device code with nvcc and then linking the objects with nvcc doesn't work. I get this.

Aucun commentaire:

Enregistrer un commentaire