Sponsored Content
Top Forums Programming Compilation error on namespaces in system header debug.h Post 302143399 by rimon on Thursday 1st of November 2007 06:41:42 AM
Old 11-01-2007
Compilation error on namespaces in system header debug.h

Hi,

I'm porting code from Windows to HP-UX 11, compiling with g++.
I'm getting a compilation error on the system's debug.h include file, which is included very indirectly through a series of other system include files. The one I am including is <map> .
The errors I am getting are:
/opt/hp-gcc-4.2.1/lib/gcc/ia64-hp-hpux11.23/4.2.1/../../../../include/c++/4.2.1/debug/debug.h: At global scope:
/opt/hp-gcc-4.2.1/lib/gcc/ia64-hp-hpux11.23/4.2.1/../../../../include/c++/4.2.1/debug/debug.h:49: error: expected identifier before numeric constant
/opt/hp-gcc-4.2.1/lib/gcc/ia64-hp-hpux11.23/4.2.1/../../../../include/c++/4.2.1/debug/debug.h:49: error: expected unqualified-id before numeric constant
/opt/hp-gcc-4.2.1/lib/gcc/ia64-hp-hpux11.23/4.2.1/../../../../include/c++/4.2.1/debug/debug.h:54: error: expected identifier before numeric constant
/opt/hp-gcc-4.2.1/lib/gcc/ia64-hp-hpux11.23/4.2.1/../../../../include/c++/4.2.1/debug/debug.h:54: error: expected unqualified-id before numeric constant
/opt/hp-gcc-4.2.1/lib/gcc/ia64-hp-hpux11.23/4.2.1/../../../../include/c++/4.2.1/debug/debug.h:59: error: expected identifier before numeric constant
/opt/hp-gcc-4.2.1/lib/gcc/ia64-hp-hpux11.23/4.2.1/../../../../include/c++/4.2.1/debug/debug.h:59: error: expected `;' before numeric constant
/opt/hp-gcc-4.2.1/lib/gcc/ia64-hp-hpux11.23/4.2.1/../../../../include/c++/4.2.1/debug/debug.h:59: error: expected unqualified-id before numeric constant
/opt/hp-gcc-4.2.1/lib/gcc/ia64-hp-hpux11.23/4.2.1/../../../../include/c++/4.2.1/debug/debug.h:60: error: expected identifier before numeric constant
/opt/hp-gcc-4.2.1/lib/gcc/ia64-hp-hpux11.23/4.2.1/../../../../include/c++/4.2.1/debug/debug.h:60: error: expected `;' before numeric constant
/opt/hp-gcc-4.2.1/lib/gcc/ia64-hp-hpux11.23/4.2.1/../../../../include/c++/4.2.1/debug/debug.h:60: error: expected unqualified-id before numeric constant

Following is the beginning of debug.h with the leading comment removed. The lines that get the errors are the declarations of nested namespaces, e.g. namespace __debug { }

Code:
#ifndef _GLIBCXX_DEBUG_MACRO_SWITCH_H
#define _GLIBCXX_DEBUG_MACRO_SWITCH_H 1

/** Macros and namespaces used by the implementation outside of debug
 *  wrappers to verify certain properties. The __glibcxx_requires_xxx
 *  macros are merely wrappers around the __glibcxx_check_xxx wrappers
 *  when we are compiling with debug mode, but disappear when we are
 *  in release mode so that there is no checking performed in, e.g.,
 *  the standard library algorithms.
*/

// Debug mode namespaces.
namespace std
{
  namespace __debug { }
}

namespace __gnu_cxx
{
  namespace __debug { };
}

namespace __gnu_debug
{
  using namespace std::__debug;
  using namespace __gnu_cxx::__debug;
}

How do I get this to compile?

Thank you!

RO
 

10 More Discussions You Might Find Interesting

1. AIX

Problem with namespaces

Hello all, I am having a problem with the following program on AIX:- // Namespace.cxx #include <iostream> using namespace std; #include <iostream.h> int main() { // cout<<"Hello world"; return 0; } On compilation:- $ xlC Namespace.cxx... (0 Replies)
Discussion started by: gupta_ca
0 Replies

2. Programming

Regarding compilation error.

Hi All, I facing the following compilation error; when I implementing the following logic. ostrstream ostr; ostr << (( scAxsm.getRecord( i ).getField( 2 ).getShort())%12)!=0?(( scAxsm.getRecord( i ).getField( 2 ).getShort())/12+1) : (( scAxsm.getRecord( i ).getField( 2 ).getShort())/12) <<... (1 Reply)
Discussion started by: sweta
1 Replies

