codecvt.cc:39: error: ISO C++ forbids declaration of`_RWSTD_NAMESPACE_BEGIN' with no type

W

wong_powah

How to fix this compile error?

# make -f Util/UtilBlock.dep
g++ /opt/aCC/include_std/rw/codecvt.cc -o /opt/aCC/include_std/
rw/codecvt
/opt/aCC/include_std/rw/codecvt.cc:32: error: use of namespace `std'
as
expression
/opt/aCC/include_std/rw/codecvt.cc:39: error: ISO C++ forbids
declaration of `
_RWSTD_NAMESPACE_BEGIN' with no type
/opt/aCC/include_std/rw/codecvt.cc:39: error: syntax error before
`template'
/opt/aCC/include_std/rw/codecvt.cc:43: error: syntax error at end of
input
make: *** [/opt/aCC/include_std/rw/codecvt] Error 1


Util/UtilBlock.dep is generated by "make depend" on a makefile.hpux
file.
makefile.hpux file is:
CC_OPTS_MT = -AA -mt
CC_OPTS_SHARED = ${CC_OPTS_MT} +W829 +W254 +W667 +W749 +Z
CC_OPTS_64BIT = -AA +DD64

mDep = aCC -c -E +M -AA
mC = aCC $(CC_OPTS_SHARED) -c
mCpp = aCC $(CC_OPTS_SHARED) -c
mLink = aCC $(CC_OPTS_SHARED) -s
mDll = aCC $(CC_OPTS_SHARED) -b -s

mDepOptions = $(DEP_OPTIONS) $(DEFINITIONS)
mCOptions = $(C_OPTIONS) $(DEFINITIONS)
mCppOptions = $(CPP_OPTIONS) $(DEFINITIONS)
mLinkOptions = $(LINK_OPTIONS)

mDllCOptions =
mDllCppOptions =
mDllLinkOptions = $(DLL_OPTIONS)

#...

depend: target-dir
@-rm build.$(platform) >/dev/null
@$(MAKE) -f $(ROOT_MAKE) build.$(platform) \
"target = $(target)" \
"platform = $(platform)" \
"map = $(map)" \
"dep = $(mDep) $(mDepOptions)" \
"c = $(mC) $(mCOptions)" \
"cpp = $(mCpp) $(mCppOptions)" \
"link = $(mLink) $(mLinkOptions)"

