clion

http://www.cnblogs.com/bluestorm/archive/2012/09/01/2667141.html

http://www.zhihu.com/question/26201557

下载配置了 TDM-GCChttp://nuwen.net/mingw.html,运行http://www.hankcs.com/program/cpp/jetbrains-clion.html中的示例代码都没问题,但是使用vector的时候,如下代码:

#include <iostream>
#include <bits/stl_bvector.h>
using namespace std;

int main()
{
    std::vector<int> vector1 {2,3,4};
    return 0;
}

就一直报错:

Scanning dependencies of target untitled
[ 50%] Building CXX object CMakeFiles/untitled.dir/main.cpp.obj
In file included from d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_bvector.h:492:0,
from D:\Program Files (x86)\JetBrains\CLion 1.2.1\ClionProjects\untitled\main.cpp:2:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:74:35: error: ‘__alloc_traits‘ in namespace ‘__gnu_cxx‘ does not name a type
typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:74:49: error: expected unqualified-id before ‘<‘ token
typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:76:35: error: ‘__alloc_traits‘ in namespace ‘__gnu_cxx‘ does not name a type
typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>::pointer
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:76:49: error: expected unqualified-id before ‘<‘ token
typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>::pointer
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:81:7: error: expected class-name before ‘{‘ token
{
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:82:2: error: ‘pointer‘ does not name a type
pointer _M_start;
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:83:2: error: ‘pointer‘ does not name a type
pointer _M_finish;
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:84:2: error: ‘pointer‘ does not name a type
pointer _M_end_of_storage;
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:90:30: error: expected ‘)‘ before ‘const‘
_Vector_impl(_Tp_alloc_type const& __a)
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:95:29: error: expected ‘)‘ before ‘&&‘ token
_Vector_impl(_Tp_alloc_type&& __a)
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:112:7: error: ‘_Tp_alloc_type‘ does not name a type
_Tp_alloc_type&
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:116:13: error: ‘_Tp_alloc_type‘ does not name a type
const _Tp_alloc_type&
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:139:34: error: expected ‘)‘ before ‘&&‘ token
_Vector_base(_Tp_alloc_type&& __a)
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:166:7: error: ‘pointer‘ does not name a type
pointer
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:171:21: error: ‘pointer‘ has not been declared
_M_deallocate(pointer __p, size_t __n)
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In constructor ‘std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_Vector_impl()‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:87:4: error: class ‘std::_Vector_base<_Tp, _Alloc>::_Vector_impl‘ does not have any field named ‘_Tp_alloc_type‘
: _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:87:22: error: class ‘std::_Vector_base<_Tp, _Alloc>::_Vector_impl‘ does not have any field named ‘_M_start‘
: _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:87:35: error: class ‘std::_Vector_base<_Tp, _Alloc>::_Vector_impl‘ does not have any field named ‘_M_finish‘
: _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:87:49: error: class ‘std::_Vector_base<_Tp, _Alloc>::_Vector_impl‘ does not have any field named ‘_M_end_of_storage‘
: _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In member function ‘void std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_M_swap_data(std::_Vector_base<_Tp, _Alloc>::_Vector_impl&)‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:103:14: error: ‘_M_start‘ was not declared in this scope
std::swap(_M_start, __x._M_start);
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:104:14: error: ‘_M_finish‘ was not declared in this scope
std::swap(_M_finish, __x._M_finish);
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:105:14: error: ‘_M_end_of_storage‘ was not declared in this scope
std::swap(_M_end_of_storage, __x._M_end_of_storage);
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In member function ‘std::_Vector_base<_Tp, _Alloc>::allocator_type std::_Vector_base<_Tp, _Alloc>::get_allocator() const‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:122:51: error: there are no arguments to ‘_M_get_Tp_allocator‘ that depend on a template parameter, so a declaration of ‘_M_get_Tp_allocator‘ must be available [-fpermissive]
{ return allocator_type(_M_get_Tp_allocator()); }
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:122:51: note: (if you use ‘-fpermissive‘, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: At global scope:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:219:15: error: ‘__alloc_traits‘ in namespace ‘__gnu_cxx‘ does not name a type
typedef __gnu_cxx::__alloc_traits<_Tp_alloc_type> _Alloc_traits;
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:224:24: error: ‘_Alloc_traits‘ has not been declared
typedef typename _Alloc_traits::const_pointer const_pointer;
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:225:24: error: ‘_Alloc_traits‘ has not been declared
typedef typename _Alloc_traits::reference reference;
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:226:24: error: ‘_Alloc_traits‘ has not been declared
typedef typename _Alloc_traits::const_reference const_reference;
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:439:40: error: ‘_Alloc_traits‘ has not been declared
operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:1110:13: error: ‘_Alloc_traits‘ has not been declared
noexcept(_Alloc_traits::_S_nothrow_swap())
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In copy constructor ‘std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&)‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:312:9: error: ‘_Alloc_traits‘ has not been declared
_Alloc_traits::_S_select_on_copy(__x._M_get_Tp_allocator()))
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:314:4: error: ‘__uninitialized_copy_a‘ is not a member of ‘std‘
std::__uninitialized_copy_a(__x.begin(), __x.end(),
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In constructor ‘std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, const allocator_type&)‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:334:4: error: ‘__uninitialized_copy_a‘ is not a member of ‘std‘
std::__uninitialized_copy_a(__x.begin(), __x.end(),
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In constructor ‘std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&)‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:346:8: error: ‘__uninitialized_move_a‘ is not a member of ‘std‘
std::__uninitialized_move_a(__rv.begin(), __rv.end(),
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In destructor ‘std::vector<_Tp, _Alloc>::~vector()‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:415:9: error: ‘_Destroy‘ is not a member of ‘std‘
{ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In member function ‘std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&)‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:442:11: error: ‘_Alloc_traits‘ has not been declared
_Alloc_traits::_S_propagate_on_move_assign()
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:443:14: error: ‘_Alloc_traits‘ has not been declared
|| _Alloc_traits::_S_always_equal();
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:445:48: error: the value of ‘__move_storage‘ is not usable in a constant expression
integral_constant<bool, __move_storage>());
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:445:62: error: the value of ‘__move_storage‘ is not usable in a constant expression
integral_constant<bool, __move_storage>());
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In member function ‘std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::max_size() const‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:651:16: error: ‘_Alloc_traits‘ has not been declared
{ return _Alloc_traits::max_size(_M_get_Tp_allocator()); }
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In member function ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&)‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:905:6: error: ‘_Alloc_traits‘ has not been declared
_Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In member function ‘void std::vector<_Tp, _Alloc>::pop_back()‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:940:2: error: ‘_Alloc_traits‘ has not been declared
_Alloc_traits::destroy(this->_M_impl, this->_M_impl._M_finish);
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In member function ‘void std::vector<_Tp, _Alloc>::swap(std::vector<_Tp, _Alloc>&)‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:1114:2: error: ‘_Alloc_traits‘ has not been declared
_Alloc_traits::_S_on_swap(_M_get_Tp_allocator(),
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In member function ‘std::vector<_Tp, _Alloc>::pointer std::vector<_Tp, _Alloc>::_M_allocate_and_copy(std::vector<_Tp, _Alloc>::size_type, _ForwardIterator, _ForwardIterator)‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:1141:8: error: ‘__uninitialized_copy_a‘ is not a member of ‘std‘
std::__uninitialized_copy_a(__first, __last, __result,
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In member function ‘void std::vector<_Tp, _Alloc>::_M_range_initialize(_ForwardIterator, _ForwardIterator, std::forward_iterator_tag)‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:1204:6: error: ‘__uninitialized_copy_a‘ is not a member of ‘std‘
std::__uninitialized_copy_a(__first, __last,
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In member function ‘void std::vector<_Tp, _Alloc>::_M_fill_initialize(std::vector<_Tp, _Alloc>::size_type, const value_type&)‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:1214:2: error: ‘__uninitialized_fill_n_a‘ is not a member of ‘std‘
std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In member function ‘void std::vector<_Tp, _Alloc>::_M_default_initialize(std::vector<_Tp, _Alloc>::size_type)‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:1224:2: error: ‘__uninitialized_default_n_a‘ is not a member of ‘std‘
std::__uninitialized_default_n_a(this->_M_impl._M_start, __n,
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In member function ‘void std::vector<_Tp, _Alloc>::_M_erase_at_end(std::vector<_Tp, _Alloc>::pointer)‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:1352:2: error: ‘_Destroy‘ is not a member of ‘std‘
std::_Destroy(__pos, this->_M_impl._M_finish, _M_get_Tp_allocator());
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In member function ‘void std::vector<_Tp, _Alloc>::_M_move_assign(std::vector<_Tp, _Alloc>&&, std::true_type)‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:1366:6: error: ‘_Alloc_traits‘ has not been declared
if (_Alloc_traits::_S_propagate_on_move_assign())
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:1367:4: error: ‘__alloc_on_move‘ is not a member of ‘std‘
std::__alloc_on_move(_M_get_Tp_allocator(),
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In instantiation of ‘class std::vector<int>‘:
D:\Program Files (x86)\JetBrains\CLion 1.2.1\ClionProjects\untitled\main.cpp:9:22: required from here
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:218:48: error: no type named ‘_Tp_alloc_type‘ in ‘struct std::_Vector_base<int, std::allocator<int> >‘
typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:223:58: error: no type named ‘pointer‘ in ‘struct std::_Vector_base<int, std::allocator<int> >‘
typedef typename _Base::pointer pointer;
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:227:61: error: no type named ‘pointer‘ in ‘struct std::_Vector_base<int, std::allocator<int> >‘
typedef __gnu_cxx::__normal_iterator<pointer, vector> iterator;
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:231:49: error: no type named ‘pointer‘ in ‘struct std::_Vector_base<int, std::allocator<int> >‘
typedef std::reverse_iterator<iterator> reverse_iterator;
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:237:20: error: no members matching ‘std::vector<int>::_Base {aka std::_Vector_base<int, std::allocator<int> >}::_M_allocate‘ in ‘std::vector<int>::_Base {aka struct std::_Vector_base<int, std::allocator<int> >}‘
using _Base::_M_allocate;
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:240:20: error: no members matching ‘std::vector<int>::_Base {aka std::_Vector_base<int, std::allocator<int> >}::_M_get_Tp_allocator‘ in ‘std::vector<int>::_Base {aka struct std::_Vector_base<int, std::allocator<int> >}‘
using _Base::_M_get_Tp_allocator;
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In instantiation of ‘std::_Vector_base<_Tp, _Alloc>::_Vector_base(const allocator_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::_Vector_base<_Tp, _Alloc>::allocator_type = std::allocator<int>]‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:366:18: required from ‘std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<int>]‘
D:\Program Files (x86)\JetBrains\CLion 1.2.1\ClionProjects\untitled\main.cpp:9:36: required from here
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:128:20: error: no matching function for call to ‘std::_Vector_base<int, std::allocator<int> >::_Vector_impl::_Vector_impl(const allocator_type&)‘
: _M_impl(__a) { }
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:128:20: note: candidates are:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:86:2: note: std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_Vector_impl() [with _Tp = int; _Alloc = std::allocator<int>]
_Vector_impl()
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:86:2: note: candidate expects 0 arguments, 1 provided
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:79:14: note: constexpr std::_Vector_base<int, std::allocator<int> >::_Vector_impl::_Vector_impl(const std::_Vector_base<int, std::allocator<int> >::_Vector_impl&)
struct _Vector_impl
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:79:14: note: no known conversion for argument 1 from ‘const allocator_type {aka const std::allocator<int>}‘ to ‘const std::_Vector_base<int, std::allocator<int> >::_Vector_impl&‘
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:79:14: note: constexpr std::_Vector_base<int, std::allocator<int> >::_Vector_impl::_Vector_impl(std::_Vector_base<int, std::allocator<int> >::_Vector_impl&&)
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:79:14: note: no known conversion for argument 1 from ‘const allocator_type {aka const std::allocator<int>}‘ to ‘std::_Vector_base<int, std::allocator<int> >::_Vector_impl&&‘
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In instantiation of ‘std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = int; _Alloc = std::allocator<int>]‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:366:18: required from ‘std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<int>]‘
D:\Program Files (x86)\JetBrains\CLion 1.2.1\ClionProjects\untitled\main.cpp:9:36: required from here
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:161:33: error: ‘struct std::_Vector_base<int, std::allocator<int> >::_Vector_impl‘ has no member named ‘_M_start‘
- this->_M_impl._M_start); }
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:161:9: error: ‘struct std::_Vector_base<int, std::allocator<int> >::_Vector_impl‘ has no member named ‘_M_start‘
- this->_M_impl._M_start); }
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:161:9: error: ‘struct std::_Vector_base<int, std::allocator<int> >::_Vector_impl‘ has no member named ‘_M_end_of_storage‘
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In instantiation of ‘void std::vector<_Tp, _Alloc>::_M_range_initialize(_ForwardIterator, _ForwardIterator, std::forward_iterator_tag) [with _ForwardIterator = const int*; _Tp = int; _Alloc = std::allocator<int>]‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:369:36: required from ‘std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<int>]‘
D:\Program Files (x86)\JetBrains\CLion 1.2.1\ClionProjects\untitled\main.cpp:9:36: required from here
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:1201:27: error: ‘class std::vector<int>‘ has no member named ‘_M_allocate‘
this->_M_impl._M_start = this->_M_allocate(__n);
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:1201:27: error: ‘struct std::_Vector_base<int, std::allocator<int> >::_Vector_impl‘ has no member named ‘_M_start‘
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:1202:61: error: ‘struct std::_Vector_base<int, std::allocator<int> >::_Vector_impl‘ has no member named ‘_M_start‘
this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:1202:36: error: ‘struct std::_Vector_base<int, std::allocator<int> >::_Vector_impl‘ has no member named ‘_M_end_of_storage‘
this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:1203:28: error: ‘struct std::_Vector_base<int, std::allocator<int> >::_Vector_impl‘ has no member named ‘_M_finish‘
this->_M_impl._M_finish =
^
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h: In instantiation of ‘void std::_Vector_base<_Tp, _Alloc>::_M_deallocate(int, std::size_t) [with _Tp = int; _Alloc = std::allocator<int>; std::size_t = unsigned int]‘:
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:161:33: required from ‘std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = int; _Alloc = std::allocator<int>]‘
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:366:18: required from ‘std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<int>]‘
D:\Program Files (x86)\JetBrains\CLion 1.2.1\ClionProjects\untitled\main.cpp:9:36: required from here
d:\progra~3\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\stl_vector.h:174:4: error: ‘struct std::_Vector_base<int, std::allocator<int> >::_Vector_impl‘ has no member named ‘deallocate‘
_M_impl.deallocate(__p, __n);
^
mingw32-make.exe[3]: *** [CMakeFiles/untitled.dir/main.cpp.obj] Error 1
mingw32-make.exe[2]: *** [CMakeFiles/untitled.dir/all] Error 2
CMakeFiles\untitled.dir\build.make:61: recipe for target ‘CMakeFiles/untitled.dir/main.cpp.obj‘ failed
CMakeFiles\Makefile2:66: recipe for target ‘CMakeFiles/untitled.dir/all‘ failed
CMakeFiles\Makefile2:78: recipe for target ‘CMakeFiles/untitled.dir/rule‘ failed
mingw32-make.exe[1]: *** [CMakeFiles/untitled.dir/rule] Error 2
mingw32-make.exe: *** [untitled] Error 2
Makefile:117: recipe for target ‘untitled‘ failed

