[Insight-users] 'swap' : is not a member of 'std'

Bing Jian bjian at cise.ufl.edu
Tue Aug 17 10:53:02 EDT 2004


Yes. That's why I feel confused. There is no such text "instantiated from",
and I am not using any STL class directly.  I even minimize my main
program to int main(){return 0;}.  But it gives same errors.  However,
since the code compiles under linux. I guess there must be something
related to Visual Studio.

Thanks anyway.



--------------------Configuration: testhorn - Win32 
Release--------------------
Compiling...
testreg.cxx
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\vector(221) : 
error C2039: 'swap' : is not a member of 'std'
        C:\Program Files\Microsoft Visual 
Studio\VC98\INCLUDE\vector(220) : while compiling class-template member 
function 'void __thiscall std::vector<unsigned int,class 
std::allocator<unsigned int> >::swap(class std::vector<unsigned 
int,class std:
:allocator<unsigned int> > &)'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\vector(221) : 
error C2660: 'swap' : function does not take 2 parameters
        C:\Program Files\Microsoft Visual 
Studio\VC98\INCLUDE\vector(220) : while compiling class-template member 
function 'void __thiscall std::vector<unsigned int,class 
std::allocator<unsigned int> >::swap(class std::vector<unsigned 
int,class std:
:allocator<unsigned int> > &)'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\vector(222) : 
error C2039: 'swap' : is not a member of 'std'
        C:\Program Files\Microsoft Visual 
Studio\VC98\INCLUDE\vector(220) : while compiling class-template member 
function 'void __thiscall std::vector<unsigned int,class 
std::allocator<unsigned int> >::swap(class std::vector<unsigned 
int,class std:
:allocator<unsigned int> > &)'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\vector(222) : 
error C2660: 'swap' : function does not take 2 parameters
        C:\Program Files\Microsoft Visual 
Studio\VC98\INCLUDE\vector(220) : while compiling class-template member 
function 'void __thiscall std::vector<unsigned int,class 
std::allocator<unsigned int> >::swap(class std::vector<unsigned 
int,class std:
:allocator<unsigned int> > &)'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\vector(223) : 
error C2039: 'swap' : is not a member of 'std'
        C:\Program Files\Microsoft Visual 
Studio\VC98\INCLUDE\vector(220) : while compiling class-template member 
function 'void __thiscall std::vector<unsigned int,class 
std::allocator<unsigned int> >::swap(class std::vector<unsigned 
int,class std:
:allocator<unsigned int> > &)'
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\vector(223) : 
error C2660: 'swap' : function does not take 2 parameters
        C:\Program Files\Microsoft Visual 
Studio\VC98\INCLUDE\vector(220) : while compiling class-template member 
function 'void __thiscall std::vector<unsigned int,class 
std::allocator<unsigned int> >::swap(class std::vector<unsigned 
int,class std:
:allocator<unsigned int> > &)'
Error executing cl.exe.

testreg.exe - 6 error(s), 0 warning(s)


Luis Ibanez wrote:

>
> Hi Bing,
>
> Is that the only error line that you get ?
>
> This type of error is usually preceded with a number
> of errors with text like "instantiated from".
>
> Also, are you using STL classes directly in your code ?
> or do you get this error through the use of ITK classes ?
>
> Maybe you should post to the list a code snippet of the
> program that is producing the error...
>
>
> Please let us know.
>
>
>   Thanks
>
>
>     Luis
>
>
> -----------------
> Bing Jian wrote:
>
>> Well, the same code compiles smoothly under linux using g++.
>>
>>
>> Bing Jian wrote:
>>
>>> Hi, there,
>>>
>>>        When  trying to compile my own ITK-based program,  I came 
>>> across the following  error
>>> C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\vector(221) : 
>>> error C2039: 'swap' : is not a member of 'std'
>>>        C:\Program Files\Microsoft Visual 
>>> Studio\VC98\INCLUDE\vector(220) : while compiling class-template 
>>> member function 'void __thiscall std::vector<unsigned int,class 
>>> std::allocator<unsigned int> >::swap(class std::vector<unsigned 
>>> int,class std:
>>> :allocator<unsigned int> > &)'
>>> ......
>>> Error executing cl.exe.
>>>
>>> testreg.exe - 6 error(s), 0 warning(s)
>>>
>>>    The error message does not show which line of my own code causes 
>>> the errors.   I am wondering if
>>> anybody has met this kind of errors before and like to know how to 
>>> solve it.
>>>    Many thanks in advance!
>>>
>>
>>
>
>
>
>


-- 
Best wishes,
Bing Jian
bjian at cise.ufl.edu




More information about the Insight-users mailing list