LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 04-29-2004, 03:19 AM   #1
ashwinipahuja
Member
 
Registered: Mar 2004
Posts: 79

Rep: Reputation: 15
Undefined reference Error in list data structure


Hi all
Following piece of code is giving Undefined Reference error under g++.



list<CNode *> listN;

where CNode is a class.
It gives a run time error.
Thanx in advance
Ashwini
 
Old 04-29-2004, 05:11 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Code:
#include <list>
#include <iostream>

class CNode {
};

std::list<CNode *> listN;

int main() {
  std::cout << "Hey, I didn't crash\n";
}
Works fine for me. Could you be more spesific on what you do, what you get as an output and what did you expect.
 
  


Reply


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 error jacques83 Programming 20 04-11-2013 07:23 AM
Getting undefined reference to main error?? Mistro116@yahoo.com Programming 14 07-29-2011 08:28 AM
gcc ld error. Undefined reference redness Linux - Software 4 02-08-2005 02:01 AM
undefined reference error Quest101 Programming 3 01-01-2005 12:27 PM
Undefined reference to function error Quest101 Linux - Newbie 0 12-30-2004 05:01 PM


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

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