Boost logo

Boost Users :

Subject: [Boost-users] compile error on Solaris 10
From: Kelvin Cheng (KCheng_at_[hidden])
Date: 2010-11-17 04:36:21


Hi,

My environment is Solaris 10 , g++ 3.3.2
I try to use the header files directly using the definition
-DBOOST_REGEX_NO_LIB
I got the following errors doing a simple compilation using regex.

g++ -fPIC -c -DUNIX -DSOLARIS -Dsun -D_PTHREADS -D_GLIBCXX_HAVE_MBSTATE_T

-DBOOST_REGEX_NO_LIB -I./ -I../shared/ -I../shared/boost ndbdriver.cpp -o
ndbdriver.o
In file included from ../shared/boost/boost/regex/v4/regex_traits.hpp:35,
                 from ../shared/boost/boost/regex/regex_traits.hpp:27,
                 from ../shared/boost/boost/regex/v4/regex.hpp:39,
                 from ../shared/boost/boost/regex.hpp:31,
                 from ndbdriver.cpp:39:
../shared/boost/boost/regex/v4/regex_traits_defaults.hpp:79: error:
redefinition
   of `bool boost::re_detail::is_combining(charT) [with charT = char]'
../shared/boost/boost/regex/v4/regex_traits_defaults.hpp:74: error: `bool
   boost::re_detail::is_combining(charT) [with charT = char]' previously
   declared here
In file included from ../shared/boost/boost/regex/v4/regex.hpp:58,
                 from ../shared/boost/boost/regex.hpp:31,
                 from ndbdriver.cpp:39:
../shared/boost/boost/regex/v4/states.hpp:60: error: redefinition of
`struct
   boost::re_detail::is_byte<char>'
../shared/boost/boost/regex/v4/states.hpp:58: error: previous definition
of `
   struct boost::re_detail::is_byte<char>'
In file included from ../shared/boost/boost/functional/hash.hpp:6,
                 from ../shared/boost/boost/regex/v4/basic_regex.hpp:23,
                 from ../shared/boost/boost/regex/v4/regex.hpp:67,
                 from ../shared/boost/boost/regex.hpp:31,
                 from ndbdriver.cpp:39:
../shared/boost/boost/functional/hash/hash.hpp: In function `size_t
   boost::hash_value(char)':
../shared/boost/boost/functional/hash/hash.hpp:152: error: redefinition of
`
   size_t boost::hash_value(char)'
../shared/boost/boost/functional/hash/hash.hpp:142: error: `size_t
   boost::hash_value(char)' previously defined here
../shared/boost/boost/functional/hash/hash.hpp:152: error: redefinition of
`
   size_t boost::hash_value(char)'
../shared/boost/boost/functional/hash/hash.hpp:142: error: `size_t
   boost::hash_value(char)' previously defined here
../shared/boost/boost/functional/hash/hash.hpp: In member function `size_t
   boost::hash<char>::operator()(char) const':
../shared/boost/boost/functional/hash/hash.hpp:405: error: call of
overloaded `
   hash_value(char&)' is ambiguous
../shared/boost/boost/functional/hash/hash.hpp:137: error: candidates are:
   size_t boost::hash_value(bool)
../shared/boost/boost/functional/hash/hash.hpp:142: error:
   size_t boost::hash_value(char)
../shared/boost/boost/functional/hash/hash.hpp:147: error:
   size_t boost::hash_value(unsigned char)
../shared/boost/boost/functional/hash/hash.hpp:157: error:
   size_t boost::hash_value(short int)
../shared/boost/boost/functional/hash/hash.hpp:162: error:
   size_t boost::hash_value(short unsigned int)
../shared/boost/boost/functional/hash/hash.hpp:167: error:
   size_t boost::hash_value(int)
../shared/boost/boost/functional/hash/hash.hpp:172: error:
   size_t boost::hash_value(unsigned int)
../shared/boost/boost/functional/hash/hash.hpp:177: error:
   size_t boost::hash_value(long int)
../shared/boost/boost/functional/hash/hash.hpp:182: error:
   size_t boost::hash_value(long unsigned int)
../shared/boost/boost/functional/hash/hash.hpp:188: error:
   size_t boost::hash_value(wchar_t)
../shared/boost/boost/functional/hash/hash.hpp:195: error:
   size_t boost::hash_value(long long int)
../shared/boost/boost/functional/hash/hash.hpp:200: error:
   size_t boost::hash_value(long long unsigned int)
../shared/boost/boost/functional/hash/hash.hpp:314: error:
   size_t boost::hash_value(float)
../shared/boost/boost/functional/hash/hash.hpp:319: error:
   size_t boost::hash_value(double)
../shared/boost/boost/functional/hash/hash.hpp:324: error:
   size_t boost::hash_value(long double)
../shared/boost/boost/functional/hash/hash.hpp:152: error:
   size_t boost::hash_value(char)
../shared/boost/boost/functional/hash/hash.hpp: At global scope:
../shared/boost/boost/functional/hash/hash.hpp:406: error: redefinition of
`
   struct boost::hash<char>'
../shared/boost/boost/functional/hash/hash.hpp:405: error: previous
definition
   of `struct boost::hash<char>'

All the errors are from related to the basic types when expanded from the
templates.
Any idea what's going wrong ?

-- Kelvin KF



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net