Util/UtilBlock.dep:
$(platform)/UtilBlock.o: Util/UtilBlock.cpp \
/opt/aCC/include_std/fstream \
/opt/aCC/include_std/istream \
/opt/aCC/include_std/ios \
/opt/aCC/include_std/rw/rwstderr.h \
/opt/aCC/include_std/rw/stddefs.h \
/opt/aCC/include_std/stdcomp.h \
/opt/aCC/include_std/compnent.h \
/opt/aCC/include_std/rw/rwlocale \
/opt/aCC/include_std/string \
/opt/aCC/include_std/rw/iterator \
/opt/aCC/include_std/cstddef \
/usr/include/stddef.h \
/usr/include/sys/stdsyms.h \
/usr/include/sys/_null.h \
/usr/include/sys/_size_t.h \
/usr/include/sys/_wchar_t.h \
/opt/aCC/include_std/stdexcept \
/opt/aCC/include_std/rw/exception.h \
/opt/aCC/include_std/exception \
/opt/aCC/include_std/cstdarg \
/usr/include/stdarg.h \
/usr/include/varargs.h \
/opt/aCC/include_std/limits \
/opt/aCC/include_std/rw/math.h \
/opt/aCC/include_std/cmath \
/usr/include/math.h \
/opt/aCC/include_std/cfloat \
/usr/include/float.h \
/opt/aCC/include_std/climits \
/usr/include/limits.h \
/usr/include/sys/param.h \
/usr/include/sys/types.h \
/usr/include/sys/_inttypes.h \
/usr/include/machine/vmtypes.h \
/usr/include/sys/_fd_macros.h \
/usr/include/machine/param.h \
/usr/include/sys/sysmacros.h \
/usr/include/machine/param_shm.h \
/usr/include/sys/time.h \
/usr/include/sys/sigevent.h \
/usr/include/machine/spl.h \
/usr/include/sys/kern_svcs.h \
/opt/aCC/include_std/limits.cc \
/opt/aCC/include_std/algorithm \
/opt/aCC/include_std/cstdlib \
/usr/include/errno.h \
/usr/include/sys/errno.h \
/usr/include/stdio.h \
/usr/include/sys/_null.h \
/usr/include/stdlib.h \
/usr/include/sys/wait.h \
/usr/include/sys/resource.h \
/usr/include/sys/_rlimit_body.h \
/usr/include/sys/signal.h \
/usr/include/sys/siginfo.h \
/usr/include/sys/newsig.h \
/usr/include/machine/save_state.h \
/usr/include/sys/syscall.h \
/usr/include/sys/scall_define.h \
/usr/include/machine/frame.h \
/usr/include/pwd.h \
/opt/aCC/include_std/memory \
/opt/aCC/include_std/new \
/opt/aCC/include_std/utility \
/opt/aCC/include_std/algorithm \
/opt/aCC/include_std/rw/stdmutex.h \
/opt/aCC/include_std/cstring \
/usr/include/string.h \
/usr/include/sys/_null.h \
/opt/aCC/include_std/rw/mutexwrpr.h \
/opt/aCC/include_std/algorithm.cc \
/opt/aCC/include_std/rw/random.h \
/opt/aCC/include_std/rw/random.cc \
/opt/aCC/include_std/cctype \
/usr/include/ctype.h \
/opt/aCC/include_std/cwchar \
/usr/include/time.h \
/usr/include/wchar.h \
/opt/aCC/include_std/cwctype \
/opt/aCC/include_std/rw/string_ref \
/opt/aCC/include_std/rw/traits \
/opt/aCC/include_std/cstdio \
/opt/aCC/include_std/rw/iotraits \
/opt/aCC/include_std/string.cc \
/opt/aCC/include_std/iosfwd \
/opt/aCC/include_std/typeinfo \
/opt/aCC/include_std/ctime \
/opt/aCC/include_std/clocale \
/usr/include/locale.h \
/usr/include/sys/_null.h \
/opt/aCC/include_std/stdio.h \
/opt/aCC/include_std/rw/locimpl \
/opt/aCC/include_std/rw/locvector \
/opt/aCC/include_std/rw/vendor \
/opt/aCC/include_std/rw/ctype \
/opt/aCC/include_std/rw/ctype.cc \
/opt/aCC/include_std/rw/numeral \
/opt/aCC/include_std/limits \
/opt/aCC/include_std/rw/rwlocale \
/opt/aCC/include_std/rw/iosbase \
/opt/aCC/include_std/rw/numeral.cc \
/opt/aCC/include_std/rw/numbrw \
/opt/aCC/include_std/rw/numbrw.cc \
/opt/aCC/include_std/rw/codecvt \
/opt/aCC/include_std/limits \
/opt/aCC/include_std/rw/codecvt.cc \
/opt/aCC/include_std/rw/usefacet \
/opt/aCC/include_std/ios.cc \
/opt/aCC/include_std/ostream \
/opt/aCC/include_std/streambuf \
/opt/aCC/include_std/ostream.cc \
/opt/aCC/include_std/istream.cc \
/opt/aCC/include_std/limits \
/opt/aCC/include_std/rw/file.h \
/usr/include/unistd.h \
/usr/include/sys/unistd.h \
/usr/include/utime.h \
/usr/include/sys/_time_t.h \
/usr/include/fcntl.h \
/usr/include/sys/fcntl.h \
/usr/include/sys/_flock_body.h \
/opt/aCC/include_std/fstream.cc \
/opt/aCC/include_std/iostream \
Util/UtilBlock.h \
../util_dir/Include/ResultCode.h \
../util_dir/Include/../General/ResultCode.h \
../util_dir/Include/Defs.h \
../util_dir/Include/../General/../../fwinterface_dir/source/fwrc.h \
../util_dir/Include/Defs.h
$(cpp) $(cppOptions) Util/UtilBlock.cpp -o $(platform)/UtilBlock.o

