Boost logo

Boost Users :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2004-12-10 05:13:50


Mark Helzer wrote:

<snip>

> So it looks like all the code has to use ansi or arm, since I have a LOT
> of stuff compiled in the arm mode, it would be better to build boost
> using the "-sBUILD=<object-model>arm" switch, however now I'm back to
> compile errors:
>
> cxx: Error:
> /adp/local/src/boost_1_32_0/libs/program_options/build/../src/convert.cp
> p, line 62: #434
> a reference of type "wchar_t *&" (not const-qualified) cannot
> be
> initialized with a value of type "wchar_t [32]"
> detected during instantiation of "std::basic_string<charT,
> std::char_traits<charT>, std::allocator<charT>> ...

The problem here is that the name mangling scheme in the arm object model
is limited and cannot express the full scope of ISO C++. That's why we have
chosen to use the ansi object model as the default object model. A small
isolated sample that works around the problem is:

---%<---
#include <iostream>
using namespace std;

template <typename T> void foo(T const &x)
{
   cout << "1" << endl;
}

template <typename T> void foo(T * const &x)
{
   cout << "2" << endl;
}

int main()
{
#ifdef __MODEL_ARM
   foo<char const *>("abc");
#else
   foo("abc");
#endif
   return 0;
}
--->%---

This should get you going if you want to make boost 1.32.0 work with the
arm object model.

Markus


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