View Single Post

   
  #1 (permalink)  
Old 01-16-2008, 07:59 PM
Manoj Pattanaik
 
Posts: n/a
Default aCC Compiler error : Cannot use extern object of unknown size

Hi,
I am trying to compile following piece of code (bb.cpp) using aCC (HP
ANSI C++ B3910B A.03.37) compiler on HP-UX 11.23. It gives Compiler
error:485.

Same code is compiling fine with VC++ (Windows), CC (Solaris 9), gcc
(LInux).

Can anyone please help me to compile it with aCC compiler on
HPUX without making any change in the code?

//bb.cpp -- Starts

#include <iostream>
using namespace std;

class abc;

extern abc objabc;

template <class a>
class def
{
public:
void disp()
{
objabc.func();
}

};

class abc
{
public:
void func()
{
cout<<"from func"<<endl;
}

};

abc objabc;

//bb.cpp -- Ends

aCC -AA -c bb.cpp -o bb.o

Error 485: "bb.cpp", line 17 # Cannot use extern object of unknown
size; 'abc' must be defined first. "abc objabc" was declared at
["bb.cpp", line 8].
objabc.func();
^^^^^^

Reply With Quote