# aCC --version
aCC: HP ANSI C++ B3910B A.03.33

# uname -a
HP-UX hp1 B.11.00 U 9000/785 2003725330 unlimited-user
license

# make -v
GNU Make 3.80
Copyright (C) 2002 Free Software Foundation, Inc.
 
R

red floyd

How to fix this compile error?

# make -f Util/UtilBlock.dep
g++ /opt/aCC/include_std/rw/codecvt.cc -o /opt/aCC/include_std/
rw/codecvt
/opt/aCC/include_std/rw/codecvt.cc:32: error: use of namespace `std'
as
expression
/opt/aCC/include_std/rw/codecvt.cc:39: error: ISO C++ forbids
declaration of `
_RWSTD_NAMESPACE_BEGIN' with no type
/opt/aCC/include_std/rw/codecvt.cc:39: error: syntax error before
`template'
/opt/aCC/include_std/rw/codecvt.cc:43: error: syntax error at end of
input
make: *** [/opt/aCC/include_std/rw/codecvt] Error 1

You have an error on line 32 (or 39, or 43) of your code.
We have no idea what the heck it might be, because all you posted is
your makefile, which is irrelevant.
 
M

Martin York

This is a problem with Rogue Wave.
You need to find the appropriate forum for them.
 
W

wong_powah

How to fix this compile error?
# make -f Util/UtilBlock.dep
g++ /opt/aCC/include_std/rw/codecvt.cc -o /opt/aCC/include_std/
rw/codecvt
/opt/aCC/include_std/rw/codecvt.cc:32: error: use of namespace `std'
as
expression
/opt/aCC/include_std/rw/codecvt.cc:39: error: ISO C++ forbids
declaration of `
_RWSTD_NAMESPACE_BEGIN' with no type
/opt/aCC/include_std/rw/codecvt.cc:39: error: syntax error before
`template'
/opt/aCC/include_std/rw/codecvt.cc:43: error: syntax error at end of
input
make: *** [/opt/aCC/include_std/rw/codecvt] Error 1

You have an error on line 32 (or 39, or 43) of your code.
We have no idea what the heck it might be, because all you posted is
your makefile, which is irrelevant.

The file, posted below, is from Rogue Wave, which is mentioned by the
poster
Martin York. I did not post it previously because I suspect the
compile problem is in my makefile.

# cat /opt/aCC/include_std/rw/codecvt.cc
// -*- C++ -*-
/
***************************************************************************
*
* codecvt.cc - Definitions for the Standard Library code conversion
facet
*
* $Id$
*

***************************************************************************
*
* Copyright (c) 1994-2000 Rogue Wave Software, Inc. All Rights
Reserved.
*
* This computer software is owned by Rogue Wave Software, Inc. and is
* protected by U.S. copyright laws and other laws and by
international
* treaties. This computer software is furnished by Rogue Wave
Software,
* Inc. pursuant to a written license agreement and may be used,
copied,
* transmitted, and stored only in accordance with the terms of such
* license and with the inclusion of the above copyright notice. This
* computer software or any other copies thereof may not be provided
or
* otherwise made available to any other person.
*
* U.S. Government Restricted Rights. This computer software is
provided
* with Restricted Rights. Use, duplication, or disclosure by the
* Government is subject to restrictions as set forth in subparagraph
(c)
* (1) (ii) of The Rights in Technical Data and Computer Software
clause
* at DFARS 252.227-7013 or subparagraphs (c) (1) and (2) of the
* Commercial Computer Software Restricted Rights at 48 CFR
52.227-19,
* as applicable. Manufacturer is Rogue Wave Software, Inc., 5500
* Flatiron Parkway, Boulder, Colorado 80301 USA.
*

