При использовании вектора получаю кучу ошибок.
| Код | #pragma once #include "WResource.h" #include <vector>
using namespace std;
class Catalog { vector<WResource> catalog; public: Catalog(void); void add(String ^ name, String ^ type, int volume, String ^ placement, int maxdepth, String ^ shortinfo); void show(); void searchName(String ^ name); void searchType(String ^ type); void searchVolume(int volume); void searchPlacement(String ^ placement); void searchMaxdepth(int maxdepth); };
|
| Код | void Catalog::add(String ^ name, String ^ type, int volume, String ^ placement, int maxdepth, String ^ shortinfo) { WResource wr(name, type, volume, placement, maxdepth, shortinfo); catalog.push_back(wr); }
|
| Код | 1>------ Build started: Project: WaterResources, Configuration: Debug Win32 ------ 1>Compiling... 1>Catalog.cpp 1>D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\xmemory(96) : error C3699: '*' : cannot use this indirection on type 'WResource' 1> compiler replacing '*' with '^' to continue parsing 1> D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\vector(416) : see reference to class template instantiation 'std::allocator<_Ty>' being compiled 1> with 1> [ 1> _Ty=WResource 1> ] 1> D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\vector(426) : see reference to class template instantiation 'std::_Vector_val<_Ty,_Alloc>' being compiled 1> with 1> [ 1> _Ty=WResource, 1> _Alloc=std::allocator<WResource> 1> ] 1> d:\all are here\!заказы\waterresources\waterresources\Catalog.h(9) : see reference to class template instantiation 'std::vector<_Ty>' being compiled 1> with 1> [ 1> _Ty=WResource 1> ] 1>D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\xmemory(97) : error C3699: '&' : cannot use this indirection on type 'WResource' 1> compiler replacing '&' with '^' to continue parsing 1>D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\xmemory(98) : error C3699: '*' : cannot use this indirection on type 'const WResource' 1> compiler replacing '*' with '^' to continue parsing 1>D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\xmemory(99) : error C3699: '&' : cannot use this indirection on type 'const WResource' 1> compiler replacing '&' with '^' to continue parsing 1>D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\xmemory(154) : error C3699: '&' : cannot use this indirection on type 'const WResource' 1> compiler replacing '&' with '^' to continue parsing 1>D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\vector(473) : error C3699: '&' : cannot use this indirection on type 'const WResource' 1> compiler replacing '&' with '^' to continue parsing 1>D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\vector(479) : error C3699: '&' : cannot use this indirection on type 'const WResource' 1> compiler replacing '&' with '^' to continue parsing 1>D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\vector(531) : error C3699: '&' : cannot use this indirection on type 'const WResource' 1> compiler replacing '&' with '^' to continue parsing 1>D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\vector(785) : error C3699: '&' : cannot use this indirection on type 'const WResource' 1> compiler replacing '&' with '^' to continue parsing 1>D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\vector(846) : error C3699: '&' : cannot use this indirection on type 'const WResource' 1> compiler replacing '&' with '^' to continue parsing 1>D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\vector(851) : error C3699: '&' : cannot use this indirection on type 'const WResource' 1> compiler replacing '&' with '^' to continue parsing 1>D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\vector(858) : error C3699: '&' : cannot use this indirection on type 'const WResource' 1> compiler replacing '&' with '^' to continue parsing 1>D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\vector(1058) : error C3699: '&' : cannot use this indirection on type 'const WResource' 1> compiler replacing '&' with '^' to continue parsing 1>D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\vector(1116) : error C3699: '&' : cannot use this indirection on type 'const WResource' 1> compiler replacing '&' with '^' to continue parsing 1>D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\vector(1206) : error C3699: '&' : cannot use this indirection on type 'const WResource' 1> compiler replacing '&' with '^' to continue parsing 1>D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\vector(1243) : error C3265: cannot declare a managed '_Myfirst' in an unmanaged 'std::vector<_Ty>' 1> with 1> [ 1> _Ty=WResource 1> ] 1> may not declare a global or static variable, or a member of a native type that refers to objects in the gc heap 1>D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\vector(1244) : error C3265: cannot declare a managed '_Mylast' in an unmanaged 'std::vector<_Ty>' 1> with 1> [ 1> _Ty=WResource 1> ] 1> may not declare a global or static variable, or a member of a native type that refers to objects in the gc heap 1>D:\Program Files (x86)\Visual Studio 2005 (8)\VC\include\vector(1245) : error C3265: cannot declare a managed '_Myend' in an unmanaged 'std::vector<_Ty>' 1> with 1> [ 1> _Ty=WResource 1> ] 1> may not declare a global or static variable, or a member of a native type that refers to objects in the gc heap 1>Build log was saved at "file://d:\All are here\!Заказы\WaterResources\WaterResources\Debug\BuildLog.htm" 1>WaterResources - 18 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
|
Помогите разобраться, пожалуйста. |