Jump to page: 1 2
Thread overview
STL & namespaces?
Feb 06, 2002
Peter Dickinson
Feb 06, 2002
Walter
Jul 29, 2003
Olivier Mascia
Jul 29, 2003
Walter
Jul 30, 2003
Olivier Mascia
Jul 30, 2003
Olivier Mascia
Jul 30, 2003
Olivier Mascia
Jul 30, 2003
Olivier Mascia
Jul 30, 2003
Olivier Mascia
Jul 31, 2003
Walter
Jul 30, 2003
Olivier Mascia
Jul 30, 2003
Olivier Mascia
Jul 31, 2003
Walter
Jul 30, 2003
Matthew Wilson
February 06, 2002
I am new to Digital Mars C++, and I'm trying it out with some code that expects the STL to be in the std namespace (I'm trying the regression test from the Boost libraries -  www.boost.org). I noticed in stl_config.h, that the DM compiler does not define __STL_HAS_NAMESPACES, and when I try to use it, I get various compilation errors. Is there something I need to do to work with the STL in DM? Or is there a workaround for code that wants the STL to be in the std namespace?

Thanks,

Pete Dickinson


February 06, 2002
DMC++ supports namespaces as of the ARM, but not as of the latest STL. It will eventually support it, but not yet. Sorry. -Walter

"Peter Dickinson" <petedgr8@yahoo.com> wrote in message news:a3qa03$1tkk$1@digitaldaemon.com...
> I am new to Digital Mars C++, and I'm trying it out with some code that expects the STL to be in the std namespace (I'm trying the regression test from the Boost libraries -  www.boost.org). I noticed in stl_config.h,
that
> the DM compiler does not define __STL_HAS_NAMESPACES, and when I try to
use
> it, I get various compilation errors. Is there something I need to do to work with the STL in DM? Or is there a workaround for code that wants the STL to be in the std namespace?
>
> Thanks,
>
> Pete Dickinson
>
>


July 29, 2003
In article <a3qqj5$250g$1@digitaldaemon.com>, Walter says...

>> the DM compiler does not define __STL_HAS_NAMESPACES
>
>DMC++ supports namespaces as of the ARM, but not as of the latest STL. It will eventually support it, but not yet. Sorry. -Walter

Taking into account the large number of programs using STL through std:: prefix a bit everywhere like in the following :

#include <string>
int main(int, char*[])
{
std::string a;
..
}

doesn't this look like a very *serious* limitation ?
Short of editing thousands of 'std::' prefixes how would you recommend porting
existing code using STL to DMC ?

Thanks for suggestions,
-- 
Olivier Mascia


July 29, 2003
"Olivier Mascia" <Olivier_member@pathlink.com> wrote in message news:bg6snj$2l81$1@digitaldaemon.com...
> In article <a3qqj5$250g$1@digitaldaemon.com>, Walter says...
>
> >> the DM compiler does not define __STL_HAS_NAMESPACES
> >
> >DMC++ supports namespaces as of the ARM, but not as of the latest STL. It will eventually support it, but not yet. Sorry. -Walter
>
> Taking into account the large number of programs using STL through std::
prefix
> a bit everywhere like in the following :
>
> #include <string>
> int main(int, char*[])
> {
> std::string a;
> ..
> }
>
> doesn't this look like a very *serious* limitation ?
> Short of editing thousands of 'std::' prefixes how would you recommend
porting
> existing code using STL to DMC ?

No problem, since DMC++ now supports namespaces. The message you replied to is about a year and a half old. -Walter


July 30, 2003
You can include the STLSoft root header stlsoft.h, and qualify with
stlsoft_ns_using_std() or stlsoft_ns_qual_std(), as in

#include <string>
int main(int, char*[])
{
    stlsoft_ns_qual_std(string) a;
    stlsoft_ns_qual_std(string) b;
    ..
}

or

#include <string>
int main(int, char*[])
{
    stlsoft_ns_using_std(string)

    string a;
    string b;
    ..
}

or

#include <string>
int main(int, char*[])
{
    typedef stlsoft_ns_qual_std(string)    string_t;

    string_t a;
    string_t b;
    ..
}



