Re: [Dev-C++] Problem with header, skipping lines?, or what???
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: David M. <ci...@ya...> - 2003-08-31 19:02:48
|
I will make one assumption. There is no cgmstring.cpp which
contains all the
function definitions (the actual code for the functions).
If this is the
case then that is the problem. Youy have to put all the
functions in this
form into the .cpp file.
void String::some_function(void)
{
.....
}
You can only leave inline functions in the header
(including those in the
class definition)
Hope this helps.
David McKen
----- Original Message -----
From: "Carlos García del Monte" <ten...@ne...>
To: "Dev-C++ mail list"
<dev...@li...>
Sent: Sunday, August 31, 2003 1:25 PM
Subject: [Dev-C++] Problem with header, skipping lines?, or
what???
> 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?
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE:
http://www23.brinkster.com/noicys/devcpp/ub.htm
>
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
|