Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-11-2005, 10:41 AM   #1
LQ Newbie
Registered: Feb 2005
Posts: 28

Rep: Reputation: 15
Undefined Reference

Im using Suse 9.1 and Kdevelop 3.1. Im building on top of an already existing library for a software, some applications have been built using this same library and they work perfectly fine. But when I use the same templates and classes, upon declaring some types I get errors such as: main.o(.text+0x27b): In function `main':
: undefined reference to `InputReader::InputReader[in-charge](std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_ostream<char, std::char_traits<char> >&, std::basic_filebuf<char, std::char_traits<char> >*, int)'
main.o(.text+0x2bc): In function `main':
: undefined reference to `InputReader::~InputReader [in-charge]()'

Although some other types work fine. But I do have the header file "InputReader" included, and I declare and initialize the object just as it was declared and initialized in the working applications, but it still gives me this error.
Im hoping this has happened to someone before, because its been staring me in the face for days now. Can anyone help?
Old 02-11-2005, 03:07 PM   #2
jim mcnamara
Registered: May 2002
Posts: 964

Rep: Reputation: 34
Do you have multiple namespaces? It looks like the link editor thinks InputReader is in another namespace.
Old 02-14-2005, 04:01 AM   #3
LQ Newbie
Registered: Feb 2005
Posts: 28

Original Poster
Rep: Reputation: 15
no, I only have one namespace. Well one namespace other than the namespace std...
But the namespace Im including does not appear in the namespace folder of my project, I'm including a namespace that is declared simply in the code that I am using.
Meaning, I have a whole library I'm using for graph and graph manipulation, and they are all in the name space Graph...
I guess I have to do something more, now that you mentioned it....


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Undefined reference, why? george_mercury Programming 4 05-07-2009 01:15 AM
undefined reference to `XF86VidModeGetModeLine' apokryphos Linux - General 1 08-07-2005 07:40 PM
undefined reference mp4-10 Programming 3 01-25-2005 01:38 PM
undefined reference to 'request_irq()' deimosSan Programming 2 11-10-2003 09:15 AM
Yet another 'undefined reference' problem faulpelz2 Linux - Software 3 04-04-2003 12:18 PM

All times are GMT -5. The time now is 05:39 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration