[computer-go] C++: #include vs .h files

Peter Drake drake at lclark.edu
Wed Aug 9 15:02:23 PDT 2006


Okay, I'll try cleansing my .h files of definitions. Stay tuned.

(Is it okay to declare object fields in .h files?)

Peter Drake
Assistant Professor of Computer Science
Lewis & Clark College
http://www.lclark.edu/~drake/




On Aug 9, 2006, at 2:55 PM, Weston Markham wrote:

> Most likely, you have a definition in a .h file.  This can be legal,
> but you may need to mark it "inline".  Any chance you can post a
> concise example?  (what minimal declarations & definitions in which
> files will demonstrate the problem)
>
> Weston
>
> On 8/9/06, Peter Drake <drake at lclark.edu> wrote:
>>
>> Thanks for the quick response on the array passing. I think I get  
>> it now.
>>
>> I'm having a devil of a time trying to divide my classes  
>> between .h and .cpp
>> files. Specifically, if I have the same #include in several .cpp  
>> files, I
>> get complaints about redundant definitions from the linker. I can  
>> avoid this
>> by putting everything in the .h files (except for one .cpp file),  
>> but then I
>> can't define classes that depend on each other.
>>
>> Any advice?
>>
>>
>> Peter Drake
>> Assistant Professor of Computer Science
>> Lewis & Clark College
>> http://www.lclark.edu/~drake/
>>
>>
>>
>>
>>
>> _______________________________________________
>> computer-go mailing list
>> computer-go at computer-go.org
>> http://www.computer-go.org/mailman/listinfo/computer-go/
>>
>>
> _______________________________________________
> computer-go mailing list
> computer-go at computer-go.org
> http://www.computer-go.org/mailman/listinfo/computer-go/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://computer-go.org/pipermail/computer-go/attachments/20060809/8d057a5d/attachment.htm


More information about the computer-go mailing list