1

I'm trying to implement UUIDs for my entities in a C++ project I'm doing. I'm using Visual Studio Professional 2012.

I'm able to include and wthout any errors, but I also want the uuid_io.hpp to be able to convert the UUID to a string or just output it to stdout, but as soon as I include it I get a lot of errors, seemingly not related to any boost files.

I'm using the 32-bit windows binaries for msvc11 from here.

I have a common include file that looks like this:

//Common.h
#ifndef COMMON_H
#define COMMON_H

#include <iostream>
#include <vector>
#include <list>
#include <string>
#include <map>

#include <curses.h>
#include <panel.h>

#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <boost/uuid/uuid_generators.hpp>

#include "Map.h"
#include "Tile.h"
#include "Grid.h"
#include "Entity.h"

#endif

(curses.h and panel.h is from the pdcurses project, downloaded from here.)

This is the output I am getting:

1>------ Build started: Project: Curses, Configuration: Debug Win32 ------
1>  Map.cpp
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\algorithm(35): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocbuf(273): warning C4002: too many actual parameters for macro 'erase'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocbuf(283): warning C4002: too many actual parameters for macro 'erase'
1>e:\lib\boost_1_55_0\boost\io\ios_state.hpp(121): warning C4002: too many actual parameters for macro 'clear'
1>e:\lib\boost_1_55_0\boost\io\ios_state.hpp(126): warning C4002: too many actual parameters for macro 'clear'
1>e:\lib\boost_1_55_0\boost\io\ios_state.hpp(382): warning C4002: too many actual parameters for macro 'clear'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(557): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(603): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(610): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(617): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(642): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(1331): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(1494): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(1521): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\functional(239): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(494): error C2059: syntax error : '('
1>          d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(464) : while compiling class template member function 'std::string std::money_get<_Elem,_InIt>::_Getmfld(_InIt &,_InIt &,bool,std::ios_base &,_Elem *) const'
1>          with
1>          [
1>              _Elem=char,
1>              _InIt=std::istreambuf_iterator<char,std::char_traits<char>>
1>          ]
1>          d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(415) : see reference to function template instantiation 'std::string std::money_get<_Elem,_InIt>::_Getmfld(_InIt &,_InIt &,bool,std::ios_base &,_Elem *) const' being compiled
1>          with
1>          [
1>              _Elem=char,
1>              _InIt=std::istreambuf_iterator<char,std::char_traits<char>>
1>          ]
1>          d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(950) : see reference to class template instantiation 'std::money_get<_Elem,_InIt>' being compiled
1>          with
1>          [
1>              _Elem=char,
1>              _InIt=std::istreambuf_iterator<char,std::char_traits<char>>
1>          ]
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(495): error C2039: '_Off' : is not a member of 'std::basic_string<_Elem,_Traits,_Alloc>'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(495): error C2039: '_Sign' : is not a member of 'std::basic_string<_Elem,_Traits,_Alloc>'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(497): error C2059: syntax error : '('
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(499): error C2039: '_Source' : is not a member of 'std::basic_string<_Elem,_Traits,_Alloc>'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(499): error C2039: '_Symbol' : is not a member of 'std::basic_string<_Elem,_Traits,_Alloc>'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(499): error C2668: 'std::basic_string<_Elem,_Traits,_Alloc>::begin' : ambiguous call to overloaded function
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>          d:\program (x86)\microsoft visual studio 11.0\vc\include\xstring(1578): could be 'std::_String_const_iterator<_Mystr> std::basic_string<_Elem,_Traits,_Alloc>::begin(void) throw() const'
1>          with
1>          [
1>              _Mystr=std::_String_val<std::_Simple_types<char>>,
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>          d:\program (x86)\microsoft visual studio 11.0\vc\include\xstring(1573): or       'std::_String_iterator<_Mystr> std::basic_string<_Elem,_Traits,_Alloc>::begin(void) throw()'
1>          with
1>          [
1>              _Mystr=std::_String_val<std::_Simple_types<char>>,
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>          while trying to match the argument list '(void)'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(636): error C2059: syntax error : '('
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(637): error C2039: '_Neg' : is not a member of 'std::basic_string<_Elem,_Traits,_Alloc>'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(638): error C2039: '_Val' : is not a member of 'std::basic_string<_Elem,_Traits,_Alloc>'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>  Entity.cpp
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\algorithm(35): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocbuf(273): warning C4002: too many actual parameters for macro 'erase'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocbuf(283): warning C4002: too many actual parameters for macro 'erase'
1>e:\lib\boost_1_55_0\boost\io\ios_state.hpp(121): warning C4002: too many actual parameters for macro 'clear'
1>e:\lib\boost_1_55_0\boost\io\ios_state.hpp(126): warning C4002: too many actual parameters for macro 'clear'
1>e:\lib\boost_1_55_0\boost\io\ios_state.hpp(382): warning C4002: too many actual parameters for macro 'clear'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(557): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(603): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(610): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(617): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(642): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(1331): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(1494): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(1521): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\functional(239): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(494): error C2059: syntax error : '('
1>          d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(464) : while compiling class template member function 'std::string std::money_get<_Elem,_InIt>::_Getmfld(_InIt &,_InIt &,bool,std::ios_base &,_Elem *) const'
1>          with
1>          [
1>              _Elem=char,
1>              _InIt=std::istreambuf_iterator<char,std::char_traits<char>>
1>          ]
1>          d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(415) : see reference to function template instantiation 'std::string std::money_get<_Elem,_InIt>::_Getmfld(_InIt &,_InIt &,bool,std::ios_base &,_Elem *) const' being compiled
1>          with
1>          [
1>              _Elem=char,
1>              _InIt=std::istreambuf_iterator<char,std::char_traits<char>>
1>          ]
1>          d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(950) : see reference to class template instantiation 'std::money_get<_Elem,_InIt>' being compiled
1>          with
1>          [
1>              _Elem=char,
1>              _InIt=std::istreambuf_iterator<char,std::char_traits<char>>
1>          ]
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(495): error C2039: '_Off' : is not a member of 'std::basic_string<_Elem,_Traits,_Alloc>'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(495): error C2039: '_Sign' : is not a member of 'std::basic_string<_Elem,_Traits,_Alloc>'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(497): error C2059: syntax error : '('
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(499): error C2039: '_Source' : is not a member of 'std::basic_string<_Elem,_Traits,_Alloc>'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(499): error C2039: '_Symbol' : is not a member of 'std::basic_string<_Elem,_Traits,_Alloc>'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(499): error C2668: 'std::basic_string<_Elem,_Traits,_Alloc>::begin' : ambiguous call to overloaded function
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>          d:\program (x86)\microsoft visual studio 11.0\vc\include\xstring(1578): could be 'std::_String_const_iterator<_Mystr> std::basic_string<_Elem,_Traits,_Alloc>::begin(void) throw() const'
1>          with
1>          [
1>              _Mystr=std::_String_val<std::_Simple_types<char>>,
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>          d:\program (x86)\microsoft visual studio 11.0\vc\include\xstring(1573): or       'std::_String_iterator<_Mystr> std::basic_string<_Elem,_Traits,_Alloc>::begin(void) throw()'
1>          with
1>          [
1>              _Mystr=std::_String_val<std::_Simple_types<char>>,
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>          while trying to match the argument list '(void)'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(636): error C2059: syntax error : '('
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(637): error C2039: '_Neg' : is not a member of 'std::basic_string<_Elem,_Traits,_Alloc>'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(638): error C2039: '_Val' : is not a member of 'std::basic_string<_Elem,_Traits,_Alloc>'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>  Application.cpp
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\algorithm(35): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocbuf(273): warning C4002: too many actual parameters for macro 'erase'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocbuf(283): warning C4002: too many actual parameters for macro 'erase'
1>e:\lib\boost_1_55_0\boost\io\ios_state.hpp(121): warning C4002: too many actual parameters for macro 'clear'
1>e:\lib\boost_1_55_0\boost\io\ios_state.hpp(126): warning C4002: too many actual parameters for macro 'clear'
1>e:\lib\boost_1_55_0\boost\io\ios_state.hpp(382): warning C4002: too many actual parameters for macro 'clear'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(557): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(603): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(610): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(617): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(642): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(1331): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(1494): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\memory(1521): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\functional(239): warning C4003: not enough actual parameters for macro 'move'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(494): error C2059: syntax error : '('
1>          d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(464) : while compiling class template member function 'std::string std::money_get<_Elem,_InIt>::_Getmfld(_InIt &,_InIt &,bool,std::ios_base &,_Elem *) const'
1>          with
1>          [
1>              _Elem=char,
1>              _InIt=std::istreambuf_iterator<char,std::char_traits<char>>
1>          ]
1>          d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(415) : see reference to function template instantiation 'std::string std::money_get<_Elem,_InIt>::_Getmfld(_InIt &,_InIt &,bool,std::ios_base &,_Elem *) const' being compiled
1>          with
1>          [
1>              _Elem=char,
1>              _InIt=std::istreambuf_iterator<char,std::char_traits<char>>
1>          ]
1>          d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(950) : see reference to class template instantiation 'std::money_get<_Elem,_InIt>' being compiled
1>          with
1>          [
1>              _Elem=char,
1>              _InIt=std::istreambuf_iterator<char,std::char_traits<char>>
1>          ]
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(495): error C2039: '_Off' : is not a member of 'std::basic_string<_Elem,_Traits,_Alloc>'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(495): error C2039: '_Sign' : is not a member of 'std::basic_string<_Elem,_Traits,_Alloc>'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(497): error C2059: syntax error : '('
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(499): error C2039: '_Source' : is not a member of 'std::basic_string<_Elem,_Traits,_Alloc>'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(499): error C2039: '_Symbol' : is not a member of 'std::basic_string<_Elem,_Traits,_Alloc>'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(499): error C2668: 'std::basic_string<_Elem,_Traits,_Alloc>::begin' : ambiguous call to overloaded function
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>          d:\program (x86)\microsoft visual studio 11.0\vc\include\xstring(1578): could be 'std::_String_const_iterator<_Mystr> std::basic_string<_Elem,_Traits,_Alloc>::begin(void) throw() const'
1>          with
1>          [
1>              _Mystr=std::_String_val<std::_Simple_types<char>>,
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>          d:\program (x86)\microsoft visual studio 11.0\vc\include\xstring(1573): or       'std::_String_iterator<_Mystr> std::basic_string<_Elem,_Traits,_Alloc>::begin(void) throw()'
1>          with
1>          [
1>              _Mystr=std::_String_val<std::_Simple_types<char>>,
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>          while trying to match the argument list '(void)'
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(636): error C2059: syntax error : '('
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(637): error C2039: '_Neg' : is not a member of 'std::basic_string<_Elem,_Traits,_Alloc>'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>d:\program (x86)\microsoft visual studio 11.0\vc\include\xlocmon(638): error C2039: '_Val' : is not a member of 'std::basic_string<_Elem,_Traits,_Alloc>'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>
1>          ]
1>  Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
3
  • 1
    I would suggest removing include files until you find the one that is causing the problems, then look at that one. If I had to guess, though, I would say that someone is defining a macro named "clear", and this is causing problems. Nov 25, 2013 at 0:51
  • 1
    More evidence: boost/io/ios_state.hpp line 121 contains a call to { s.clear(a); }, where s is a parameter passed into the routine. The error message "too many actual parameters for macro 'clear'" is looking even more telling. Nov 25, 2013 at 0:55
  • The culprit was indeed determined by this method. The curses.h and panel.h headers caused problems when placed before the boost headers, moving them to last in the Common.h file allowed the program to compile without errors, thanks! :)
    – Armandur
    Nov 25, 2013 at 1:01

1 Answer 1

1

@Marshall Clow

The culprit was indeed determined by this method. The curses.h and panel.h headers caused problems when placed before the boost headers, moving them to last in the Common.h file allowed the program to compile without errors, thanks! :)

A while later I actually ended up just having the curses.h and panel.h included in the same file as the entry point for the program, Application.cpp. I programmed this when I was quite sleepy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.