安装目录也换过,Clion也重装过,MinGW也换过,反反复复搞了一天没搞好,网上也收不到,真是哔了狗了。。

后记:就在要走的时候,我偶然发现了一篇介绍:MinGW中的头文件路径

http://blog.sina.com.cn/s/blog_4f183d960101fjvi.html

看过之后觉得很好,然而并没有什么卵用,我前面的代码能够运行,那么应该其他的环境都是配置好了的,突然脑子里灵光一闪,不会是写vector的时候,Clion默认添加的头文件

#include <bits/stl_bvector.h>

有问题吧,抱着试一试的心态,服用了两个疗程之后(啊呸),抱着试一试的心态,将头文件改为#include <vector>之后果然行了,CWNM。。。

#include <iostream>
#include <vector>

using namespace std;

int main()
{

    std::vector<int> vector1 {2,3,4};
    return 0;
}

  上面的代码是可行的,我搞了一周整天呀。。。。纪念我逝去的一天

时间: 2024-11-10 06:11:58

clion的相关文章

Clion + opencv环境搭建(体验最好的C++ IDE)

前言: 一个好的开发环境,是程序猿梦寐以求的,对于opencv的开发,一直觉得vs虽然牛逼但太庞大,所以后来用了codeblocks,然后又觉得无论是vs还是codeblocks都不够美观,代码提示也不太好,配置也很繁琐.然后,我就在网上搜好用的C++ IDE,这不,逮到了Clion,一直很怀念当年做web开发时用的IntelliJ IDEA,这个Clion也是来自Jetbrains家族的,所以美观方面可谓无可挑剔.下面就开始来搭建吧. 搭建: 1.下载下来最新的2016.3.3版本的Clion

