[boost::tokenizer] scope error usage of object run under win32 CL, ICL but fails under linux32 gcc
Hi all, I've some weird problem, its probably simple thing, but I'm probably to tired to find it out. g++ throws me following error : *getFunc.h: In static member function ‘static void Logic::setFunctionNameFromStringMsg(const char*, char*, unsigned int, unsigned int)’:* *getFunc.h:86: error: ‘tok’ was not declared in this scope * Code looks like this: *static void setFunctionNameFromStringMsg(const char *fTab, char *dst, unsigned int msg_size, unsigned int buf_size)** ** {** ** std::string msg_copy(fTab,msg_size);** **boost::char_separator<char> sep("[]@\n\r\t "); ** ** boost::tokenizer<boost::char_separator<char>> tok(msg_copy, sep);** ** std::string resFunc;** ** ....* * ....* *//line 86** ** if(tok.begin() != tok.end()) // check is there any function** ** {** ** resFunc=*(tok.begin());** **......* Funny thing is that there are no problems during CL and intel compilers win32 processing. Thanks for any advice. * * * *
Patryk Bukowinski wrote:
Hi all, I've some weird problem, its probably simple thing, but I'm probably to tired to find it out. g++ throws me following error : /getFunc.h: In static member function ‘static void Logic::setFunctionNameFromStringMsg(const char*, char*, unsigned int, unsigned int)’:/ / getFunc.h:86: error: ‘tok’ was not declared in this scope /
...
// boost::tokenizer<boost::char_separator<char>> tok(msg_copy, sep);//
Depending on the compiler version, try inserting a blank between the two greater than's at the end of your template parameters ala: boost::tokenizer<boost::char_separator<char> > tok(msg_copy, sep); Jeff
Hi, I've tried that, I've been trying to do a lot of stuff, but nothing helped. ex. -type definitions, -fancy template forward declarations in scope, class body, function..etc. During tests I'd a lot of funny things happening with other variables, for example there were messages like: *error: ‘i’ was not declared in this scope (integer)* One thing which was working for me is: -moving tok to shared pointer in class definition. But it's no more static method. But I use that for now with block *#IFDEF GCC * :) cheers P. 2009/10/16 Jeff Flinn <TriumphSprint2000@hotmail.com>
Patryk Bukowinski wrote:
Hi all, I've some weird problem, its probably simple thing, but I'm probably to tired to find it out. g++ throws me following error : /getFunc.h: In static member function ‘static void Logic::setFunctionNameFromStringMsg(const char*, char*, unsigned int, unsigned int)’:/ / getFunc.h:86: error: ‘tok’ was not declared in this scope /
...
// boost::tokenizer<boost::char_separator<char>> tok(msg_copy, sep);//
Depending on the compiler version, try inserting a blank between the two greater than's at the end of your template parameters ala:
boost::tokenizer<boost::char_separator<char> > tok(msg_copy, sep);
Jeff
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Jeff Flinn
-
Patryk Bukowinski