www.digitalmars.com         C & C++   DMDScript  

c++ - dm832c.zip + stlport

reply "Mike Comperchio" <mcmprch adelphia.net> writes:
I downloaded and installed the 832 compiler, and then the stlport from the
DM website. Now I can't compilet what was a working build...:(


sc -c -mn -5 -a8 -Ae -g -c -I..\include -I$c:\sleepycat\dbinc -mn -5 -a8 -Ae
 -g -DDEBUG -DFOX_BIGENDIAN=0 -DWIN32 -D_WINDOWS -DHAVE_OPENGL MyLife.cpp
C:\DM\BIN\..\include\stl/_alloc.h(134) : Error: undefined identifier
'__stl_new'
C:\DM\BIN\..\include\stl/_alloc.h(135) : Error: undefined identifier
'__stl_delete'
typedef fpos<mbstate_t> streampos;
                     ^
C:\DM\BIN\..\include\stl/char_traits.h(116) : Error: type-argument expected
for parameter '_StateT' of template 'fpos'
typedef fpos<mbstate_t> wstreampos;
                     ^
C:\DM\BIN\..\include\stl/char_traits.h(117) : Error: type-argument expected
for parameter '_StateT' of template 'fpos'
  const string *pdbTasks;
               ^
mylife.h(50) : Error: ';' expected following declaration of struct member
Fatal error: too many errors
--- errorlevel 1

Thanks
Michael
Jan 09 2003
parent reply "Walter" <walter digitalmars.com> writes:
Try adding:
    using namespace::std;
to your source. Also, to use STLport you'll need a -I\dm\stlport, what
you're using here is the SGI STL.

"Mike Comperchio" <mcmprch adelphia.net> wrote in message
news:avkcfv$1u22$1 digitaldaemon.com...
 I downloaded and installed the 832 compiler, and then the stlport from the
 DM website. Now I can't compilet what was a working build...:(

  -g -DDEBUG -DFOX_BIGENDIAN=0 -DWIN32 -D_WINDOWS -DHAVE_OPENGL MyLife.cpp
 C:\DM\BIN\..\include\stl/_alloc.h(134) : Error: undefined identifier
 '__stl_new'
 C:\DM\BIN\..\include\stl/_alloc.h(135) : Error: undefined identifier
 '__stl_delete'
 typedef fpos<mbstate_t> streampos;
                      ^
 C:\DM\BIN\..\include\stl/char_traits.h(116) : Error: type-argument

 for parameter '_StateT' of template 'fpos'
 typedef fpos<mbstate_t> wstreampos;
                      ^
 C:\DM\BIN\..\include\stl/char_traits.h(117) : Error: type-argument

 for parameter '_StateT' of template 'fpos'
   const string *pdbTasks;
                ^
 mylife.h(50) : Error: ';' expected following declaration of struct member
 Fatal error: too many errors
 --- errorlevel 1

 Thanks
 Michael

Jan 09 2003
parent reply "Mike Comperchio" <mcmprch adelphia.net> writes:
that got me further, I still have a question...

this code:

template <class _Key, class _Tp, __DFL_TMPL_PARAM(_Compare, less<_Key> ),
          _STLP_DEFAULT_PAIR_ALLOCATOR_SELECT(const _Key, _Tp) >
class map {
public:

// typedefs:

  typedef _Key                  key_type;
  typedef _Tp                   data_type;
  typedef _Tp                   mapped_type;
  typedef pair<const _Key, _Tp> value_type;
  typedef _Compare              key_compare;

  class value_compare
    : public binary_function<value_type, value_type, bool> {
  friend class map<_Key,_Tp,_Compare,_Alloc>;
  protected :
    _Compare _M_comp;
    value_compare(_Compare __c) : _M_comp(__c) {}
  public:
    bool operator()(const value_type& __x, const value_type& __y) const {
      return _M_comp(__x.first, __y.first);
    }
  };

produces:
sc
D:\MYSQL++\EXAMPLES\resetdb.cpp -Ae -mn -C -WA -S -3 -a8 -c -gf -D_CONSOLE=1
 -Ic:\dm\stlport -Ic:\mysql\include -Id:\mysql++\include -oD:\MYSQL++\EXAMPL
ES\resetdb.obj

Error: c:\dm\stlport\stl/_map.h(63): need explicit cast for function
parameter 1 to get
c:\dm\stlport\stl/_map.h(63): from: const Type_info*const
c:\dm\stlport\stl/_map.h(63): to  : Type_info*

"Walter" <walter digitalmars.com> wrote in message
news:avkd9e$1ug2$1 digitaldaemon.com...
 Try adding:
     using namespace::std;
 to your source. Also, to use STLport you'll need a -I\dm\stlport, what
 you're using here is the SGI STL.

