|
From: Ioannis V. <no...@ya...> - 2002-02-05 03:44:31
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Ioannis Vranos
> Sent: Tuesday, February 05, 2002 5:30 AM
> To: Dev-C++
> Subject: RE: [Dev-C++] Re: linking problem
>
>
> 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.
Also as Luigi Santillo said you should remove the object definition from
the header file and place it in the main.cpp. If you want a global
object, define it outside main().
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.d2g.com
* Alternative URL: http://run.to/noicys
|