|
From: Ioannis V. <no...@ya...> - 2002-02-05 03:30:55
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Horst Roessner
> Sent: Monday, February 04, 2002 11:58 PM
> To: dev...@li...
> Subject: [Dev-C++] Re: linking problem
>
>
> Hi Ioannis,
>
> of course, there is one. I have the code truncated.
> Here the first part of it.
>
> [...]
>
> arrhenius::arrhenius()
> {
> }
>
> bool arrhenius::calc()
> {
> for (int i = 0; i < K; i++)
> {
> for (int j = 0; j < aN[i]; j++)
> {
> aSY[i] += aY[j][i];
> aSSY[i] += sqr(aY[j][i]);
> } // for j
> aMean[i] = aSY[i] / zw.M;
> zw.SY += aSY[i];
> zw.SX += aN[i] * aX[i];
> zw.SSX += aN[i] * sqr(aX[i]);
> [...]
>
> the code is very long. The project is just at the begin.
> There are oly link errors but no compiler errors.
> Horst
You must include these definitions in the header file. Also you must
remove the #ifndef from your main.cpp.
I mean this:
#include <cstdlib>
#ifndef arrh_H
#include "arrh.h"
#endif
should become this:
#include <cstdlib>
Also remove the #endif from the main.cpp. The #ifndef #endif should be
placed in the header files only. I mean your header file should become:
#ifndef arrh_H
#define arrh_H
[...]
class arrhenius
{
public:
arrhenius();
[...]
bool calc();
} arh;
// Member function definitions here
#endif
No other macros in main.cpp. Also better choose longer name in the place
of arrh_H.
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.d2g.com
* Alternative URL: http://run.to/noicys
|