**************************************************************************/

_RWSTD_NAMESPACE_BEGIN (std)

// -------------------------------------------------------
// Facet codecvt<internT,externT,stateT> member templates.
// -------------------------------------------------------

#ifndef _RWSTD_NO_TEMPLATE_STATIC_ID
template <class _InternT,class _ExternT,class _StateT>
locale::id codecvt<_InternT,_ExternT,_StateT>::id;
#endif

_RWSTD_NAMESPACE_END //std
 
T

Travis Vitek

How to fix this compile error?
# make -f Util/UtilBlock.dep
g++ /opt/aCC/include_std/rw/codecvt.cc -o /opt/aCC/include_std/
rw/codecvt
/opt/aCC/include_std/rw/codecvt.cc:32: error: use of namespace `std'
as expression
/opt/aCC/include_std/rw/codecvt.cc:39: error: ISO C++ forbids
declaration of `_RWSTD_NAMESPACE_BEGIN' with no type
/opt/aCC/include_std/rw/codecvt.cc:39: error: syntax error before
`template'
/opt/aCC/include_std/rw/codecvt.cc:43: error: syntax error at end of
input
make: *** [/opt/aCC/include_std/rw/codecvt] Error 1

The problem is that your makefile is trying to compile the .cc file
directly. Your makefile should only be trying to compile your `Util/
UtilBlock.cpp'.

Travis
 
W

wong_powah

How to fix this compile error?
# make -f Util/UtilBlock.dep
g++ /opt/aCC/include_std/rw/codecvt.cc -o /opt/aCC/include_std/
rw/codecvt
/opt/aCC/include_std/rw/codecvt.cc:32: error: use of namespace `std'
as expression
/opt/aCC/include_std/rw/codecvt.cc:39: error: ISO C++ forbids
declaration of `_RWSTD_NAMESPACE_BEGIN' with no type
/opt/aCC/include_std/rw/codecvt.cc:39: error: syntax error before
`template'
/opt/aCC/include_std/rw/codecvt.cc:43: error: syntax error at end of
input
make: *** [/opt/aCC/include_std/rw/codecvt] Error 1

The problem is that your makefile is trying to compile the .cc file
directly. Your makefile should only be trying to compile your `Util/
UtilBlock.cpp'.

Travis

I know that the makefile has the problem of compile the .cc file
directly.
However, I do not figure out how to fix the makefile yet.
 
W

wong_powah

How to fix this compile error?
# make -f Util/UtilBlock.dep
g++ /opt/aCC/include_std/rw/codecvt.cc -o /opt/aCC/include_std/
rw/codecvt
/opt/aCC/include_std/rw/codecvt.cc:32: error: use of namespace `std'
as expression
/opt/aCC/include_std/rw/codecvt.cc:39: error: ISO C++ forbids
declaration of `_RWSTD_NAMESPACE_BEGIN' with no type
/opt/aCC/include_std/rw/codecvt.cc:39: error: syntax error before
`template'
/opt/aCC/include_std/rw/codecvt.cc:43: error: syntax error at end of
input
make: *** [/opt/aCC/include_std/rw/codecvt] Error 1

The problem is that your makefile is trying to compile the .cc file
directly. Your makefile should only be trying to compile your `Util/
UtilBlock.cpp'.

Travis

I know that the makefile has the problem of compile the .cc file
directly.
However, I do not figure out how to fix the makefile yet.
 
R

red floyd

I know that the makefile has the problem of compile the .cc file
directly.
However, I do not figure out how to fix the makefile yet.

comp.lang.c++ is for discussion of the C++ language as defined by
ISO/IEC 14882:2003. Makefiles are not part of the C++ language. Ask in
a group dedicated to your environment.

Followups set.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top