www.digitalmars.com         C & C++   DMDScript  

c++.stl - Noob trying to get Hello World to compile in Mars

reply Peter <peter localhost.com> writes:
C:\H1>dmc hello c:\dm\lib\stlp45dms.lib -D_DLL
c:\dm\stlport\stlport\stl/_alloc.h(134) : Error: undefined identifier
'__stl_new'
c:\dm\stlport\stlport\stl/_alloc.h(135) : Error: undefined identifier
'__stl_delete'
class _STLP_CLASS_DECLSPEC __Named_exception : public _STLP_EXCEPTION_BASE {
                                                                           ^
c:\dm\stlport\stlport\stdexcept(56) : Error: identifier expected
--- errorlevel 1

Just trying out a simple hello.cpp program. Would not work in IDE, so tried on 
command line. Followed readme.txt in stlport.

INCLUDE=c:\dm\stlport\stlport; c:\dm\include;
C:\H1>type hello.cpp
#include <iostream>

int main()
{
    std::cout << "Hello World!";
    return 0;
}

Purchased CD version 8.47. Update file already included.
Feb 26 2006
parent Peter <peter localhost.com> writes:
On Sun, 26 Feb 2006 08:23:57 -0500, Peter wrote:

 C:\H1>dmc hello c:\dm\lib\stlp45dms.lib -D_DLL
 c:\dm\stlport\stlport\stl/_alloc.h(134) : Error: undefined identifier
 '__stl_new' c:\dm\stlport\stlport\stl/_alloc.h(135) : Error: undefined
 identifier '__stl_delete' class _STLP_CLASS_DECLSPEC __Named_exception :
 public _STLP_EXCEPTION_BASE {
                                                                            ^
 c:\dm\stlport\stlport\stdexcept(56) : Error: identifier expected ---
 errorlevel 1
 
 Just trying out a simple hello.cpp program. Would not work in IDE, so
 tried on command line. Followed readme.txt in stlport.
 
 INCLUDE=c:\dm\stlport\stlport; c:\dm\include; C:\H1>type hello.cpp
 #include <iostream>
 
 int main()
 {
     std::cout << "Hello World!";
     return 0;
 }
 }
 Purchased CD version 8.47. Update file already included.
I resolved the problem. Needed to do three things with the project settings: 1) add \dm\stlport\stlport in Include Directories in project (setting INCLUDE does not seem to matter, even with \dm\stlport\stlport first.) 2) add \dm\lib\stlp45dms.lib to project 3) needed to modify the link order to include the stlp45dms library. The documentation should be updated to reflect building a project.
Feb 26 2006