3. Programming

compilation error

Hi, While trying compile a C++ file in UNIX with gcc whose make rule involves the usage of /usr/ccs/bin/as, I get the following error: /usr/ccs/bin/as: No such file or directory /usr/ccs/bin/as: error: write error on output file "<filename>.o" *** Error code 1 clearmake: Error: Build... (2 Replies)
Discussion started by: smanu
2 Replies

4. Programming

Compilation error

I am compiling a software xchm on solaris 10. First i run './configure' There is no error. But when i start compiling using 'gmake' following error shown /usr/local/include/wx-2.6/wx/x11/brush.h: In copy constructor `wxBrush::wxBrush(const wxBrush&)':... (3 Replies)
Discussion started by: mansoorulhaq
3 Replies

5. Shell Programming and Scripting

Using System calls without compilation

Hi... I would like to create a program that can be easily ported between several Linuxes... Therefore I would like to avoid compilation and have the ability to run it as shell scripts runs... My program need to call some system calls such as fork etc... do you know a way to use them without... (1 Reply)
Discussion started by: yamsin789
1 Replies

6. Linux

c++ compilation error

Hello every one, here i am attempting to compile a c++ module using gcc.it is throwing a error . error: ==== > make -S dummyCHARGP /usr/local/bin/gcc -g -DDEBUG -DMAT -I. -I/swtemp/usbs/cc/unix-ce/root/subsys/lib/Linux/ -I/opt/dce/include -I/opt/dce/include/dce ... (12 Replies)
Discussion started by: mannam srinivas
12 Replies

7. HP-UX

compilation error

hello everyone, here i am attempting to compile a c++ submodule.OS is HP-UX. here i am getting the following error. ====================================== "Make: Don't know how to make compile. Stop." =================================== could you pls somebody suggest why this error is... (2 Replies)
Discussion started by: mannam srinivas
2 Replies

8. Programming

Compilation error : Please help

state_field state_abvr = { "AL","ALABAMA", "AK","ALASKA", "AZ","ARIZONA", "AR","ARKANSAS", "CA","CALIFORNIA", "CO","COLORADO", "CT","CONNECTICUT", "DE","DELAWARE", "DC","DISTRICT-OF-COLUMBIA", "FL","FLORIDA", "GA","GEORGIA", "HI","HAWAII", "ID","IDAHO", "IL","ILLINOIS",... (1 Reply)
Discussion started by: jagan_kalluri
1 Replies

9. Programming

Header file compilation using gcc in Sparc Solaris

I am facing problem while migrating the c++ code from Linux to Solaris. In linux the code is absolutly compiled fine with GCC compiler but when i am using the same in Solaris it coomplains bash-3.1$ gcc LibSip.h gcc: Compilation of header file requested The same command is working fine in... (2 Replies)
Discussion started by: mrupesh74
2 Replies

10. Programming

Configure: error: X Window system libraries and header files are required

I am trying to compile thunar 1.8.4. It is giving me this error. configure: error: X Window system libraries and header files are required Ubuntu Mate 18.04 (2 Replies)
Discussion started by: drew77
2 Replies
GENASSYM.CF(5)						      BSD File Formats Manual						    GENASSYM.CF(5)

NAME
genassym.cf -- assym.h definition file DESCRIPTION
The genassym.cf file is used by genassym(1) to make constant C expressions known to assembler source files. Lines starting with '#' are dis- carded by genassym(1). Lines starting with include, ifdef, if, else or endif are preceded with '#' and passed otherwise unmodified to the C compiler. Lines starting with quote get passed on with the quote command removed. The first word after a define command is taken as a CPP identifier and the rest of the line has to be a constant C expression. The output of genassym(1) will assign the numerical value of this expression to the CPP identifier. export X is a shorthand for define X X. struct X remembers X for the member command and does a define X_SIZEOF sizeof(X). member X does a define X offsetof(<last struct>, X). config <ctype> <gcc constraint> <asm print modifier> can be used to customize the output of genassym(1). When producing C output, values are casted to <ctype> (default: long) before they get handed to printf. <gcc constraint> (default: n) is the constraint used in the __asm__ statements. <asm print modifier> (default: empty) can be used to force gcc to output operands in different ways then normal. The "a" modifier e.g. stops gcc from emitting immediate prefixes in front of con- stants for the i386 and m68k port. FILES
/usr/src/sys/arch/${MACHINE}/${MACHINE}/genassym.cf SEE ALSO
genassym(1) HISTORY
The genassym.cf file appeared in NetBSD 1.3. BSD
August 18, 2005 BSD
All times are GMT -4. The time now is 01:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy