473,398 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Undefined Reference Error while linking with g++, STL on LINUX

RU
Hi,

I am working on a porting project to port C/C++ application from
unixware C++, AT&T Standard components to g++ with STL on Linux. This
application has been working properly on Unixware/C++/AT&T componets
environment.

I have been able to compile all modules after making necessary changes
in LINUX/gcc/STL environment. We have two templates defined XList and
XMap.

I am getting following errors when I try to link all the modules. All
errors are related to templates XList and XMap.

/home/udupa/R5Inbound/lib/libxwrk.a(xnvamsgrcv.o): In function
`XNVAMsgRcv::~XNVAMsgRcv [not-in-charge]()':
xnvamsgrcv.o(.text+0xfb): undefined reference to `XMap<unsigned short,
XNVAMsgValue*>::~XMap [in-charge]()'
/home/udupa/R5Inbound/lib/libxwrk.a(xnvamsgrcv.o): In function
`XNVAMsgRcv::~XNVAMsgRcv [in-charge]()':
xnvamsgrcv.o(.text+0x16f): undefined reference to `XMap<unsigned
short, XNVAMsgValue*>::~XMap [in-charge]()'
/home/udupa/R5Inbound/lib/libxwrk.a(xnvamsgrcv.o): In function
`XNVAMsgRcv::~XNVAMsgRcv [in-charge deleting]()':
xnvamsgrcv.o(.text+0x1e3): undefined reference to `XMap<unsigned
short, XNVAMsgValue*>::~XMap [in-charge]()'
/home/udupa/R5Inbound/lib/libxwrk.a(xnvamsgrcv.o): In function
`XNVAMsgRcv::MorphBequeath(XNVAMsgRcv*)':
xnvamsgrcv.o(.text+0x258): undefined reference to `XMap<unsigned
short, XNVAMsgValue*>::Iterate()'
xnvamsgrcv.o(.text+0x285): undefined reference to `XMap<unsigned
short, XNVAMsgValue*>::GetNext(unsigned short&, XNVAMsgValue*&)'
xnvamsgrcv.o(.text+0x2a7): undefined reference to `XMap<unsigned
short, XNVAMsgValue*>::SetAt(unsigned short const&, XNVAMsgValue*)'
xnvamsgrcv.o(.text+0x2ec): undefined reference to `XMap<unsigned
short, XNVAMsgValue*>::RemoveAll()'
/home/udupa/R5Inbound/lib/libxwrk.a(xnvamsgrcv.o): In function
`XNVAMsgRcv::DispatchPayload(unsigned char const*, unsigned char,
unsigned short, unsigned long, unsigned long, unsigned long&)':
xnvamsgrcv.o(.text+0x8b5): undefined reference to
`XList<XNVAMsgRcv*>::IsEmpty() const'
xnvamsgrcv.o(.text+0x8f5): undefined reference to
`XList<XNVAMsgRcv*>::GetTail() const'
xnvamsgrcv.o(.text+0x94f): undefined reference to `XMap<unsigned
short, XNVAMsgValue*>::Lookup(unsigned short const&, XNVAMsgValue*&)
const'
xnvamsgrcv.o(.text+0x9b8): undefined reference to `XMap<unsigned
short, XNVAMsgValue*>::SetAt(unsigned short const&, XNVAMsgValue*)'
/home/udupa/R5Inbound/lib/libxwrk.a(xnvamsgrcv.o): In function
`XNVAMsgRcv::CleanupMap()':
xnvamsgrcv.o(.text+0x9e2): undefined reference to `XMap<unsigned
short, XNVAMsgValue*>::Iterate()'
xnvamsgrcv.o(.text+0xa0b): undefined reference to `XMap<unsigned
short, XNVAMsgValue*>::GetNext(unsigned short&, XNVAMsgValue*&)'
xnvamsgrcv.o(.text+0xa46): undefined reference to `XMap<unsigned
short, XNVAMsgValue*>::RemoveAll()'
/home/udupa/R5Inbound/lib/libxwrk.a(xnvamsgrcv.o): In function
`XNVAMsgRcv::IterateValues()':
xnvamsgrcv.o(.text+0xa5c): undefined reference to `XMap<unsigned
short, XNVAMsgValue*>::Iterate()'
/home/udupa/R5Inbound/lib/libxwrk.a(xnvamsgrcv.o): In function
`XNVAMsgRcv::GetNextValue(unsigned char&, unsigned short&)':
xnvamsgrcv.o(.text+0xa87): undefined reference to `XMap<unsigned
short, XNVAMsgValue*>::GetNext(unsigned short&, XNVAMsgValue*&)'
/home/udupa/R5Inbound/lib/libxwrk.a(xnvamsgrcv.o): In function
`XNVAMsgRcv::HasValue(unsigned short) const':
xnvamsgrcv.o(.text+0xaea): undefined reference to `XMap<unsigned
short, XNVAMsgValue*>::Lookup(unsigned short const&, XNVAMsgValue*&)
const'
/home/udupa/R5Inbound/lib/libxwrk.a(xnvamsgrcv.o): In function

