Template instantiation on HP aCC compiler

R

rpmohan

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.
 
A

Alf P. Steinbach

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

That's not a standard header, but perhaps you meant to
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.

That's off-topic in this group.
 
J

Jan Gerrit Kootstra

rpmohan said:
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.

rpmohan,


Do you have the header file List.h on your system? C is case sensitve.


Regards,


Jan Gerrit
 
R

Rolf Magnus

rpmohan said:
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.
 
D

Dennis Handly

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,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top