title: Intel icc: compile c++ code cause error
body: <p>When I use icc compiler to compile a simple c++ code in Fedora 26 linux system, it caused an error like belows:</p>
  
  <p>icc command:</p>
  
  <pre><code>icpc test.cpp
  </code></pre>
  
  <p>test.cpp content:</p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  int main() {
   cout&lt;&lt;"hello world" &lt;&lt; endl;
   return 0;
  }
  </code></pre>
  
  <p>it caused an error like:</p>
  
  <pre><code>/usr/include/c++/7/bits/move.h(48): error: identifier "__builtin_addressof" is undefined
        { return __builtin_addressof(__r); }
                 ^
            detected during:
              instantiation of "_Tp *std::__addressof(_Tp &amp;) [with _Tp=std::__make_not_void&lt;char&gt;={char}]" at line 138
              instantiation of "_Tp *std::addressof(_Tp &amp;) [with _Tp=std::__make_not_void&lt;char&gt;={char}]" at line 142 of "/usr/include/c++/7/bits/ptr_traits.h"
              instantiation of "std::pointer_traits&lt;_Tp *&gt;::pointer std::pointer_traits&lt;_Tp *&gt;::pointer_to(std::__make_not_void&lt;std::pointer_traits&lt;_Tp *&gt;::element_type&gt; &amp;) [with _Tp=char]" at line 166 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::pointer std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_local_data() [with _CharT=char, _Traits=std::char_traits&lt;char&gt;, _Alloc=std::allocator&lt;char&gt;]" at line 485 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::basic_string(const _CharT *, std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::size_type, const _Alloc &amp;) [with _CharT=char, _Traits=std::char_traits&lt;char&gt;, _Alloc=std::allocator&lt;char&gt;]" at line 6473 of "/usr/include/c++/7/bits/basic_string.h"
  
  /usr/include/c++/7/bits/move.h(48): error: identifier "__builtin_addressof" is undefined
        { return __builtin_addressof(__r); }
                 ^
            detected during:
              instantiation of "_Tp *std::__addressof(_Tp &amp;) [with _Tp=std::__make_not_void&lt;const char&gt;={const char}]" at line 138
              instantiation of "_Tp *std::addressof(_Tp &amp;) [with _Tp=std::__make_not_void&lt;const char&gt;={const char}]" at line 142 of "/usr/include/c++/7/bits/ptr_traits.h"
              instantiation of "std::pointer_traits&lt;_Tp *&gt;::pointer std::pointer_traits&lt;_Tp *&gt;::pointer_to(std::__make_not_void&lt;std::pointer_traits&lt;_Tp *&gt;::element_type&gt; &amp;) [with _Tp=const char]" at line 176 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::const_pointer std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_local_data() const [with _CharT=char, _Traits=std::char_traits&lt;char&gt;, _Alloc=std::allocator&lt;char&gt;]" at line 195 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "bool std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_is_local() const [with _CharT=char, _Traits=std::char_traits&lt;char&gt;, _Alloc=std::allocator&lt;char&gt;]" at line 204 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "void std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_dispose() [with _CharT=char, _Traits=std::char_traits&lt;char&gt;, _Alloc=std::allocator&lt;char&gt;]" at line 228 of "/usr/include/c++/7/bits/basic_string.tcc"
              instantiation of "void std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_construct(_FwdIterator, _FwdIterator, std::forward_iterator_tag) [with _CharT=char, _Traits=std::char_traits&lt;char&gt;, _Alloc=std::allocator&lt;char&gt;, _FwdIterator=const char *]" at line 220 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "void std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_construct_aux(_InIterator, _InIterator, std::__false_type) [with _CharT=char, _Traits=std::char_traits&lt;char&gt;, _Alloc=std::allocator&lt;char&gt;, _InIterator=const char *]" at line 239 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "void std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_construct(_InIterator, _InIterator) [with _CharT=char, _Traits=std::char_traits&lt;char&gt;, _Alloc=std::allocator&lt;char&gt;, _InIterator=const char *]" at line 486 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::basic_string(const _CharT *, std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::size_type, const _Alloc &amp;) [with _CharT=char, _Traits=std::char_traits&lt;char&gt;, _Alloc=std::allocator&lt;char&gt;]" at line 6473 of "/usr/include/c++/7/bits/basic_string.h"
  
  /usr/include/c++/7/bits/move.h(48): error: identifier "__builtin_addressof" is undefined
        { return __builtin_addressof(__r); }
                 ^
            detected during:
              instantiation of "_Tp *std::__addressof(_Tp &amp;) [with _Tp=std::__make_not_void&lt;wchar_t&gt;={wchar_t}]" at line 138
              instantiation of "_Tp *std::addressof(_Tp &amp;) [with _Tp=std::__make_not_void&lt;wchar_t&gt;={wchar_t}]" at line 142 of "/usr/include/c++/7/bits/ptr_traits.h"
              instantiation of "std::pointer_traits&lt;_Tp *&gt;::pointer std::pointer_traits&lt;_Tp *&gt;::pointer_to(std::__make_not_void&lt;std::pointer_traits&lt;_Tp *&gt;::element_type&gt; &amp;) [with _Tp=wchar_t]" at line 166 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::pointer std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_local_data() [with _CharT=wchar_t, _Traits=std::char_traits&lt;wchar_t&gt;, _Alloc=std::allocator&lt;wchar_t&gt;]" at line 485 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::basic_string(const _CharT *, std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::size_type, const _Alloc &amp;) [with _CharT=wchar_t, _Traits=std::char_traits&lt;wchar_t&gt;, _Alloc=std::allocator&lt;wchar_t&gt;]" at line 6479 of "/usr/include/c++/7/bits/basic_string.h"
  
  /usr/include/c++/7/bits/move.h(48): error: identifier "__builtin_addressof" is undefined
        { return __builtin_addressof(__r); }
                 ^
            detected during:
              instantiation of "_Tp *std::__addressof(_Tp &amp;) [with _Tp=std::__make_not_void&lt;const wchar_t&gt;={const wchar_t}]" at line 138
              instantiation of "_Tp *std::addressof(_Tp &amp;) [with _Tp=std::__make_not_void&lt;const wchar_t&gt;={const wchar_t}]" at line 142 of "/usr/include/c++/7/bits/ptr_traits.h"
              instantiation of "std::pointer_traits&lt;_Tp *&gt;::pointer std::pointer_traits&lt;_Tp *&gt;::pointer_to(std::__make_not_void&lt;std::pointer_traits&lt;_Tp *&gt;::element_type&gt; &amp;) [with _Tp=const wchar_t]" at line 176 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::const_pointer std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_local_data() const [with _CharT=wchar_t, _Traits=std::char_traits&lt;wchar_t&gt;, _Alloc=std::allocator&lt;wchar_t&gt;]" at line 195 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "bool std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_is_local() const [with _CharT=wchar_t, _Traits=std::char_traits&lt;wchar_t&gt;, _Alloc=std::allocator&lt;wchar_t&gt;]" at line 204 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "void std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_dispose() [with _CharT=wchar_t, _Traits=std::char_traits&lt;wchar_t&gt;, _Alloc=std::allocator&lt;wchar_t&gt;]" at line 228 of "/usr/include/c++/7/bits/basic_string.tcc"
              instantiation of "void std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_construct(_FwdIterator, _FwdIterator, std::forward_iterator_tag) [with _CharT=wchar_t, _Traits=std::char_traits&lt;wchar_t&gt;, _Alloc=std::allocator&lt;wchar_t&gt;, _FwdIterator=const wchar_t *]" at line 220 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "void std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_construct_aux(_InIterator, _InIterator, std::__false_type) [with _CharT=wchar_t, _Traits=std::char_traits&lt;wchar_t&gt;, _Alloc=std::allocator&lt;wchar_t&gt;, _InIterator=const wchar_t *]" at line 239 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "void std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_construct(_InIterator, _InIterator) [with _CharT=wchar_t, _Traits=std::char_traits&lt;wchar_t&gt;, _Alloc=std::allocator&lt;wchar_t&gt;, _InIterator=const wchar_t *]" at line 486 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::basic_string(const _CharT *, std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::size_type, const _Alloc &amp;) [with _CharT=wchar_t, _Traits=std::char_traits&lt;wchar_t&gt;, _Alloc=std::allocator&lt;wchar_t&gt;]" at line 6479 of "/usr/include/c++/7/bits/basic_string.h"
  
  /usr/include/c++/7/bits/move.h(48): error: identifier "__builtin_addressof" is undefined
        { return __builtin_addressof(__r); }
                 ^
            detected during:
              instantiation of "_Tp *std::__addressof(_Tp &amp;) [with _Tp=std::__make_not_void&lt;char16_t&gt;={char16_t}]" at line 138
              instantiation of "_Tp *std::addressof(_Tp &amp;) [with _Tp=std::__make_not_void&lt;char16_t&gt;={char16_t}]" at line 142 of "/usr/include/c++/7/bits/ptr_traits.h"
              instantiation of "std::pointer_traits&lt;_Tp *&gt;::pointer std::pointer_traits&lt;_Tp *&gt;::pointer_to(std::__make_not_void&lt;std::pointer_traits&lt;_Tp *&gt;::element_type&gt; &amp;) [with _Tp=char16_t]" at line 166 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::pointer std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_local_data() [with _CharT=char16_t, _Traits=std::char_traits&lt;char16_t&gt;, _Alloc=std::allocator&lt;char16_t&gt;]" at line 485 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::basic_string(const _CharT *, std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::size_type, const _Alloc &amp;) [with _CharT=char16_t, _Traits=std::char_traits&lt;char16_t&gt;, _Alloc=std::allocator&lt;char16_t&gt;]" at line 6486 of "/usr/include/c++/7/bits/basic_string.h"
  
  /usr/include/c++/7/bits/move.h(48): error: identifier "__builtin_addressof" is undefined
        { return __builtin_addressof(__r); }
                 ^
            detected during:
              instantiation of "_Tp *std::__addressof(_Tp &amp;) [with _Tp=std::__make_not_void&lt;const char16_t&gt;={const char16_t}]" at line 138
              instantiation of "_Tp *std::addressof(_Tp &amp;) [with _Tp=std::__make_not_void&lt;const char16_t&gt;={const char16_t}]" at line 142 of "/usr/include/c++/7/bits/ptr_traits.h"
              instantiation of "std::pointer_traits&lt;_Tp *&gt;::pointer std::pointer_traits&lt;_Tp *&gt;::pointer_to(std::__make_not_void&lt;std::pointer_traits&lt;_Tp *&gt;::element_type&gt; &amp;) [with _Tp=const char16_t]" at line 176 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::const_pointer std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_local_data() const [with _CharT=char16_t, _Traits=std::char_traits&lt;char16_t&gt;, _Alloc=std::allocator&lt;char16_t&gt;]" at line 195 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "bool std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_is_local() const [with _CharT=char16_t, _Traits=std::char_traits&lt;char16_t&gt;, _Alloc=std::allocator&lt;char16_t&gt;]" at line 204 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "void std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_dispose() [with _CharT=char16_t, _Traits=std::char_traits&lt;char16_t&gt;, _Alloc=std::allocator&lt;char16_t&gt;]" at line 228 of "/usr/include/c++/7/bits/basic_string.tcc"
              instantiation of "void std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_construct(_FwdIterator, _FwdIterator, std::forward_iterator_tag) [with _CharT=char16_t, _Traits=std::char_traits&lt;char16_t&gt;, _Alloc=std::allocator&lt;char16_t&gt;, _FwdIterator=const char16_t *]" at line 220 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "void std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_construct_aux(_InIterator, _InIterator, std::__false_type) [with _CharT=char16_t, _Traits=std::char_traits&lt;char16_t&gt;, _Alloc=std::allocator&lt;char16_t&gt;, _InIterator=const char16_t *]" at line 239 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "void std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_construct(_InIterator, _InIterator) [with _CharT=char16_t, _Traits=std::char_traits&lt;char16_t&gt;, _Alloc=std::allocator&lt;char16_t&gt;, _InIterator=const char16_t *]" at line 486 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::basic_string(const _CharT *, std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::size_type, const _Alloc &amp;) [with _CharT=char16_t, _Traits=std::char_traits&lt;char16_t&gt;, _Alloc=std::allocator&lt;char16_t&gt;]" at line 6486 of "/usr/include/c++/7/bits/basic_string.h"
  
  /usr/include/c++/7/bits/move.h(48): error: identifier "__builtin_addressof" is undefined
        { return __builtin_addressof(__r); }
                 ^
            detected during:
              instantiation of "_Tp *std::__addressof(_Tp &amp;) [with _Tp=std::__make_not_void&lt;char32_t&gt;={char32_t}]" at line 138
              instantiation of "_Tp *std::addressof(_Tp &amp;) [with _Tp=std::__make_not_void&lt;char32_t&gt;={char32_t}]" at line 142 of "/usr/include/c++/7/bits/ptr_traits.h"
              instantiation of "std::pointer_traits&lt;_Tp *&gt;::pointer std::pointer_traits&lt;_Tp *&gt;::pointer_to(std::__make_not_void&lt;std::pointer_traits&lt;_Tp *&gt;::element_type&gt; &amp;) [with _Tp=char32_t]" at line 166 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::pointer std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_local_data() [with _CharT=char32_t, _Traits=std::char_traits&lt;char32_t&gt;, _Alloc=std::allocator&lt;char32_t&gt;]" at line 485 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::basic_string(const _CharT *, std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::size_type, const _Alloc &amp;) [with _CharT=char32_t, _Traits=std::char_traits&lt;char32_t&gt;, _Alloc=std::allocator&lt;char32_t&gt;]" at line 6491 of "/usr/include/c++/7/bits/basic_string.h"
  
  /usr/include/c++/7/bits/move.h(48): error: identifier "__builtin_addressof" is undefined
        { return __builtin_addressof(__r); }
                 ^
            detected during:
              instantiation of "_Tp *std::__addressof(_Tp &amp;) [with _Tp=std::__make_not_void&lt;const char32_t&gt;={const char32_t}]" at line 138
              instantiation of "_Tp *std::addressof(_Tp &amp;) [with _Tp=std::__make_not_void&lt;const char32_t&gt;={const char32_t}]" at line 142 of "/usr/include/c++/7/bits/ptr_traits.h"
              instantiation of "std::pointer_traits&lt;_Tp *&gt;::pointer std::pointer_traits&lt;_Tp *&gt;::pointer_to(std::__make_not_void&lt;std::pointer_traits&lt;_Tp *&gt;::element_type&gt; &amp;) [with _Tp=const char32_t]" at line 176 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::const_pointer std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_local_data() const [with _CharT=char32_t, _Traits=std::char_traits&lt;char32_t&gt;, _Alloc=std::allocator&lt;char32_t&gt;]" at line 195 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "bool std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_is_local() const [with _CharT=char32_t, _Traits=std::char_traits&lt;char32_t&gt;, _Alloc=std::allocator&lt;char32_t&gt;]" at line 204 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "void std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_dispose() [with _CharT=char32_t, _Traits=std::char_traits&lt;char32_t&gt;, _Alloc=std::allocator&lt;char32_t&gt;]" at line 228 of "/usr/include/c++/7/bits/basic_string.tcc"
              instantiation of "void std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_construct(_FwdIterator, _FwdIterator, std::forward_iterator_tag) [with _CharT=char32_t, _Traits=std::char_traits&lt;char32_t&gt;, _Alloc=std::allocator&lt;char32_t&gt;, _FwdIterator=const char32_t *]" at line 220 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "void std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_construct_aux(_InIterator, _InIterator, std::__false_type) [with _CharT=char32_t, _Traits=std::char_traits&lt;char32_t&gt;, _Alloc=std::allocator&lt;char32_t&gt;, _InIterator=const char32_t *]" at line 239 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "void std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::_M_construct(_InIterator, _InIterator) [with _CharT=char32_t, _Traits=std::char_traits&lt;char32_t&gt;, _Alloc=std::allocator&lt;char32_t&gt;, _InIterator=const char32_t *]" at line 486 of "/usr/include/c++/7/bits/basic_string.h"
              instantiation of "std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::basic_string(const _CharT *, std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;::size_type, const _Alloc &amp;) [with _CharT=char32_t, _Traits=std::char_traits&lt;char32_t&gt;, _Alloc=std::allocator&lt;char32_t&gt;]" at line 6491 of "/usr/include/c++/7/bits/basic_string.h"
  
  compilation aborted for test.cpp (code 2)
  </code></pre>
  
  <p>my icc version is icc version 17.0.0 (gcc version 7.0.0 compatibility),</p>
  
  <p>gcc version is gcc version 7.1.1 20170622 (Red Hat 7.1.1-3) (GCC),</p>
  
  <p>for this error, I feel confused with it. Please help me. Thanks!</p>