小编Yel*_*ats的帖子

boost :: multi_array resize不起作用

我不能让boost :: multi_array调整大小来工作.当我尝试它时,它会给出关于std :: _ Copy_impl之类的错误.这是代码

#include <boost/multi_array.hpp>

typedef boost::multi_array<int, 2> array_type;

class arrayclass{
public:
    arrayclass(array_type::extent_gen extents)
        : multiarray(extents[3][4]){
    }
    array_type multiarray;
};

int main(){
    array_type::extent_gen extents;
    arrayclass arraytest(extents);
    arraytest.multiarray.resize(extents[5][6]);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

编辑:这是错误

1>------ Build started: Project: multiarray, Configuration: Debug Win32 ------
1>  main.cpp
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(2216): error C2665: 'std::_Copy_impl' : none of the 2 overloads could convert all the argument types
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(2182): could be '_OutIt std::_Copy_impl<_InIt,_OutIt>(_InIt,_InIt,_OutIt,std::input_iterator_tag,std::output_iterator_tag)'
1>          with
1> …
Run Code Online (Sandbox Code Playgroud)

c++ boost

16
推荐指数
1
解决办法
3138
查看次数

使用Boost在Visual Studio10上编译和使用JSONCPP

我最近使用VS71 makefile编译了JSONCPP的SVN版本.它工作,但我收到很多链接器错误

1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: __int64 __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,__int64)" (?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE_JPBD_J@Z) already defined in JSONCPP.lib(json_writer.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: void __thiscall std::basic_ostream<char,struct std::char_traits<char> >::_Osfx(void)" (?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in JSONCPP.lib(json_writer.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > * __thiscall std::basic_ios<char,struct std::char_traits<char> >::tie(void)const " (?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ) already defined in JSONCPP.lib(json_writer.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Init(void)" (?_Init@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEXXZ) already defined in JSONCPP.lib(json_writer.obj)
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "protected: __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::basic_streambuf<char,struct std::char_traits<char> >(void)" …

c++ boost visual-studio-2010 jsoncpp

15
推荐指数
1
解决办法
1万
查看次数

标签 统计

boost ×2

c++ ×2

jsoncpp ×1

visual-studio-2010 ×1