
Hi, I first created my project using BGL under Visual C++. The project works fine. Then, I want to compile the source files using gcc in linux environment. I got a lot of errors by simply calling (gcc mainfile.cpp). Errors such as : /usr/include/boost/pending/stringtok.hpp:64: error: redefinition of `bool <unnamed>::isws(char, const char*)' /usr/include/boost/pending/stringtok.hpp:64: error: `bool <unnamed>::isws(char, const char*)' previously defined here /usr/include/boost/pending/stringtok.hpp: At global scope: /usr/include/boost/pending/stringtok.hpp:83: error: redefinition of ` template<class Container> void boost::stringtok(Container&, const std::string&, const char*)' Thanks for your help. Abdel.

Abdelmorhit El Rhazi wrote:
Hi,
I first created my project using BGL under Visual C++. The project works fine. Then, I want to compile the source files using gcc in linux environment. I got a lot of errors by simply calling (gcc mainfile.cpp). Errors such as : /usr/include/boost/pending/stringtok.hpp:64: error: redefinition of `bool <unnamed>::isws(char, const char*)' /usr/include/boost/pending/stringtok.hpp:64: error: `bool <unnamed>::isws(char, const char*)' previously defined here
The above error looks bizarre, since the two definitions stem from the same location. Indeed, looking at boost/pending/stringtok.hpp in CVS HEAD, it appears the file is missing header guards, so any duplicate inclusion (directly or indirectly) will cause the above error. Note that this is totally unrelated to the subject of your mail, i.e. this is not a compatibility issue. VC++ should actually complain, too. HTH, Stefan -- ...ich hab' noch einen Koffer in Berlin...

Stefan Seefeld wrote:
The above error looks bizarre, since the two definitions stem from the same location. Indeed, looking at boost/pending/stringtok.hpp in CVS HEAD, it appears the file is missing header guards, so any duplicate inclusion (directly or indirectly) will cause the above error. Note that this is totally unrelated to the subject of your mail, i.e. this is not a compatibility issue. VC++ should actually complain, too.
Possibly he's using a 1.33.1 release on Windows and a CVS version on Linux. Sebastian Redl

What is gcc -v saying? On 4/12/07, Sebastian Redl <sebastian.redl@getdesigned.at> wrote:
Stefan Seefeld wrote:
The above error looks bizarre, since the two definitions stem from the same location. Indeed, looking at boost/pending/stringtok.hpp in CVS HEAD, it appears the file is missing header guards, so any duplicate inclusion (directly or indirectly) will cause the above error. Note that this is totally unrelated to the subject of your mail, i.e. this is not a compatibility issue. VC++ should actually complain, too.
Possibly he's using a 1.33.1 release on Windows and a CVS version on Linux.
Sebastian Redl _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

elviin wrote:
What is gcc -v saying?
How does that matter? Stefan already pointed out that the file lacks include guards (it does so in 1.33, too). This is a problem in stringtok.hpp and does not depend on the version of gcc. That this error didn't become apparent und VC++ might have been caused by some compiler settings (precompiled headers, maybe?). Regards, m
participants (5)
-
Abdelmorhit El Rhazi
-
elviin
-
Martin Wille
-
Sebastian Redl
-
Stefan Seefeld