I appreciate all help on this problem.

Thanks,
Raghu
Jul 19 '05 #1
2 13093
"RU" <ru****@easylink.com> wrote...
I am working on a porting project to port C/C++ application from
unixware C++, AT&T Standard components to g++ with STL on Linux. This
application has been working properly on Unixware/C++/AT&T componets
environment.

I have been able to compile all modules after making necessary changes
in LINUX/gcc/STL environment. We have two templates defined XList and
XMap.

I am getting following errors when I try to link all the modules. All
errors are related to templates XList and XMap.
[...]


Try putting the implementation of those functions in the header.
Jul 19 '05 #2
RU
This is my setup:
1)Library Setup:
1.1) lib1.cpp and lib1.hpp has class definition and declaration of
class CString
1.2) lib2.cpp and lib2.hpp has class definition and declaration of a
template class XMap that uses map template class provided by STL.

2)Application Setup:
2.1) mod1.cpp and mod1.hpp has class definition and declaration
required for application. In this module, we are defining another
class
CHeader, and later on, define an object XMap<CString,CHeader*>. XMap
is defined in lib2, CString is defined in lib1 and CHeader is
defined in mod1.
2.2) main.c invokes methods in mod1.

All four modules compile without error. When linking, I am getting
undefined error on XMap<CString,CHeader*>.

We are trying to port UNIXWARE C++ AT&T component application to LINUX
g++3.2.2 STL environment.

I appreciate all help in this matter.

I can not instantiate XMap<CString,CHeader*> in lib2, because CHeader
is defined in the application.

RU

"Victor Bazarov" <v.********@attAbi.com> wrote in message news:<vi************@corp.supernews.com>...
"RU" <ru****@easylink.com> wrote...
I am working on a porting project to port C/C++ application from
unixware C++, AT&T Standard components to g++ with STL on Linux. This
application has been working properly on Unixware/C++/AT&T componets
environment.

I have been able to compile all modules after making necessary changes
in LINUX/gcc/STL environment. We have two templates defined XList and
XMap.

I am getting following errors when I try to link all the modules. All
errors are related to templates XList and XMap.
[...]


Try putting the implementation of those functions in the header.

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: david | last post by:
Hi, I have some problems to link a simple hello world program using g++ (version 3.2.3 or 3.3) and dinkumware 402. //hallo world... #include <iostream> main () { std::cout << "bla" <<...
2
by: Quansheng Liang | last post by:
Hello, I struggled with the problem of "undefined reference to `vtable ...`" while migrating a project from windows to linux. After searching the google I removed all the inline functions and now...
6
by: Christian Christmann | last post by:
Hi, I've created a file htable.cpp which I compiled to htable.o and than added with "ar" to a library libbasics.a in the directory lib/Linux/. Now I want to compile another file ir3tst.cpp which...
10
by: siroregano | last post by:
Hello- I've got a nice C program written that uses libsndfile (#include <sndfile.h>) to convert my raw data into a properly-formatted wav file. The program is composed of a single .c file that...
5
by: druberego | last post by:
I read google and tried to find the solution myself. YES I do know that you can get undefined references if you: a) forget to implement the code for a prototype/header file item, or b) you forget...
2
by: Manuel T | last post by:
Hello everybody, I'm trying to port a project from Windows+Cygwin to Linux(i'm working on a Debian-like: Kubuntu), but I'm facing a lot of linking problems. This project needs libraries xerces...
8
by: wdh3rd | last post by:
I'm still new at C and can't solve this problem. I've looked through the FAQ and on the Web, but am not having luck. I'm getting an "undefined reference" error as well as a "Id returned 1 exit...
3
by: prakash.mirji | last post by:
Hello, I am getting below mention linker error when I tried to link my class test.C I use below command to compile test.C /usr/bin/g++ -g -fpic -fvisibility=default -D_POSIX_SOURCE...
3
by: tvnaidu | last post by:
I compiled tinyxml files (.cpp files) and when I am linking to create final exe in Linux, I am getting lot of errors saying "undefiend reference" to "operator new" and "delete", any idea?. ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.