 "Mike Comperchio" <mcmprch adelphia.net> wrote in message
 news:avkcfv$1u22$1 digitaldaemon.com...
 I downloaded and installed the 832 compiler, and then the stlport from


 DM website. Now I can't compilet what was a working build...:(


  -g -DDEBUG -DFOX_BIGENDIAN=0 -DWIN32 -D_WINDOWS -DHAVE_OPENGL


 C:\DM\BIN\..\include\stl/_alloc.h(134) : Error: undefined identifier
 '__stl_new'
 C:\DM\BIN\..\include\stl/_alloc.h(135) : Error: undefined identifier
 '__stl_delete'
 typedef fpos<mbstate_t> streampos;
                      ^
 C:\DM\BIN\..\include\stl/char_traits.h(116) : Error: type-argument

 for parameter '_StateT' of template 'fpos'
 typedef fpos<mbstate_t> wstreampos;
                      ^
 C:\DM\BIN\..\include\stl/char_traits.h(117) : Error: type-argument

 for parameter '_StateT' of template 'fpos'
   const string *pdbTasks;
                ^
 mylife.h(50) : Error: ';' expected following declaration of struct


 Fatal error: too many errors
 --- errorlevel 1

 Thanks
 Michael


Jan 09 2003
parent reply "Walter" <walter digitalmars.com> writes:
I don't know. STL has lots of dependencies on things, and without a complete
example, there's not much I can suggest except to try whittling down the
example to the smallest one that will reproduce it. Also, there is no
\dm\include\stl directory on the official release.

"Mike Comperchio" <mcmprch adelphia.net> wrote in message
news:avkge3$20in$1 digitaldaemon.com...
 that got me further, I still have a question...

 this code:

 template <class _Key, class _Tp, __DFL_TMPL_PARAM(_Compare, less<_Key> ),
           _STLP_DEFAULT_PAIR_ALLOCATOR_SELECT(const _Key, _Tp) >
 class map {
 public:

 // typedefs:

   typedef _Key                  key_type;
   typedef _Tp                   data_type;
   typedef _Tp                   mapped_type;
   typedef pair<const _Key, _Tp> value_type;
   typedef _Compare              key_compare;

   class value_compare
     : public binary_function<value_type, value_type, bool> {
   friend class map<_Key,_Tp,_Compare,_Alloc>;
   protected :
     _Compare _M_comp;
     value_compare(_Compare __c) : _M_comp(__c) {}
   public:
     bool operator()(const value_type& __x, const value_type& __y) const {
       return _M_comp(__x.first, __y.first);
     }
   };

 produces:
 sc

  -Ic:\dm\stlport -Ic:\mysql\include -Id:\mysql++\include -oD:\MYSQL++\EXAM

 ES\resetdb.obj

 Error: c:\dm\stlport\stl/_map.h(63): need explicit cast for function
 parameter 1 to get
 c:\dm\stlport\stl/_map.h(63): from: const Type_info*const
 c:\dm\stlport\stl/_map.h(63): to  : Type_info*

 "Walter" <walter digitalmars.com> wrote in message
 news:avkd9e$1ug2$1 digitaldaemon.com...
 Try adding:
     using namespace::std;
 to your source. Also, to use STLport you'll need a -I\dm\stlport, what
 you're using here is the SGI STL.

 "Mike Comperchio" <mcmprch adelphia.net> wrote in message
 news:avkcfv$1u22$1 digitaldaemon.com...
 I downloaded and installed the 832 compiler, and then the stlport from


 DM website. Now I can't compilet what was a working build...:(



  -g -DDEBUG -DFOX_BIGENDIAN=0 -DWIN32 -D_WINDOWS -DHAVE_OPENGL


 C:\DM\BIN\..\include\stl/_alloc.h(134) : Error: undefined identifier
 '__stl_new'
 C:\DM\BIN\..\include\stl/_alloc.h(135) : Error: undefined identifier
 '__stl_delete'
 typedef fpos<mbstate_t> streampos;
                      ^
 C:\DM\BIN\..\include\stl/char_traits.h(116) : Error: type-argument

 for parameter '_StateT' of template 'fpos'
 typedef fpos<mbstate_t> wstreampos;
                      ^
 C:\DM\BIN\..\include\stl/char_traits.h(117) : Error: type-argument

 for parameter '_StateT' of template 'fpos'
   const string *pdbTasks;
                ^
 mylife.h(50) : Error: ';' expected following declaration of struct


 Fatal error: too many errors
 --- errorlevel 1

 Thanks
 Michael



Jan 09 2003
parent reply "Mike Comperchio" <mcmprch adelphia.net> writes:
Oh well...I'll putz with it a while. I really, really, really, really want
to use DM! and not MSnerd

