Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Template instantiation on HP aCC compiler

Reply
Thread Tools

Template instantiation on HP aCC compiler

 
 
rpmohan
Guest
Posts: n/a
 
      10-21-2003
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.
 
Reply With Quote
 
 
 
 
Alf P. Steinbach
Guest
Posts: n/a
 
      10-21-2003
On 20 Oct 2003 22:49:48 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) (rpmohan) wrote:

>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
include <list>.


>
> int main(int argc, char *argv[])
> {
>
> List<int> myList;
> return 0;
> }


It's possible you meant to write std::list<int>.


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

 
Reply With Quote
 
 
 
 
Jan Gerrit Kootstra
Guest
Posts: n/a
 
      10-21-2003
"rpmohan" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed) om...
> 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


 
Reply With Quote
 
Rolf Magnus
Guest
Posts: n/a
 
      10-21-2003
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.

 
Reply With Quote
 
Dennis Handly
Guest
Posts: n/a
 
      10-24-2003
rpmohan ((E-Mail Removed)) 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Template instantiation issue on Dev C++ compiler. param C++ 2 01-14-2008 08:36 AM
Explicit instantiation of STL vector demands explicit instantiation of all the templates it using internally. krunalbauskar@gmail.com C++ 1 12-25-2006 03:51 PM
aCC Compiler error : Cannot use extern object of unknown size manoj.pattanaik@gmail.com C++ 3 04-21-2006 05:30 PM
Compiling the Python sources with a C++ compiler (aCC) Paul Sheer Python 3 06-21-2004 05:15 PM
Sun C++ compiler: How to change template instantiation directory Vivek V C++ 1 05-03-2004 07:38 PM



Advertisments