[Dev-C++] Problem with header, skipping lines?, or what???
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <ten...@ne...> - 2003-08-31 17:27:53
|
I'm just making a project, there I have two sources and one header,
which is includedin both source files.
The header is
#ifndef CGMSTRING_H
#define CGMSTRING_H
#include <string>
using std::string;
class String : public string{
etc
#endif
Then the two source files including cgmstring.h. One have the main
function and the other is the implementation of a class, which has its
header.
The problem is that either compiling trhough a makefile or thropugh
building a project with Dev, the header is included for both sources in
their object files, so when it's the time for the linker it says all the
functions of cgmstring.h (three constructors, one for c_str() and
another vc_str()) are declared twice: in main.o and in class.o. But if I
say, when compiling to .o in either one of the sources, -D CGMSTRING_H,
then the compiler reports that String has not been declared!.
It's the first time I find this, always before it worked fine, why
happens this now, what can be the problem?
|