www.digitalmars.com         C & C++   DMDScript  

c++.stl.port - Something wrong

reply vvmyx <vvmyx_member pathlink.com> writes:
Dear Walter!
Thanks you for the best in the world the compiler C++!
But some examples (ver 8.32 with stlport):
===================== Example 1 (Win32)=====================:
#include <bitset>
#include <string>
#include <map>
#include <iostream>

using namespace std;

void main(void)
{
map<char* , int> mymap;
mymap["First"] = 1;
mymap["Second"] = 2;

std::bitset < 32 > b = 0x12121212UL;
std::cout << "Hello" << std::endl;
std::cout << mymap["First"] << std::endl ;
std::cout << mymap["Second"] << std::endl;
std::cout << b << std::endl;
std::cout << "END" << std::endl;
}
compile with: sc hello.cpp
All Ok
=============  Example 2 (same source)  =====================:
D:\example>sc -msd hello.cpp
using _STLP_VENDOR_CSTD::fgetwc;
^
e:\dm832\bin\..\stlport\stlport\cwchar(199) : Error: undefined dentifier
'fgetwc'
using _STLP_VENDOR_CSTD::fgetws;
^
e:\dm832\bin\..\stlport\stlport\cwchar(200) : Error: undefined dentifier 'fgetw
s'
.........  SKIP ...............
Fatal error: too many errors
--- errorlevel 1

=============  Example 3 (same source)  =====================:
#include <bitset>
#include <string>
#include <map>
#include <iostream>
using namespace std;
void main(void)
{
map<char* , int> mymap;
mymap["First"] = 1;
mymap["Second"] = 2;

std::bitset < 32 > b = 0x12121212UL;
std::cout << "Hello" << std::endl;
std::cout << mymap["First"] << std::endl ;
std::cout << mymap["Second"] << std::endl;
std::cout << b << std::endl;
std::cout << "END" << std::endl;
}

+ in stl_dm.h:

#define _STLP_NO_NAMESPACES
sc -msd hello.cpp
using namespace std;
^
hello.cpp(8) : Error: identifier expected
mymap["First"] = 1;
^
hello.cpp(13) : Error: integral expression expected
mymap["Second"] = 2;
^
hello.cpp(14) : Error: integral expression expected
std::cout << "Hello" << std::endl;
^
hello.cpp(17) : Error: '_STLP_cout' previously declared as something else
It was declared as: basic_ostream<char ,char_traits<char > >
It is now declared: int
std::cout << mymap["First"] << std::endl ;
^
hello.cpp(18) : Error: '_STLP_cout' previously declared as something else
Fatal error: too many errors
--- errorlevel 1

Ok, change source:
=============  Example 4 =====================:
#include <bitset>
#include <string>
#include <map>
#include <iostream>
//using namespace std;
void main(void)
{
std::map<char* , int> mymap;
mymap["First"] = 1;
mymap["Second"] = 2;

std::bitset < 32 > b = 0x12121212UL;
std::cout << "Hello" << std::endl;
std::cout << mymap["First"] << std::endl ;
std::cout << mymap["Second"] << std::endl;
std::cout << b << std::endl;
std::cout << "END" << std::endl;
}

+ in stl_dm.h:

#define _STLP_NO_NAMESPACES

example>sc -msd hello.cpp
link hello/noi;
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

