Please, help me…it’s many weeks I can’t solve my problem. In the most of 3ds loaders I found, there’s the use of the class “vector” using “push back” and the other function I don’t remember now. well, this class doesn’t work with all compilers I got.I know I could write my own code, but I can’t. please, is there anyone who could help me? thanks very much!
Fabio
Vector is in the STL, so it should be available on every C++ compiler.
Try including it’s header in angle brackets like this:
#include <vector>
And check that everywhere you use vector, make sure that you are in the correct namespace. i.e.
where ever you see:
vector<int> my_vec;
change it to:
std::vector<int> my_vec;
Hope this helps.
If your “problem code” uses just vector <float> or something, there will be problems with ISO compliant C++ compilers. Yes, you can change it to std::vector <float> everywhere, but an easier way is to just add
using namespace std;
immediately after the #include <vector> directive.
well, I use “using namespace std;” cause it’s already present in the code, but the problem remains. this is what happens when I compile it, so you can have a more specific help.
--------------------Configuration: 3dsLoader - Win32 Debug--------------------
Compiling…
3dsLoader.cpp
C:\Programmi\DevStudio\VC\INCLUDE\xutility(45) : error C2784: ‘bool __cdecl std: perator <(const class std::reverse_iterator<
template-parameter-1',
template-parameter-2’,template-parameter-3',
template-parameter-4’,template-parameter-5'> &,const class std::reverse_iterator<
template-parameter-1’,template-parameter-2',
template-parameter-3’,template-parameter-4',
template-parameter-5’> &)’ : could not deduce template argument for ‘const class std::reverse_iterator<template-parameter-1',
template-parameter-2’,template-parameter-3',
template-parameter-4’,template-parameter-5'> &' from 'const struct tMaterialInfo' C:\Programmi\DevStudio\VC\INCLUDE\xutility(45) : error C2784: 'bool __cdecl std: [img]http://www.opengl.org/discussion_boards/ubb/redface.gif[/img]perator <(const struct std: [img]http://www.opengl.org/discussion_boards/ubb/tongue.gif[/img]air<
template-parameter-1’,template-parameter-2'> &,const struct std: [img]http://www.opengl.org/discussion_boards/ubb/tongue.gif[/img]air<
template-parameter-1’,template-parameter-2'> &)' : could not deduce template argument for 'const struct std: [img]http://www.opengl.org/discussion_boards/ubb/tongue.gif[/img]air<
template-parameter-1’,template-parameter-2'> &' from 'const struct tMaterialInfo' C:\Programmi\DevStudio\VC\INCLUDE\xutility(45) : error C2676: binary '<' : 'const struct tMaterialInfo' does not define this operator or a conversion to a type acceptable to the predefined operator C:\Programmi\DevStudio\VC\INCLUDE\xutility(47) : error C2784: 'bool __cdecl std: [img]http://www.opengl.org/discussion_boards/ubb/redface.gif[/img]perator <(const class std::reverse_iterator<
template-parameter-1’,template-parameter-2',
template-parameter-3’,template-parameter-4',
template-parameter-5’> &,const
class std::reverse_iterator<template-parameter-1',
template-parameter-2’,template-parameter-3',
template-parameter-4’,template-parameter-5'> &)' : could not deduce template argument for 'const class std::reverse_iterator<
template-parameter-1’,template-parameter-2',
template-parameter-3’,template-parameter-4',
template-parameter-5’> &’ from ‘const struct tMaterialInfo’
C:\Programmi\DevStudio\VC\INCLUDE\xutility(47) : error C2784: ‘bool __cdecl std: perator <(const struct std:
air<
template-parameter-1',
template-parameter-2’> &,const struct std: air<
template-parameter-1',
template-parameter-2’> &)’ : could not
deduce template argument for ‘const struct std: air<
template-parameter-1',
template-parameter-2’> &’ from ‘const struct tMaterialInfo’
C:\Programmi\DevStudio\VC\INCLUDE\xutility(47) : error C2676: binary ‘<’ : ‘const struct tMaterialInfo’ does not define this operator or a conversion to a type acceptable to the predefined operator
C:\Programmi\DevStudio\VC\INCLUDE\xutility(45) : error C2784: ‘bool __cdecl std: perator <(const class std::reverse_iterator<
template-parameter-1',
template-parameter-2’,template-parameter-3',
template-parameter-4’,template-parameter-5'> &,const class std::reverse_iterator<
template-parameter-1’,template-parameter-2',
template-parameter-3’,template-parameter-4',
template-parameter-5’> &)’ : could not deduce template argument for ‘const class std::reverse_iterator<template-parameter-1',
template-parameter-2’,template-parameter-3',
template-parameter-4’,template-parameter-5'> &' from 'const struct t3DObject' C:\Programmi\DevStudio\VC\INCLUDE\xutility(45) : error C2784: 'bool __cdecl std: [img]http://www.opengl.org/discussion_boards/ubb/redface.gif[/img]perator <(const struct std: [img]http://www.opengl.org/discussion_boards/ubb/tongue.gif[/img]air<
template-parameter-1’,template-parameter-2'> &,const struct std: [img]http://www.opengl.org/discussion_boards/ubb/tongue.gif[/img]air<
template-parameter-1’,template-parameter-2'> &)' : could not deduce template argument for 'const struct std: [img]http://www.opengl.org/discussion_boards/ubb/tongue.gif[/img]air<
template-parameter-1’,template-parameter-2'> &' from 'const struct t3DObject' C:\Programmi\DevStudio\VC\INCLUDE\xutility(45) : error C2676: binary '<' : 'const struct t3DObject' does not define this operator or a conversion to a type acceptable to the predefined operator C:\Programmi\DevStudio\VC\INCLUDE\xutility(47) : error C2784: 'bool __cdecl std: [img]http://www.opengl.org/discussion_boards/ubb/redface.gif[/img]perator <(const class std::reverse_iterator<
template-parameter-1’,template-parameter-2',
template-parameter-3’,template-parameter-4',
template-parameter-5’> &,const
class std::reverse_iterator<template-parameter-1',
template-parameter-2’,template-parameter-3',
template-parameter-4’,template-parameter-5'> &)' : could not deduce template argument for 'const class std::reverse_iterator<
template-parameter-1’,template-parameter-2',
template-parameter-3’,template-parameter-4',
template-parameter-5’> &’ from ‘const struct t3DObject’
C:\Programmi\DevStudio\VC\INCLUDE\xutility(47) : error C2784: ‘bool __cdecl std: perator <(const struct std:
air<
template-parameter-1',
template-parameter-2’> &,const struct std: air<
template-parameter-1',
template-parameter-2’> &)’ : could not
deduce template argument for ‘const struct std: air<
template-parameter-1',
template-parameter-2’> &’ from ‘const struct t3DObject’
C:\Programmi\DevStudio\VC\INCLUDE\xutility(47) : error C2676: binary ‘<’ : ‘const struct t3DObject’ does not define this operator or a conversion to a type acceptable to the predefined operator
Error executing cl.exe.
3dsLoader.exe - 12 error(s), 0 warning(s)
where’s the problem? thanks!
it’s always me. is there no one who can help me?
I think this page maybe usefull to you:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;166721
Now it’s all ok, thanks!