Click here to Skip to main content
15,918,808 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: get exe path Pin
Marcus Spitzmiller9-Mar-05 14:59
Marcus Spitzmiller9-Mar-05 14:59 
GeneralRe: get exe path Pin
gamitech9-Mar-05 21:13
gamitech9-Mar-05 21:13 
Generalmergesort Pin
Ylis9-Mar-05 9:24
Ylis9-Mar-05 9:24 
Generalhelp me!!! Pin
kookoorikoo9-Mar-05 9:06
kookoorikoo9-Mar-05 9:06 
GeneralRe: help me!!! Pin
Ylis9-Mar-05 9:27
Ylis9-Mar-05 9:27 
GeneralProblem with main MDI Frame window Pin
Anonymous9-Mar-05 8:56
Anonymous9-Mar-05 8:56 
GeneralRe: Problem with main MDI Frame window Pin
Ryan Binns9-Mar-05 17:30
Ryan Binns9-Mar-05 17:30 
GeneralInclude Help Needed Pin
Jeryth9-Mar-05 7:53
Jeryth9-Mar-05 7:53 
I've got a bit of trouble figuring out the proper way to include classes and headers. Now as I've always been taught, you should type out a class declaration in a header file and leave the definition for the cpp file. Then when that's completed, you should only #include header files. That's the "etiquette" I've been taught anyway so that's what I'm employing here. Though I'm beginning to think some of my professors who cling to that are rather daft.

Now on to the problem. I have Class A that is required for Class B. Now Classes C and D both require Class B. Class E requires Classes A and C. Finally Class F requires D and E. Lost you yet? Maybe this will help:

    Class A
    /       \
Class B      \
  |   \       \
Cls D  Cls C  |
  |       \   |
   \       Class E
    \      /
     Class F

Now each individual cpp compiles lovely, the problem comes when linking. The errors always point to Class A so I'm pretty sure that it's getting included twice somehow. I'm using blocks like this at all include points, on cpp and h files, to try to keep something from including twice:

#ifndef CLASS_A_INC<br />
#define CLASS_A_INC<br />
#include "CLASS_A.h"<br />
#endif


Despite all this I can't get the linking errors to go away. Help please?

The question "Do computers think?" is the same as "Can submarines swim?"
Signature Red Studios

Jeryth
GeneralRe: Include Help Needed Pin
David Crow9-Mar-05 8:06
David Crow9-Mar-05 8:06 
GeneralRe: Include Help Needed Pin
Jeryth9-Mar-05 13:12
Jeryth9-Mar-05 13:12 
GeneralRe: Include Help Needed Pin
Steen Krogsgaard9-Mar-05 22:01
Steen Krogsgaard9-Mar-05 22:01 
GeneralRe: Include Help Needed Pin
Jeryth10-Mar-05 1:11
Jeryth10-Mar-05 1:11 
GeneralRe: Include Help Needed Pin
Steen Krogsgaard10-Mar-05 1:25
Steen Krogsgaard10-Mar-05 1:25 
GeneralRe: Include Help Needed Pin
Jeryth10-Mar-05 5:18
Jeryth10-Mar-05 5:18 
GeneralRe: Include Help Needed Pin
Steen Krogsgaard10-Mar-05 5:27
Steen Krogsgaard10-Mar-05 5:27 
GeneralRe: Include Help Needed Pin
Jeryth10-Mar-05 6:11
Jeryth10-Mar-05 6:11 
GeneralRe: Include Help Needed Pin
Steen Krogsgaard 210-Mar-05 7:34
Steen Krogsgaard 210-Mar-05 7:34 
GeneralRe: Include Help Needed Pin
Jeryth14-Mar-05 5:50
Jeryth14-Mar-05 5:50 
GeneralRe: Include Help Needed Pin
Steen Krogsgaard 214-Mar-05 9:32
Steen Krogsgaard 214-Mar-05 9:32 
GeneralRe: Include Help Needed Pin
Jeryth14-Mar-05 17:29
Jeryth14-Mar-05 17:29 
GeneralRe: Include Help Needed Pin
Steen Krogsgaard 217-Mar-05 7:15
Steen Krogsgaard 217-Mar-05 7:15 
GeneralRe: Include Help Needed Pin
Steen Krogsgaard10-Mar-05 1:28
Steen Krogsgaard10-Mar-05 1:28 
GeneralRe: Include Help Needed Pin
Jeryth10-Mar-05 4:40
Jeryth10-Mar-05 4:40 
Generalexecution! Pin
mpapeo9-Mar-05 7:42
mpapeo9-Mar-05 7:42 
GeneralRe: execution! Pin
David Crow9-Mar-05 8:12
David Crow9-Mar-05 8:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.