 Thanks for quick response...have a great day...

Michael

"Walter" <walter digitalmars.com> wrote in message
news:avkik4$21tv$1 digitaldaemon.c
om...
 I don't know. STL has lots of dependencies on things, and without a

 example, there's not much I can suggest except to try whittling down the
 example to the smallest one that will reproduce it. Also, there is no
 \dm\include\stl directory on the official release.

 "Mike Comperchio" <mcmprch adelphia.net> wrote in message
 news:avkge3$20in$1 digitaldaemon.com...
 that got me further, I still have a question...

 this code:

 template <class _Key, class _Tp, __DFL_TMPL_PARAM(_Compare,


           _STLP_DEFAULT_PAIR_ALLOCATOR_SELECT(const _Key, _Tp) >
 class map {
 public:

 // typedefs:

   typedef _Key                  key_type;
   typedef _Tp                   data_type;
   typedef _Tp                   mapped_type;
   typedef pair<const _Key, _Tp> value_type;
   typedef _Compare              key_compare;

   class value_compare
     : public binary_function<value_type, value_type, bool> {
   friend class map<_Key,_Tp,_Compare,_Alloc>;
   protected :
     _Compare _M_comp;
     value_compare(_Compare __c) : _M_comp(__c) {}
   public:
     bool operator()(const value_type& __x, const value_type& __y) const


       return _M_comp(__x.first, __y.first);
     }
   };

 produces:
 sc


  -Ic:\dm\stlport -Ic:\mysql\include -Id:\mysql++\include -oD:\MYSQL++\EXAM
 PL
 ES\resetdb.obj

 Error: c:\dm\stlport\stl/_map.h(63): need explicit cast for function
 parameter 1 to get
 c:\dm\stlport\stl/_map.h(63): from: const Type_info*const
 c:\dm\stlport\stl/_map.h(63): to  : Type_info*

 "Walter" <walter digitalmars.com> wrote in message
 news:avkd9e$1ug2$1 digitaldaemon.com...
 Try adding:
     using namespace::std;
 to your source. Also, to use STLport you'll need a -I\dm\stlport, what
 you're using here is the SGI STL.

 "Mike Comperchio" <mcmprch adelphia.net> wrote in message
 news:avkcfv$1u22$1 digitaldaemon.com...
 I downloaded and installed the 832 compiler, and then the stlport




 the
 DM website. Now I can't compilet what was a working build...:(




  -g -DDEBUG -DFOX_BIGENDIAN=0 -DWIN32 -D_WINDOWS -DHAVE_OPENGL


 C:\DM\BIN\..\include\stl/_alloc.h(134) : Error: undefined identifier
 '__stl_new'
 C:\DM\BIN\..\include\stl/_alloc.h(135) : Error: undefined identifier
 '__stl_delete'
 typedef fpos<mbstate_t> streampos;
                      ^
 C:\DM\BIN\..\include\stl/char_traits.h(116) : Error: type-argument

 for parameter '_StateT' of template 'fpos'
 typedef fpos<mbstate_t> wstreampos;
                      ^
 C:\DM\BIN\..\include\stl/char_traits.h(117) : Error: type-argument

 for parameter '_StateT' of template 'fpos'
   const string *pdbTasks;
                ^
 mylife.h(50) : Error: ';' expected following declaration of struct


 Fatal error: too many errors
 --- errorlevel 1

 Thanks
 Michael




Jan 09 2003
parent reply Richard <fractal clark.net> writes:
The code snippet below is the header from the STL map container, and will not
help diagnose the problem.. in your case, the problem is a faulty "less"
predicate:

struct Test {
Test() { }
~Test() { }
int i; // non trivial
};

struct less {
bool operator()(Test& t, Test& r) { return true; }
};

std::map<Test, int, less> m;

void main() { }

The code above generates an error in line 63 of _map.h because it expects the
"less" predicate to define an operator() like:

bool operator()(const Test& t, const Test& r) { return true; }

I am sure that others will be willing to help you if you provide more details of
source code that *uses* the compiler or *uses* STL.

Hope this helps get you moving along,

Richard

 template <class _Key, class _Tp, __DFL_TMPL_PARAM(_Compare,


           _STLP_DEFAULT_PAIR_ALLOCATOR_SELECT(const _Key, _Tp) >
 class map {



Jan 09 2003
parent "Walter" <walter digitalmars.com> writes:
"Richard" <fractal clark.net> wrote in message
news:avkn3m$24qs$1 digitaldaemon.com...
 The code above generates an error in line 63 of _map.h because it expects

 "less" predicate to define an operator() like:

 bool operator()(const Test& t, const Test& r) { return true; }

Thanks for figuring this out. One of the major weaknesses of STL is trying to figure out what is wrong when things go wrong with it.
Jan 09 2003