hello.obj(hello)
Error 42: Symbol Undefined ?_M_throw_failure ios_base  IACXXZ (void pascal ios_
base::_M_throw_failure(void ))
hello.obj(hello)
Error 42: Symbol Undefined ?__stl_throw_length_error  YAXPBD Z (void cdecl __st
l_throw_length_error(char const *))
hello.obj(hello)
Error 42: Symbol Undefined ?_M_increment ?$_Rb_global _N  SAPAU_Rb_tree_node_ba
se  PAU2  Z
hello.obj(hello)
Error 42: Symbol Undefined ?_M_decrement ?$_Rb_global _N  SAPAU_Rb_tree_node_ba
se  PAU2  Z
hello.obj(hello)
Error 42: Symbol Undefined ?_Rebalance ?$_Rb_global _N  SAXPAU_Rb_tree_node_bas
e  AAPAU2  Z
hello.obj(hello)
Error 42: Symbol Undefined ??0locale  QAC ABV0  Z (pascal locale::locale(locale
const &))
hello.obj(hello)
Error 42: Symbol Undefined ??1locale  QAC XZ (pascal locale::~locale(void ))
hello.obj(hello)
Error 42: Symbol Undefined ?_M_use_facet locale  QBCPAVfacet 1 ABVid 1  Z (face
t::locale *pascal locale::_M_use_facet(id::locale const &)const )
hello.obj(hello)
Error 42: Symbol Undefined ??1ios_base  UAC XZ (pascal ios_base::~ios_base(void
))
hello.obj(hello)
Error 42: Symbol Undefined ??0Init ios_base  QAC XZ (pascal ios_base::Init::Ini
t(void ))
hello.obj(hello)
Error 42: Symbol Undefined ??0_Loc_init ios_base  QAC XZ (pascal ios_base::_Loc
_init::_Loc_init(void ))
hello.obj(hello)
Error 42: Symbol Undefined ??1_Loc_init ios_base  QAC XZ (pascal ios_base::_Loc
_init::~_Loc_init(void ))
hello.obj(hello)
Error 42: Symbol Undefined ??1Init ios_base  QAC XZ (pascal ios_base::Init::~In
it(void ))
hello.obj(hello)
Error 42: Symbol Undefined ?_STLP_cout  3V?$basic_ostream DV?$char_traits D    
A (basic_ostream<char ,char_traits<char > > _STLP_cout)
--- errorlevel 14

Ok. add string in stl_dm.h:
=============  Example 5 =====================:

source as above:
example>sc -msd hello.cpp
link hello/noi;
30.01.2003  13:23            31.826 hello.exe  !!!!!!!!!!!!!!!!!
I happy

BUT:
add one string
=============  Example 6 =====================:
#include <sstream>  //<-------  this
#include <bitset>
#include <string>
#include <map>
#include <iostream>
//using namespace std;
void main(void)
{
std::map<char* , int> mymap;
mymap["First"] = 1;
mymap["Second"] = 2;

std::bitset < 32 > b = 0x12121212UL;
std::cout << "Hello" << std::endl;
std::cout << mymap["First"] << std::endl ;
std::cout << mymap["Second"] << std::endl;
std::cout << b << std::endl;
std::cout << "END" << std::endl;
}
example>sc -msd hello.cpp
Fatal error: unable to open input file '../include/sstream'
--- errorlevel 1
:(((((((

next try:
example>sc hello.cpp
Fatal error: unable to open input file '../include/sstream'
--- errorlevel 1
:(((((((

Copy original stl_dm.h to stlport and try again:
example>sc hello.cpp
link hello,,,user32+kernel32/noi;
30.01.2003  13:32           369.180 hello.exe  OOOOOOOOOO!!!!!!!
next
example>sc -msd hello.cpp
Many errors...

With best regards. vvmyx
Jan 30 2003
parent reply Christof Meerwald <cmeerw web.de> writes:
On Thu, 30 Jan 2003 10:30:56 +0000 (UTC), vvmyx wrote:
 But some examples (ver 8.32 with stlport):
Edit stlport\config\stl_dm.h and replace with: (or get the updated STLport patch from http://cmeerw.org/prog/dm/stl.html) [...]
 add one string
=============  Example 6 =====================:
 #include <sstream>  //<-------  this
 example>sc -msd hello.cpp
[...]
 Fatal error: unable to open input file '../include/sstream'
 --- errorlevel 1
DM's iostreams don't implement <sstream> and STLport's iostreams only work on Win32 platforms... bye, Christof -- http://cmeerw.org JID: cmeerw jabber.at mailto cmeerw at web.de ...and what have you contributed to the Net?
Jan 30 2003
parent "James W. Jennnings" <jwjenn mindspring.com> writes:
"Christof Meerwald" <cmeerw web.de> wrote in message
news:b1b7nk$5di$1 digitaldaemon.com...
 On Thu, 30 Jan 2003 10:30:56 +0000 (UTC), vvmyx wrote:
 But some examples (ver 8.32 with stlport):
On Thu, 30 Jan 2003 10:30:56 +0000 (UTC), vvmyx wrote:
 But some examples (ver 8.32 with stlport):
(or get the updated STLport patch from http://cmeerw.org/prog/dm/stl.html)
Christof, I have downloaded your patch to the STL-4.5.3 directory. It arrived as STLport-4.5.3-dm.diff.txt. I deleted the ".txt" and tried the command patch -sp1 <..\STLport-4.5.3-dm.diff I got a "file not found" error. What is my problem? Jim Jennings
Feb 21 2003