Welcome to the most active Linux Forum on the web.
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 04-29-2004, 03:19 AM   #1
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
Old 04-29-2004, 05:11 PM   #2
Senior Member
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
#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.


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?? 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 > Forums > Non-*NIX Forums > Programming

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

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
Open Source Consulting | Domain Registration