Compilation problem on HPI-Itanium

sathyanarayana.singh_at_gmail.com
Date: 10/22/05


Date: 22 Oct 2005 03:38:11 -0700

Hi,
I am porting the following piece of code from HP PARIC to HP-Itanium.
The following piece of code compiles on HP-PARISC(aCC: HP ANSI C++
B3910B A.03.50) without any problem. But gives the following error on
HPI(aCC: HP aC++/ANSI C B3910B A.05.52 [Jan 16 2004]).

/project/as10g/src/build101201/src32_m1q/or$>aCC -AP -c TableLook.cpp
Error 195: "TableLook.cpp", line 15 # Static member "const TabNameLook
(*TableHandle::mpObjNames)[]" was declared as 'const
TabNameLook (*)[]' in class yet has type 'const TabNameLook (*)[]'
here.
const TabNameLookArray* TableHandle::mpObjNames = (const
TabNameLookArray*)ObjNames;

-------
TableLook.h
#include <iostream.h>
#include <string.h>

class TabNameLook
{
public:
// Constructor
TabNameLook(const char *s, int n){}

char* mName; // Table name
int mNum; // Table name index
};

typedef TabNameLook TabNameLookArray[];

class TableHandle
{
public:
static const TabNameLookArray* mpObjNames;

};
----------------------------
TableLook.cpp

#include "TableLook.h"

const TabNameLook ObjNames[] =
{
TabNameLook("aa1",1),
TabNameLook("aa2",2),
TabNameLook("aa3",3),
TabNameLook("aa4",4),
TabNameLook("aa5",5),
TabNameLook("aa6",6),
TabNameLook("aa7",7),
};

const TabNameLookArray* TableHandle::mpObjNames = (const
TabNameLookArray*)ObjNames;

Does anybody have any idea as about resolving this problem. I am not
able to understand as to why the compiler on HPI is not able to compile
this.



Relevant Pages