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
(Because without specifying the std I was getting the "identifier iota() not found" error)
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 do I specify the C++ standard I want nvcc to use?
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.
I think you need to add #include <numeric>.
enter image description here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With