CLion编译的exe文件离开IDE就不能运行

The program cannot start because libgcc_s_dw2-1.dll is missing from your computer. Try reinstalling the program to fix this problem 原因:使用CLion编译的程序是用cmake方法编译的,在windows上exe文件需要libgcc才能运行 解决方法 修改CMAKElist文件,添加让链接器静态链接libgcc和libstdc++的指令 set(CMAKE_EXE_

Clion = C/C++ 和 Python 共享的 IDE

Clion + Tdmgcc + Winpython(Python)

OpenGL开发环境配置-Windows/MinGW/Clion/CMake

因为某些原因,不想用过于臃肿的VS了,转而使用常用的jetbrains的CLion,Clion沿袭了jetbrans的优良传统,基本代码提示功能还是比较好的,不过就是对于windows不熟悉cmake(像我这样)的朋友可能不是太友好,经过了2个小时的查资料,终于正常运行了一个简单示例. 下面谈谈如何在Windows下配置这个开发环境. 起始,我是参考了我的前一篇OpenGL+VS开发环境的搭建,实际上除了freeglut重新下载的是MinGW版本之外,其他的文件并无区别,当然为了方便引用,我把所

CLion注冊码算法逆向分析实录(纯研究)

声明 CLion程序版权为jetBrains全部.注冊码授权为jetBrains及其付费用户全部,本篇仅仅从兴趣出发,研究其注冊码生成算法. 不会释出不论什么完整的源码. 网上查了下.已有注冊机,所以想要key的同学不要找我:p 背景 打算学习cocos2dx,奈何vim仅仅会ggvG,被jetBrains惯坏了,找到了CLion,试了下,果然神器.我等菜鸟正好能够拿来愉快地学习书写c++了. 可是,试用版有30天的限制.又没有学生授权.懒得折腾,看下它的注冊算法吧. 本篇用到的主要工具和命令:

在Clion的IDE中指定命令行参数

最近在linux上使用Clion这个C++ IDE,感觉很好,JetBrain的产品都很不错. 但是在跑简单例子的时候,使用到thread对象,直接build会出错 报错是: thread::thread<void (&)(int), int>(void (&)(int), int&&)':pthread_create'未定义的引用 就是说需要动态链接到pthread库上,然后就试着去run里面的edit_configure里面的cmdline paramete

使用CLion编辑C工程

最近正在研究Linux C代码编辑器,确实也不太喜欢SI(Windows看代码还行,编辑一般,同步麻烦), 尝试使用CLion,但对makefile工程支持不好,怎么编译还没搞懂, 阅读.编辑还不错,智能提示.语法检查.函数跳转.查引用都挺好用的. 不过要想使用CLion的这些功能需要添加工程中的h文件到CMakeList.txt,可参考如下脚本(把print结果添到CMakeList.txt里就行) #!/usr/bin/env python # -*- coding: utf-8 -*- i

ubuntu下设置clion是使用clang和clang++

链接 http://stackoverflow.com/questions/31725681/how-to-setup-clion-with-portable-clang-on-ubuntu I got the answer from CLion blog and it works and here it goes. To provide CMake compiler paths, go to Settings | Build, Execution, Deployment | CMake and

逆向怎么玩 - 动态调试jetBrains CLion实录

声明 CLion程序版权为jetBrains所有.注册码授权为jetBrains及其付费用户所有,本篇只从兴趣出发,研究其程序运行原理及注册码生成算法. 不会释出任何完整的源代码. 网上查了下,已有注册机,所以想要key的同学不要找我:p 背景 在上篇:CLion注册码算法逆向分析实录 我们通过结合jdb.jd-gui等工具,静态分析被混淆过的CLion的clion.jar中的class信息,顺利拿到了CLion的注册码算法. 但是,如果能在动态调试中分析代码路径,拿注册码并推算法不是更愉快么?