- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does the C++ standard library have these C++11 features?
My simple program:
#include <iostream> std::error_code code; int main() { std::cout << "Hello" << std::endl; }
fails to compile with the following error:
error: namespace "std" has no member "error_code"
This is the compile command I'm using:
icpc -std=c++11 -o test test.cpp
- Tags:
- CC++
- Development Tools
- Intel® C++ Compiler
- Intel® Parallel Studio XE
- Intel® System Studio
- Optimization
- Parallel Computing
- Vectorization
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What compiler version are you using? and you have GCC version < 5.1
$ icpc t2.cpp -std=c++11 -V
Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.0.4.243 Build 20190416
$ cat t2.cpp
#include <iostream>
std::error_code code;
int main() {
std::cout << "Hello" << std::endl;
}
$
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I wasn't aware that icpc needed GCC to run. I've loaded a newer GCC version and now the program compiles fine.
Thanks!
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page