GG Failure: error: no matching function for call to 'swap(ad

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
User avatar
bhelyer
Space Floater
Posts: 41
Joined: Tue Aug 28, 2007 3:51 am

GG Failure: error: no matching function for call to 'swap(ad

#1 Post by bhelyer »

Everybody loves template errors. In GiGi:

Code: Select all

g++ -o src/adobe/virtual_machine.os -c -pthread -Wall -Wno-parentheses -O2 -fPIC -I/usr/include/freetype2 -I. -Ilibltdl src/adobe/virtual_machine.cpp
./GG/adobe/any_regular.hpp: In static member function 'static adobe::version_1::any_regular_t& adobe::version_1::any_regular_t::helper<T>::assign(adobe::version_1::any_regular_t&, const T&) [with T = bool]':
./GG/adobe/any_regular.hpp:610:   instantiated from 'adobe::version_1::any_regular_t& adobe::version_1::any_regular_t::assign(const T&, typename adobe::copy_sink<T, T, void*>::type) [with T = bool]'
src/adobe/virtual_machine.cpp:510:   instantiated from 'void adobe::virtual_machine_t::implementation_t::unary_operator() [with Operator = std::logical_not, OperandType = bool]'
src/adobe/virtual_machine.cpp:356:   instantiated from here
./GG/adobe/any_regular.hpp:734: error: no matching function for call to 'swap(adobe::version_1::any_regular_t&, adobe::version_1::any_regular_t&)'
./GG/adobe/any_regular.hpp: In static member function 'static adobe::version_1::any_regular_t& adobe::version_1::any_regular_t::helper<T>::assign(adobe::version_1::any_regular_t&, const T&) [with T = double]':
./GG/adobe/any_regular.hpp:610:   instantiated from 'adobe::version_1::any_regular_t& adobe::version_1::any_regular_t::assign(const T&, typename adobe::copy_sink<T, T, void*>::type) [with T = double]'
src/adobe/virtual_machine.cpp:510:   instantiated from 'void adobe::virtual_machine_t::implementation_t::unary_operator() [with Operator = std::negate, OperandType = double]'
src/adobe/virtual_machine.cpp:357:   instantiated from here
./GG/adobe/any_regular.hpp:734: error: no matching function for call to 'swap(adobe::version_1::any_regular_t&, adobe::version_1::any_regular_t&)'
./GG/adobe/any_regular.hpp: In static member function 'static adobe::version_1::any_regular_t& adobe::version_1::any_regular_t::helper<T>::assign(adobe::version_1::any_regular_t&, const T&) [with T = long int]':
./GG/adobe/any_regular.hpp:610:   instantiated from 'adobe::version_1::any_regular_t& adobe::version_1::any_regular_t::assign(const T&, typename adobe::copy_sink<T, T, void*>::type) [with T = long int]'
src/adobe/virtual_machine.cpp:493:   instantiated from 'void adobe::virtual_machine_t::implementation_t::binary_operator() [with Operator = std::modulus, OperandType = long int]'
src/adobe/virtual_machine.cpp:361:   instantiated from here
./GG/adobe/any_regular.hpp:734: error: no matching function for call to 'swap(adobe::version_1::any_regular_t&, adobe::version_1::any_regular_t&)'

Code: Select all

$ svn info
Path: .
URL: https://gigi.svn.sourceforge.net/svnroot/gigi/trunk/GG
Repository Root: https://gigi.svn.sourceforge.net/svnroot/gigi
Repository UUID: 7c2786a3-320a-0410-a570-c9f285c52180
Revision: 750
Node Kind: directory
Schedule: normal
Last Changed Author: tzlaine
Last Changed Rev: 750
Last Changed Date: 2009-05-22 16:18:47 +1200 (Fri, 22 May 2009)

$ gcc --version  
gcc (Ubuntu 4.3.2-1ubuntu12) 4.3.2
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ uname -a
Linux stickers 2.6.27-7-generic #1 SMP Fri Oct 24 06:42:44 UTC 2008 i686 GNU/Linux
Any ideas?

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: GG Failure: error: no matching function for call to 'swap(ad

#2 Post by Geoff the Medio »

I think kroddn was having this error a few weeks or months ago. Try changing the swap call where the error is to std::swap .

User avatar
bhelyer
Space Floater
Posts: 41
Joined: Tue Aug 28, 2007 3:51 am

Re: GG Failure: error: no matching function for call to 'swap(ad

#3 Post by bhelyer »

That got it. Thanks!

Post Reply