Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2001-04-12 09:14:15


on 4/11/01 7:26 AM, John Maddock at John_Maddock_at_[hidden] wrote:

> I still have a lot of compiler problems with the crc code:
>
> With VC6:
>
> Compiling...
> crc_test.cpp
> d:\boost\crc\libs\crc\crc_test.cpp(157) : error C2563: mismatch in formal
> parameter list
> d:\boost\crc\libs\crc\crc_test.cpp(157) : error C2059: syntax error :
> 'constant'
> d:\boost\crc\libs\crc\crc_test.cpp(403) : error C2563: mismatch in formal
> parameter list
> d:\boost\crc\libs\crc\crc_test.cpp(407) : error C2563: mismatch in formal
> parameter list
> d:\boost\crc\libs\crc\crc_test.cpp(407) : error C2059: syntax error :
> 'constant'
> d:\boost\crc\libs\crc\crc_test.cpp(430) : error C2563: mismatch in formal
> parameter list
> d:\boost\crc\libs\crc\crc_test.cpp(437) : error C2563: mismatch in formal
> parameter list
> d:\boost\crc\libs\crc\crc_test.cpp(442) : error C2563: mismatch in formal
> parameter list
> d:\boost\crc\libs\crc\crc_test.cpp(444) : error C2563: mismatch in formal
> parameter list
> d:\boost\crc\libs\crc\crc_test.cpp(452) : error C2563: mismatch in formal
> parameter list
> d:\boost\crc\libs\crc\crc_test.cpp(452) : error C2059: syntax error :
> 'constant'
> d:\boost\crc\libs\crc\crc_test.cpp(461) : error C2563: mismatch in formal
> parameter list
> Error executing cl.exe.
>
> crc_test.exe - 12 error(s), 0 warning(s)

These are all on calls to the "crc" and "augmented_crc" functions that don't
have "boost::" prefixed to them, since I used "using boost::crc" statements.
The calls to "boost::crc" weren't flagged. Try adding the "boost::" to see
if it works. Maybe VC++ has a namespace-resolving problem.

> With gcc:
>
> In file included from crc_test.cpp:27:
> ../../boost/crc.hpp:399: conflicting types for `typename
> boost::detail::mask_uint_t<Bits>::fast
> boost::detail::crc_table_t<Bits,TruncPoly,Reflect>::table_[256]'
> ../../boost/crc.hpp:190: previous declaration as `typename
> boost::detail::mask_uint_t<Bits>::fast
> boost::detail::crc_table_t<Bits,TruncPoly,Reflect>::table_[(1 << 8)]'

Note the difference is the form of the element count. One has "256" and the
other uses "(1 << 8)". I used "1ul << CHAR_BIT" in the original source for
both. I guess GCC has a bug with resolving static expressions. Try making
a separate constant for "1ul << CHAR_BIT" and use that in the two lines.

> With Borland C++ 5.1
>
> [C++ Warning] RANDOM.HPP(121): W8008 Condition is always true
> [C++ Warning] RANDOM.HPP(125): W8066 Unreachable code
> [C++ Error] crc_test.cpp(225): E2451 Undefined symbol 'TrPo'
> [C++ Error] crc_test.cpp(225): E2451 Undefined symbol 'InRe'
> [C++ Error] crc_test.cpp(225): E2451 Undefined symbol 'FiXo'
> [C++ Error] crc_test.cpp(225): E2451 Undefined symbol 'ReIn'
> [C++ Error] crc_test.cpp(225): E2451 Undefined symbol 'ReRe'
> [C++ Error] crc_test.cpp(225): E2299 Cannot generate template
> specialization from
> 'compute_test<16,TruncPoly,InitRem,FinalXor,ReflectIn,ReflectRem>(std::ostr
> eam &,typename boost::uint_t<Bits>::fast)'
> [C++ Error] crc_test.cpp(225): E2285 Could not find a match for
> 'compute_test<Bits,TruncPoly,InitRem,FinalXor,ReflectIn,ReflectRem>(std::os
> tream,unsigned short)'
> [C++ Error] crc_test.cpp(225): E2451 Undefined symbol 'TrPo'
> [C++ Error] crc_test.cpp(225): E2451 Undefined symbol 'InRe'
> [C++ Error] crc_test.cpp(225): E2451 Undefined symbol 'FiXo'
> [C++ Error] crc_test.cpp(225): E2451 Undefined symbol 'ReIn'
> [C++ Error] crc_test.cpp(225): E2451 Undefined symbol 'ReRe'
> [C++ Error] crc_test.cpp(225): E2299 Cannot generate template
> specialization from
> 'compute_test<16,TruncPoly,InitRem,FinalXor,ReflectIn,ReflectRem>(std::ostr
> eam &,typename boost::uint_t<Bits>::fast)'
> [C++ Error] crc_test.cpp(225): E2285 Could not find a match for
> 'compute_test<Bits,TruncPoly,InitRem,FinalXor,ReflectIn,ReflectRem>(std::os
> tream,unsigned short)'
> [C++ Error] crc_test.cpp(225): E2451 Undefined symbol 'TrPo'
> [C++ Error] crc_test.cpp(225): E2451 Undefined symbol 'InRe'
> [C++ Error] crc_test.cpp(225): E2451 Undefined symbol 'FiXo'
> [C++ Error] crc_test.cpp(225): E2451 Undefined symbol 'ReIn'
> [C++ Error] crc_test.cpp(225): E2451 Undefined symbol 'ReRe'
> [C++ Error] crc_test.cpp(225): E2299 Cannot generate template
> specialization from
> 'compute_test<32,TruncPoly,InitRem,FinalXor,ReflectIn,ReflectRem>(std::ostr
> eam &,typename boost::uint_t<Bits>::fast)'
> [C++ Error] crc_test.cpp(225): E2285 Could not find a match for
> 'compute_test<Bits,TruncPoly,InitRem,FinalXor,ReflectIn,ReflectRem>(std::os
> tream,unsigned int)'

The definition of "compute_test" uses abbreviated forms of the formal
template parameters in the declaration ("TrPo" v. "TruncPoly"). I guess
Borland can't handle this. Try expanding the short forms to the full ones.

> I don't know how many of these are compiler problems, and how many are code
> problems, whatever the compiler problems seem not to be any better. It's
> hard to review something I can't build.....
>
> Anyone have any fixes?

-- 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk