Template instantiation on HP aCC compiler



 DEVELOP > c-Plus-Plus > Template instantiation on HP aCC compiler

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: "rpmohan"
Date: 21 Oct 2003 12:49:48 AM
Object: Template instantiation on HP aCC compiler
Hello,
I have sample Program called sample.C . The source code looks like
below.
#include <List.h>
int main(int argc, char *argv[])
{
List<int> myList;
return 0;
}
When I compile this program, I am getting Linker error below
/usr/ccs/bin/ld: Unsatisfied symbols:
List<int>::List()%1 (code)
List<int>::~List() (code)
I attempted to compile this program with different options...
1) aCC +inst_compiletime -I- -I/opt/aCC/include/SC sample.C
2) aCC +inst_auto -I- -I/opt/aCC/include/SC sample.C
3) aCC +inst_all -I- -I/opt/aCC/include/SC sample.C
What could be wrong in my compiler options.
I am compiling this program on HP-UNIX 10.2
Compiler version:
/opt/aCC/bin/aCC:
HP aC++ B3910B A.01.23
HP aC++ B3910B A.01.19.02 Language Support Library
Could anyone help me regarding the same.
.

User: "Dennis Handly"

Title: Re: Template instantiation on HP aCC compiler 24 Oct 2003 04:13:24 AM
rpmohan (rpmohan@yahoo.com) wrote:
: #include <List.h>
: When I compile this program, I am getting Linker error below
: ld: Unsatisfied symbols: List<int>::List()%1 (code)
: 2) aCC +inst_auto -I/opt/aCC/include/SC sample.C
: 3) aCC +inst_all -I/opt/aCC/include/SC sample.C
These are obsolete +inst* options.
: What could be wrong in my compiler options?
The correct option is +inst_implicit_include.
http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,1744!3!7,00.html#RN.CVT.2.4.1
.

User: "Rolf Magnus"

Title: Re: Template instantiation on HP aCC compiler 21 Oct 2003 05:48:33 AM
rpmohan wrote:

Hello,
I have sample Program called sample.C . The source code looks like
below.
#include <List.h>

int main(int argc, char *argv[])
{

List<int> myList;
return 0;
}

When I compile this program, I am getting Linker error below

/usr/ccs/bin/ld: Unsatisfied symbols:
List<int>::List()%1 (code)
List<int>::~List() (code)

The above shows that the compiler seems to be finding the class
definition, but the linker isn't finding any implementation of the
constructor and destructor. Maybe you put them in another translation
unit? That's not possible unless your compiler supports the export
keyword. Try putting the implementations of your List constructor and
destructor into the header file.
.


  Page 1 of 1

1

 


Related Articles
Template instantiation issue on Dev C++ compiler.
Sun C++ compiler: How to change template instantiation directory
what to do with template classes in template unsupported compiler ?
a compiler error with template function
How does the compiler interpret a template argument (reference vs. non-reference) ?
Template specialization problem - compiler bug or my fault?
Huge compilation time of template based sources (AIX 5.2, VA C++ 6 compiler)
static function template problem on sun compiler
template problem with ostream operator (Borland compiler)
Compiler error occurred when try to use a flexible template expression in preprocessor definesCompiler error occurred when try to use a flexible template expression in preprocessor defines
template implementation not seen by the compiler
template problem with MIPSpro compiler
Any new compiler support the `export` of C++ template?
convert binary to decimal in template at compiler time.
Re: help with this template - compiler error
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER