🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #42854

Re: "Undefined reference" error message.

#42854
From: Martin Sieler
Date: Mon, 30 Oct 1995 00:00
36 lines
1898 bytes
rfalanga@numex.unm.edu (Rod Falanga) wrote:
>I am sure that I am doing something silly, but I'm too close to the situation
>to see it.  I've got a simple C++ program I'm writing, with 2 .C files and a
>single .H file.  At this point, I have only one class defined called Rates.
>When I compile the code with gcc ver. 2.4 the next executable line after the
>instantiation of a Rates variable returns the following error message:
>
>               undefined reference to `Rates::Rates(void)'
>
>What am I doing wrong?

Well, to me it looks like you forgot to define a constructor for your class -
or at least you didn't define a constructor with void args (no arguments).
Beside that, you should have posted some lines of your code - otherwise it's
just gessing your real problem.

class Rates
  {
  // constructor, destructor
  Rates()  { /* do your init stuff */ }
  ~Rates() { /* destructor */         }

  // other members
  };

hope that helps.
-- 
========================================================
Martin Sieler
Fraunhofer Institute for Integrated Circuits (FhG-IIS-A)
Am Weichselgarten 3
D-91058 Erlangen, Germany
Phone : +49 9131 776-353
Fax   : +49 9131 776-399
E-mail: sir@iis.fhg.de
========================================================
Technical Details
Message-ID: <4738f9$114@iis.iis.fhg.de>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <RFALANGA.95Oct28080208@numex.unm.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,108cdbf98ad366c7
X-Google-Attributes: gid11318c,public
From: Martin Sieler <sir@iis.fhg.de>
Subject: Re: "Undefined reference" error message.
Date: 1995/10/30
Message-ID: <4738f9$114@iis.iis.fhg.de>
X-Deja-AN: 118303491
references: <RFALANGA.95Oct28080208@numex.unm.edu>
content-type: text/plain; charset=us-ascii
organization: Fraunhofer Institut fuer Integrierte Schaltungen IIS-A
x-url: news:RFALANGA.95Oct28080208@numex.unm.edu
mime-version: 1.0
newsgroups: gnu.gcc.help
x-mailer: Mozilla 1.1N (X11; I; SunOS 4.1.3 sun4m)