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++ - STLport vs C

↑ ↓ ← Wu Yongwei <Wu_member pathlink.com> writes:
I found a strange compatibility problem between STLport and Standard C.  In
order to use STLport, I must modify sc.ini to add "% P%\..\stlport\stlport"
before "% P%\..\include".  However, with this change, the "-A" option of dmc no
longer works (it is required to, say, compile GC test programs without
modifications).  The error reported is:

#   define __DFL_TMPL_PARAM( classname, defval ) class classname = defval
^
C:\dm\bin\..\stlport\stlport\stl/_config.h(370) : Preprocessor error:
'_STLP_DEFAULT_TYPE_PARAM' is already defined
leak_test.c(22) : Error: need at least one external def
--- errorlevel 1

Any decent fix for that? (I guess header files like stdio.h under
dm/stlport/stlport should have some #ifdef __cplusplus guides.)

Best regards,

Yongwei
Apr 11 2006
↑ ↓ → Wu Yongwei <Wu_member pathlink.com> writes:
In article <e1fnt5$1nvt$1 digitaldaemon.com>, Wu Yongwei says...
I found a strange compatibility problem between STLport and Standard C.  In
order to use STLport, I must modify sc.ini to add "% P%\..\stlport\stlport"
before "% P%\..\include".  However, with this change, the "-A" option of dmc no
longer works (it is required to, say, compile GC test programs without
modifications).  The error reported is:

#   define __DFL_TMPL_PARAM( classname, defval ) class classname = defval
^
C:\dm\bin\..\stlport\stlport\stl/_config.h(370) : Preprocessor error:
'_STLP_DEFAULT_TYPE_PARAM' is already defined
leak_test.c(22) : Error: need at least one external def
--- errorlevel 1

Any decent fix for that? (I guess header files like stdio.h under
dm/stlport/stlport should have some #ifdef __cplusplus guides.)

My current work-around: 1) Remove the stlport part from sc.ini; 2) Create a dmcpp.bat, containing something like "dmc -ID:\dm\stlport\stlport -cpp %*"; 3) Use dmcpp to build (Standard) C++ programs. It is inconvenient, may need coordination with other developers, and has the side-effect that any "-I" option specified on the command line goes AFTER the stlport path. The better way should be that dmc can define C++-specific include directories independent of the C include directories (in sc.ini). GCC behaves this way, both by default setting and by environment variables (CPATH for C/C++, C_INCLUDE_PATH for C, and CPLUS_INCLUDE_PATH for C++). Best regards, Yongwei
Apr 12 2006