www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - Precompiled Headers and STL

↑ ↓ ← ddiego users.sourceforge.net writes:
Hi, I am trying to get precompiled headers to work with DMC and tried the
following:

test.h contents:

#ifndef _TEST_H__
#define _TEST_H__



#include <stddef.h>
#include <string>
#include <stdio.h>

typedef wchar_t WideChar;

typedef std::basic_string<WideChar> String;


#endif //_TEST_H__



then on the commandline (using Cygwin if that matters)

sc -Ar -Ae -HF./test.sym ./test.h

I get the following errors:

extern "C++" {
^
e:\dm\bin\..\include\../include/new.h(28) : Error: '=', ';' or ',' expected
}
^
e:\dm\bin\..\include\../include/new.h(45) : Error: identifier or '( declarator )
' expected
Error e:\dm\bin\..\include\../include/exception 14:  Use C++ compiler for except
ion
--- errorlevel 1


I am using dmc:
"Digital Mars Compiler Version 8.38n"

with the STL that's provided on the website (STL 4.5.3)

I looked around the website a bit, but didn't find anything obvious to help out
- did I miss something or have I stumbled onto a bug?

Thanks !

Jim Crafton
May 21 2004
→ ddiego users.sourceforge.net writes:
In article <c8mmvp$2fl4$1 digitaldaemon.com>, ddiego users.sourceforge.net
says...
Hi, I am trying to get precompiled headers to work with DMC and tried the
following:

Oops - I guess I may have posted this too soon, on reading a little closer I notice that the docs say: "A header intended for precompilation should, therefore, contain only declarations and no definitions." So I am assuming that makes stuff like template class declarations/definitions out of the question? Is there any kind of work around for this, say for STL, etc? Thanks again! Jim Crafton
May 21 2004
→ "Walter" <newshound digitalmars.com> writes:
Compile with -cpp to tell the compiler that test.h is a C++ file, not a C
file.
May 22 2004