473,729 Members | 2,177 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Linker error: undefined reference

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=def ault -D_POSIX_SOURCE -DTRACING -
D__EXTENSIONS__ -D__RWCOMPILER_H __ -D_REENTRANT -D_RWCONFIG=8s -
D_RWCONFIG_12d -D_RWSTDDEBUG -DRWDEBUG -o test1 test1.o -L/lib -
lTrackList -L/opt/ossasn1/linux-glibc2.2.trial/8.2.0-betaA/lib -
Bstatic -losstoed -Bdynamic -L/opt/RogueWave/SourcePro/Ed9_Eval/lib -
lpop32212d -lthread2412d -litc2312d -lfunctor_list23 12d -
linternet2212d -lfunctor2312d -lpointer2512d -lsync2412d -
lthrexcept2312d -ltrace2312d -lnetwork1812d -ltls71012d -L/lib -
lConfigFw -L/Scan/lib -lScan -lnsl -ldl -lm

----------------
Here is my linker error

/psalms/common/Scan/lib/libScan.a(Scan. o)(.text+0x272) : In function
`Scan::Scan(uns igned char const*, long)':
/home/pmirji/psalms/common/Scan/src/Scan.C:69: undefined reference to
`ConfigFile::ge tString(RWCStri ng const&, RWCString const&)'
/psalms/common/Scan/lib/libScan.a(Scan. o)(.text+0x5a8) : In function
`Scan::Scan(uns igned char const*, long)':
/home/pmirji/psalms/common/Scan/src/Scan.C:69: undefined reference to
`ConfigFile::ge tString(RWCStri ng const&, RWCString const&)'
/psalms/common/Scan/lib/libScan.a(Scan. o)(.text+0xd95) : In function
`Scan::setScanA ndInsert(RWCStr ing const&, SepTime const&)':
/home/pmirji/psalms/common/Scan/src/Scan.C:164: undefined reference to
`DataSetRow::ge tField(char const*)'
/psalms/common/Scan/lib/libScan.a(Scan. o)(.text+0xdf0) :/home/pmirji/
psalms/common/Scan/src/Scan.C:166: undefined reference to
`DataSetRow::ge tField(char const*)'
/psalms/common/Scan/lib/libScan.a(Scan. o)(.text+0xe5e) :/home/pmirji/
psalms/common/Scan/src/Scan.C:173: undefined reference to
`DataSetRow::ge tField(char const*)'
/psalms/common/Scan/lib/libScan.a(Scan. o)(.text+0xe8a) :/home/pmirji/
psalms/common/Scan/src/Scan.C:175: undefined reference to
`DataSetRow::ge tField(char const*)'
/psalms/common/Scan/lib/libScan.a(Scan. o)(.text+0xeb4) :/home/pmirji/
psalms/common/Scan/src/Scan.C:178: undefined reference to
`DataSetRow::ge tField(char const*)'
/psalms/common/Scan/lib/libScan.a(Scan. o)(.text+0xf04) :/home/pmirji/
psalms/common/Scan/src/Scan.C:179: more undefined references to
`DataSetRow::ge tField(char const*)' follow
/psalms/common/Scan/lib/libScan.a(Scan. o)(.text+0x11e3 ): In function
`Scan::setScanA ndInsert(RWCStr ing const&, SepTime const&)':
/home/pmirji/psalms/common/Scan/src/Scan.C:192: undefined reference to
`SRSException:: printStackTrace (char const*, int, int)'
/psalms/common/Scan/lib/libScan.a(Scan. o)(.text+0x18b3 ):/home/pmirji/
psalms/common/Scan/src/Scan.C:212: undefined reference to
`DataSet::Synch Window()'
/psalms/common/Scan/lib/libScan.a(Scan. o)(.text+0x1e12 ):/home/pmirji/
psalms/common/Scan/src/Scan.C:223: undefined reference to
`SRSException:: printStackTrace (char const*, int, int)'

..............
..............
getString(RWCSt ring const&, RWCString const&)' is static method
declared in ConfigFile.[h,C]. Actually all methods are static.

If I follow standard c++ header file declaration I mean without .h
extension and use 'using namespace std', linker error 'undefined
reference' goes off.
Don't know how this is related to static methods.

any idea?. Please help me.

Thanks & Regards,
Prakash

May 8 '07 #1
3 11597
pr***********@g mail.com wrote:
I am getting below mention linker error when I tried to link my class
test.C

I use below command to compile test.C

[...compiler-specific...]

----------------
Here is my linker error

/psalms/common/Scan/lib/libScan.a(Scan. o)(.text+0x272) : In function
`Scan::Scan(uns igned char const*, long)':
/home/pmirji/psalms/common/Scan/src/Scan.C:69: undefined reference to
`ConfigFile::ge tString(RWCStri ng const&, RWCString const&)'
[..]

getString(RWCSt ring const&, RWCString const&)' is static method
declared in ConfigFile.[h,C]. Actually all methods are static.

If I follow standard c++ header file declaration I mean without .h
extension and use 'using namespace std', linker error 'undefined
reference' goes off.
Goes *off*? Do you mean "goes away"?
Don't know how this is related to static methods.

any idea?. Please help me.
Try reordering libraries in your command-line. The one containing the
'ConfigFile::ge tString' should follow theonw with 'Scan::Scan'. Any
other questions about how to compile and how to order libraries should
be asked in the compiler-specific newsgroup. Try 'gnu.g++.help'.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
May 8 '07 #2
On May 8, 6:51 am, prakash.mi...@g mail.com wrote:
any idea?. Please help me.
It looks like your code uses the Rogue Wave libraries, a commercial
package.

You should check their documentation on how to link on your system.

May 8 '07 #3
On May 8, 6:16 pm, "Victor Bazarov" <v.Abaza...@com Acast.netwrote:
prakash.mi...@g mail.com wrote:
I am getting below mentionlinkerer rorwhen I tried to link my class
test.C
I use below command to compile test.C
[...compiler-specific...]
----------------
Here is mylinkererror
/psalms/common/Scan/lib/libScan.a(Scan. o)(.text+0x272) : In function
`Scan::Scan(uns igned char const*, long)':
/home/pmirji/psalms/common/Scan/src/Scan.C:69: undefined reference to
`ConfigFile::ge tString(RWCStri ng const&, RWCString const&)'
[..]
getString(RWCSt ring const&, RWCString const&)' is static method
declared in ConfigFile.[h,C]. Actually all methods are static.
If I follow standard c++ header file declaration I mean without .h
extension and use 'using namespace std',linkererro r'undefined
reference' goes off.

Goes *off*? Do you mean "goes away"?
Don't know how this is related to static methods.
any idea?. Please help me.

Try reordering libraries in your command-line. The one containing the
'ConfigFile::ge tString' should follow theonw with 'Scan::Scan'. Any
other questions about how to compile and how to order libraries should
be asked in the compiler-specific newsgroup. Try 'gnu.g++.help'.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask- Hide quoted text -

- Show quoted text -
reordering libraries takes care of my linker error.
Thank you very much.

Regards,
Prakash

May 10 '07 #4

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

Similar topics

2
1554
by: GammaJoe | last post by:
I'm relatively new to C++, and so when I ran across these linker errors, I really didn't know how to fix them. I did a groups.google search, and found plenty of issues with parameterized classes, or using the wrong compiler, or a variety of other things that don't apply to my problem. So, if anyone could help me out, that'd be great. DummyTester.cpp: #include "DummyClass.h"; #include "CommunicatorImplementation.h";
3
1823
by: Lord Labakudas | last post by:
Hi, I have the following simple template implementation: // -------------- b.h ----------------- // template <class t> class b { public: b() ;
12
801
by: Baloff | last post by:
Hello I have this linker error which makes me think that the definition file is not being seen by the linker, this code is taken from "Thinking in C++, 2nd Edition, Volume 1, Annotated Solutions Guide" Using Dev-C++ 4.9.9.2, The error is: undefined reference to ‘f(int)’ all the following files are in the same dir. thanks
4
5877
by: Mark | last post by:
Hi, I'm trying to write some classes that kind of manage themselves. A linked list, that links different types of objects. Here's the code... object.h: --- class Object { int alt;
5
2663
by: Mark | last post by:
Sorry for creating such a newbish topic, but I just can't seem to figure out what the problem is here. // main.cpp #include <cstdlib> #include <iostream> #include "Vector.h" using namespace std;
1
1967
by: Herman.Schultz | last post by:
I am getting the following undefined reference linker error when I compile my program: FileModule.o: In function `DoFile': /home/herman/src/FileModule.cpp:665: undefined reference to `VLC_Init' collect2: ld returned 1 exit status I have added libvlc.so file to my 'LIBFILES in my Makefile: LIBFILES = QTFileLib/libQTFileLib.a \ /home/herman/bin/lib/libvlc.so
1
2069
by: mubbashir | last post by:
I just created a program and used public inheritance. when compiling I am getting linker error of this kind. undefined reference to `Person::Person(char *)' undefined reference to `Person::~Person(void)' undefined reference to `Student::~Student(void)'
6
3530
by: Ed Dana | last post by:
I'm trying to create a dynamic two dimensional array. My code looks like this: ====================================================================== #define DEF_FrameBuffer_H class FrameBuffer { public: FrameBuffer(int prmWidth, int prmHeight, unsigned long prmPen); FrameBuffer(int prmWidth, int prmHeight);
3
3595
by: Rahul | last post by:
Hi Everyone, I have the following polymorphic classes, class Shape { public : virtual void draw() { } virtual void sample();
0
8913
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8761
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9142
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8144
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6016
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2162
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.