[GCC-XML] problem compiling code with gccxml
Alexis H. Rivera-Rios
ahrivera at yahoo.com
Thu Jul 28 12:26:36 EDT 2005
Hi,
I'm trying to expose the following class using pyste
(which in turns uses gccxml)
#include <boost/random.hpp>
#include <ctime>
#include <boost/shared_ptr.hpp>
class RandomGeneratorSingleton
{
public:
typedef boost::mt19937 URNG; ///< type of random
number generator method
/// create single instance of this class
static RandomGeneratorSingleton* Instance()
{
if (_instance == 0)
{
_instance = new RandomGeneratorSingleton();
}
return _instance;
}
/// return pointer to random number generator
/// this class owns this pointer.
URNG &GetGenerator() { return urng; }
private:
URNG urng; ///< random number generator used by all
generators
static RandomGeneratorSingleton* _instance; ///<
singleton instance of this class
/// copy constructor hidden
RandomGeneratorSingleton(const
RandomGeneratorSingleton& );
/// assignment constructor hidden
RandomGeneratorSingleton& operator=(const
RandomGeneratorSingleton& );
/// default constructor (initializes random number
generator)
RandomGeneratorSingleton()
{
urng.seed(static_cast<unsigned int>(clock()));
}
};
when I run gccxml like this:
gccxml -I c:\boost\include\boost-1_32 test.cpp --debug
--gccxml-compiler msvc71
(because if I don't specify the compiler it defaults
to vc6)
The debug flags are the following:
"-quiet"
"-fsyntax-only"
"-w"
"-o"
"NUL"
"-nostdinc"
"-I"
"c:\boost\include\boost-1_32"
"test.cpp"
"-D__stdcall=__attribute__((__stdcall__))"
"-D__cdecl=__attribute__((__cdecl__))"
"-D__fastcall=__attribute__((__fastcall__))"
"-D_stdcall=__attribute__((__stdcall__))"
"-D_cdecl=__attribute__((__cdecl__))"
"-D_fastcall=__attribute__((__fastcall__))"
"-D__declspec(x)=__attribute__((x))"
"-D__cplusplus"
"-D_inline=inline"
"-D__forceinline=__inline"
"-D_MSC_VER=1310"
"-D_MSC_EXTENSIONS"
"-D_WIN32"
"-D_M_IX86"
"-D_WCHAR_T_DEFINED"
"-DPASCAL="
"-DRPC_ENTRY="
"-DSHSTDAPI=HRESULT"
"-D_INTEGRAL_MAX_BITS=64"
"-D__uuidof(x)=IID()"
"-DSHSTDAPI_(x)=x"
"-D__w64="
"-D__int64=long long"
"-iwrapperC:/Program
Files/GCC_XML/share/gccxml-0.6/Vc71/Include"
"-iwrapperC:/Program
Files/GCC_XML/share/gccxml-0.6/Vc71/PlatformSDK"
"-IC:/Program Files/Microsoft Visual Studio .NET
2003/Vc7/Include"
"-IC:/Program Files/Microsoft Visual Studio .NET
2003/Vc7/PlatformSDK/Include"
The errors are these:
In file included from
c:/boost/include/boost-1_32/boost/random/detail/const_mod.hpp:22,
from
c:/boost/include/boost-1_32/boost/random/linear_congruential.hpp:25,
from
c:/boost/include/boost-1_32/boost/random.hpp:36,
from test.cpp:2:
c:/boost/include/boost-1_32/boost/integer_traits.hpp:159:
error: integer
constant is too large for "long" type
c:/boost/include/boost-1_32/boost/integer_traits.hpp:159:
error: integer
constant is too large for "long" type
c:/boost/include/boost-1_32/boost/integer_traits.hpp:165:
error: integer
constant is too large for "long" type
In file included from
c:/boost/include/boost-1_32/boost/random/linear_congruential.hpp:25,
from
c:/boost/include/boost-1_32/boost/random.hpp:36,
from test.cpp:2:
c:/boost/include/boost-1_32/boost/random/detail/const_mod.hpp:
In static member
function `static IntType
boost::random::const_mod<IntType,
m>::invert_euclidian(IntType)':
c:/boost/include/boost-1_32/boost/random/detail/const_mod.hpp:152:
error: conflicting
types for `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)(boost::integer_traits<T>::is_signed)>)>
boost_static_assert_typedef___COUNTER__'
c:/boost/include/boost-1_32/boost/random/detail/const_mod.hpp:148:
error: previous
declaration as `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)((m > 0))>)>
boost_static_assert_typedef___COUNTER__'
In file included from
c:/boost/include/boost-1_32/boost/random.hpp:36,
from test.cpp:2:
c:/boost/include/boost-1_32/boost/random/linear_congruential.hpp:
In
constructor
`boost::random::linear_congruential<IntType, a, c, m,
val>::linear_congruential(IntType) [with IntType =
uint64_t, IntType a =
5deece66d, IntType c = 11, IntType m =
1000000000000, IntType val = 0]':
c:/boost/include/boost-1_32/boost/random/linear_congruential.hpp:211:
instantiated from here
c:/boost/include/boost-1_32/boost/random/linear_congruential.hpp:56:
error: invalid
conversion from `void*' to `const char*'
c:/boost/include/boost-1_32/boost/random/linear_congruential.hpp:
In member
function `void
boost::random::linear_congruential<IntType, a, c, m,
val>::seed(IntType) [with IntType = uint64_t,
IntType a = 5deece66d, IntType
c = 11, IntType m = 1000000000000, IntType val =
0]':
c:/boost/include/boost-1_32/boost/random/linear_congruential.hpp:215:
instantiated from here
c:/boost/include/boost-1_32/boost/random/linear_congruential.hpp:73:
error: invalid
conversion from `void*' to `const char*'
In file included from
c:/boost/include/boost-1_32/boost/random.hpp:38,
from test.cpp:2:
c:/boost/include/boost-1_32/boost/random/inversive_congruential.hpp:
In
constructor
`boost::random::inversive_congruential<IntType, a, b,
p,
val>::inversive_congruential(IntType)':
c:/boost/include/boost-1_32/boost/random/inversive_congruential.hpp:51:
error: conflicting
types for `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)((p > 1))>)>
boost_static_assert_typedef___COUNTER__'
c:/boost/include/boost-1_32/boost/random/inversive_congruential.hpp:50:
error: previous
declaration as `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)((b >=
0))>)>
boost_static_assert_typedef___COUNTER__'
c:/boost/include/boost-1_32/boost/random/inversive_congruential.hpp:52:
error: conflicting
types for `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)((a >=
1))>)>
boost_static_assert_typedef___COUNTER__'
c:/boost/include/boost-1_32/boost/random/inversive_congruential.hpp:51:
error: previous
declaration as `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)((b >=
0))>)>
boost_static_assert_typedef___COUNTER__'
In file included from
c:/boost/include/boost-1_32/boost/random/ranlux.hpp:20,
from
c:/boost/include/boost-1_32/boost/random.hpp:42,
from test.cpp:2:
c:/boost/include/boost-1_32/boost/random/subtract_with_carry.hpp:
In
constructor
`boost::random::subtract_with_carry<IntType, m, s, r,
val>::subtract_with_carry()':
c:/boost/include/boost-1_32/boost/random/subtract_with_carry.hpp:75:
error: conflicting
types for `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)(std::numeric_limits<_Ty>::is_integer)>)>
boost_static_assert_typedef___COUNTER__'
c:/boost/include/boost-1_32/boost/random/subtract_with_carry.hpp:74:
error: previous
declaration as `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)(std::numeric_limits<_Ty>::is_signed)>)>
boost_static_assert_typedef___COUNTER__'
In file included from
c:/boost/include/boost-1_32/boost/random.hpp:43,
from test.cpp:2:
c:/boost/include/boost-1_32/boost/random/linear_feedback_shift.hpp:
In
constructor
`boost::random::linear_feedback_shift<UIntType, w, k,
q, s,
val>::linear_feedback_shift(UIntType)':
c:/boost/include/boost-1_32/boost/random/linear_feedback_shift.hpp:56:
error: conflicting
types for `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)((!std::numeric_limits<_Ty>::is_signed))>)>
boost_static_assert_typedef___COUNTER__'
c:/boost/include/boost-1_32/boost/random/linear_feedback_shift.hpp:55:
error: previous
declaration as `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)(std::numeric_limits<_Ty>::is_integer)>)>
boost_static_assert_typedef___COUNTER__'
c:/boost/include/boost-1_32/boost/random/linear_feedback_shift.hpp:
In
constructor
`boost::random::linear_feedback_shift<UIntType, w, k,
q, s,
val>::linear_feedback_shift(It&, It)':
c:/boost/include/boost-1_32/boost/random/linear_feedback_shift.hpp:70:
error: conflicting
types for `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)((!std::numeric_limits<_Ty>::is_signed))>)>
boost_static_assert_typedef___COUNTER__'
c:/boost/include/boost-1_32/boost/random/linear_feedback_shift.hpp:69:
error: previous
declaration as `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)(std::numeric_limits<_Ty>::is_integer)>)>
boost_static_assert_typedef___COUNTER__'
In file included from
c:/boost/include/boost-1_32/boost/random.hpp:44,
from test.cpp:2:
c:/boost/include/boost-1_32/boost/random/xor_combine.hpp:
In member function `
typename URNG1::result_type
boost::random::xor_combine<URNG1, s1, URNG2, s2,
val>::operator()()':
c:/boost/include/boost-1_32/boost/random/xor_combine.hpp:68:
error: conflicting
types for `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)(std::numeric_limits<typename
URNG2::result_type>::is_integer)>)>
boost_static_assert_typedef___COUNTER__'
c:/boost/include/boost-1_32/boost/random/xor_combine.hpp:67:
error: previous
declaration as `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)(std::numeric_limits<typename
UniformRandomNumberGenerator::result_type>::is_integer)>)>
boost_static_assert_typedef___COUNTER__'
c:/boost/include/boost-1_32/boost/random/xor_combine.hpp:69:
error: conflicting
types for `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)((std::numeric_limits<typename
UniformRandomNumberGenerator::result_type>::digits
>=
std::numeric_limits<typename
URNG2::result_type>::digits))>)>
boost_static_assert_typedef___COUNTER__'
c:/boost/include/boost-1_32/boost/random/xor_combine.hpp:68:
error: previous
declaration as `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)(std::numeric_limits<typename
UniformRandomNumberGenerator::result_type>::is_integer)>)>
boost_static_assert_typedef___COUNTER__'
In file included from
c:/boost/include/boost-1_32/boost/random/uniform_int.hpp:26,
from
c:/boost/include/boost-1_32/boost/random/random_number_generator.hpp:22,
from
c:/boost/include/boost-1_32/boost/random.hpp:53,
from test.cpp:2:
c:/boost/include/boost-1_32/boost/random/uniform_smallint.hpp:
In constructor `
boost::detail::uniform_smallint_float<UniformRandomNumberGenerator,
IntType>::uniform_smallint_float(UniformRandomNumberGenerator&,
IntType,
IntType)':
c:/boost/include/boost-1_32/boost/random/uniform_smallint.hpp:122:
error: conflicting
types for `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)((!std::numeric_limits<typename
UniformRandomNumberGenerator::result_type>::is_integer))>)>
boost_static_assert_typedef___COUNTER__'
c:/boost/include/boost-1_32/boost/random/uniform_smallint.hpp:121:
error: previous
declaration as `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)(std::numeric_limits<RealType>::is_integer)>)>
boost_static_assert_typedef___COUNTER__'
In file included from
c:/boost/include/boost-1_32/boost/random.hpp:67,
from test.cpp:2:
c:/boost/include/boost-1_32/boost/random/poisson_distribution.hpp:
In
constructor `boost::poisson_distribution<IntType,
RealType>::poisson_distribution(const RealType&)':
c:/boost/include/boost-1_32/boost/random/poisson_distribution.hpp:39:
error: conflicting
types for `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)((!std::numeric_limits<RealType>::is_integer))>)>
boost_static_assert_typedef___COUNTER__'
c:/boost/include/boost-1_32/boost/random/poisson_distribution.hpp:38:
error: previous
declaration as `typedef struct
boost::static_assert_test<sizeof
(boost::STATIC_ASSERTION_FAILURE<(bool)(std::numeric_limits<_Ty>::is_integer)>)>
boost_static_assert_typedef___COUNTER__'
c:/boost/include/boost-1_32/boost/random/linear_congruential.hpp:
In
constructor
`boost::random::linear_congruential<IntType, a, c, m,
val>::linear_congruential(IntType) [with IntType =
uint32_t, IntType a =
69069, IntType c = 0, IntType m = 0, IntType val =
0]':
c:/boost/include/boost-1_32/boost/random/mersenne_twister.hpp:81:
instantiated from `void
boost::random::mersenne_twister<UIntType, w, n, m, r,
a, u, s, b, t, c, l, val>::seed(UIntType) [with
UIntType = uint32_t, int w = 32, int n = 624, int m =
397, int r = 31, UIntType a = 09908b0df, int u = 11,
int s = 7, UIntType b = 09d2c5680, int t = 15,
UIntType c = 0efc60000, int l = 18, UIntType val =
0c77666de]'
c:/boost/include/boost-1_32/boost/random/mersenne_twister.hpp:71:
instantiated from `void
boost::random::mersenne_twister<UIntType, w, n, m, r,
a, u, s, b, t, c, l, val>::seed() [with UIntType =
uint32_t, int w = 32, int n = 624, int m = 397, int r
= 31, UIntType a = 09908b0df, int u = 11, int s = 7,
UIntType b = 09d2c5680, int t = 15, UIntType c =
0efc60000, int l = 18, UIntType val = 0c77666de]'
c:/boost/include/boost-1_32/boost/random/mersenne_twister.hpp:55:
instantiated from
`boost::random::mersenne_twister<UIntType, w, n, m, r,
a, u, s, b, t, c, l, val>::mersenne_twister() [with
UIntType = uint32_t, int w = 32, int n = 624, int m =
397, int r = 31, UIntType a = 09908b0df, int u = 11,
int s = 7, UIntType b = 09d2c5680, int t = 15,
UIntType c = 0efc60000, int l = 18, UIntType val =
0c77666de]'
test.cpp:41: instantiated from here
c:/boost/include/boost-1_32/boost/random/linear_congruential.hpp:56:
error: invalid
conversion from `void*' to `const char*'
I don't what's wrong since the works fine in VC7.1
The only thing I suspect is that because gccxml may be
based on another compiler the #defines specified when
I built boost for vc71 do not match the gccxml
compiler.
Has anybody seen this before?
How can I resolve this?
Thanks,
Alexis
Programming Tutorial:
In Python: To do this, do this
In Perl: To do this, do this or this or this or this...
In C: To do this, do this, but be careful
In C++: To do this, do this, but don't do this, be careful of this, watch out for this, and whatever you do, don't do this
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
More information about the gccxml
mailing list