It's ugly (it's supposed to be!), but it is eminently portable between all
the STLSoft supported compilers (http://stlsoft.org/compilers.html)

"Olivier Mascia" <Olivier_member@pathlink.com> wrote in message news:bg6snj$2l81$1@digitaldaemon.com...
> In article <a3qqj5$250g$1@digitaldaemon.com>, Walter says...
>
> >> the DM compiler does not define __STL_HAS_NAMESPACES
> >
> >DMC++ supports namespaces as of the ARM, but not as of the latest STL. It will eventually support it, but not yet. Sorry. -Walter
>
> Taking into account the large number of programs using STL through std::
prefix
> a bit everywhere like in the following :
>
> #include <string>
> int main(int, char*[])
> {
> std::string a;
> ..
> }
>
> doesn't this look like a very *serious* limitation ?
> Short of editing thousands of 'std::' prefixes how would you recommend
porting
> existing code using STL to DMC ?
>
> Thanks for suggestions,
> -- 
> Olivier Mascia
>
>


July 30, 2003
Walter wrote:

>>#include <string>
>>int main(int, char*[])
>>{
>>std::string a;
>>..
>>}
>
> No problem, since DMC++ now supports namespaces. The message you replied to
> is about a year and a half old. -Walter

Walter, I understood the message was *old*, but it was very actual to my findings. I cannot find the way to set the thing up to successfully compile a piece of code using STL which cross-compile successfully between GCC 3.2 (on linux, mingw and cygwin), Borland Builder 6, Microsoft Visual Studio.

Without defining __STL_HAS_NAMESPACES I always end-up with 'string' not defined in std namespace.
And with __STL_HAS_NAMESPACES I get other compile errors (the first one while including <vector>.

Should I better use the stl provided with dmc or add STLport ?
Or whatever ?

I'm currently testing using the free downloadable compiler but will buy some CDs if I can get this to compile (and run).

Thanks,
-- 
Olivier Mascia

July 30, 2003
Olivier Mascia wrote:

> Without defining __STL_HAS_NAMESPACES I always end-up with 'string' not defined in std namespace.
> And with __STL_HAS_NAMESPACES I get other compile errors (the first one while including <vector>.

More precisely, I see that in stl/stl_config.h the settings for DMC are still defined as this :

# if defined(__DMC__) /* Digital Mars C++ 8.20 and later, www.digitalmars.com */
#   define __STL_NO_DRAND48
#   if __INTSIZE == 4
#     define __STL_LONG_LONG
#   endif
#   define __STL_NO_EXCEPTION_HEADER
#   define __STL_NO_BAD_ALLOC
#   ifdef _CPPUNWIND
#     define __STL_USE_EXCEPTIONS
#   endif
#   ifdef _MT
#     define __STL_WIN32THREADS
#   endif
#     define NOMINMAX
#     undef min
#     undef max
# endif

This does not properly place the STL things in std as should be done by default.

Adding there or defining on command-line __STL_HAS_NAMESPACES introduces compilation bugs on some STL includes.

-- 
Olivier Mascia

July 30, 2003
Olivier Mascia wrote:

> Without defining __STL_HAS_NAMESPACES I always end-up with 'string' not
> defined in std namespace.
> And with __STL_HAS_NAMESPACES I get other compile errors (the first one
> while including <vector>.

Walter, see the attached small test code demonstrating my issues.

-- 
Olivier Mascia


July 30, 2003
Olivier Mascia wrote:

> Walter, see the attached small test code demonstrating my issues.

I have now installed STLPort as available from digitalmars web site.
I have much better results with it.
My test code compiles.

Though on the real project I want to compile, it fails with:

	Internal error: ph 1111

on the very first unit I compile.
What is this error related with ?
So that I can try to write a smaller test case to demonstrate it.

Side question : on which group should I report things like an Internal error ?

Thanks,
-- 
Olivier Mascia

July 30, 2003
Yet another bug, this one produces a crash of the compiler.
There is a workaround though.
Walter, see the attached small test code demonstrating it.

-- 
Olivier Mascia


« First   ‹ Prev
1 2