Click here to Skip to main content
16,004,882 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Compiling errors Pin
Mike Dimmick7-Oct-03 23:11
Mike Dimmick7-Oct-03 23:11 
GeneralRe: Compiling errors Pin
FlyingDancer8-Oct-03 0:34
FlyingDancer8-Oct-03 0:34 
GeneralRe: Compiling errors Pin
Anand Paranjpe7-Oct-03 23:29
Anand Paranjpe7-Oct-03 23:29 
GeneralRe: Compiling errors Pin
FlyingDancer8-Oct-03 0:42
FlyingDancer8-Oct-03 0:42 
GeneralIExtractImage not working for Internet-Shortcuts (.url) Pin
ohadp7-Oct-03 22:41
ohadp7-Oct-03 22:41 
GeneralProblem with 'struct' in the same file as 'class'. Pin
WREY7-Oct-03 22:30
WREY7-Oct-03 22:30 
GeneralRe: Problem with 'struct' in the same file as 'class'. Pin
Mike Dimmick7-Oct-03 23:09
Mike Dimmick7-Oct-03 23:09 
GeneralRe: Problem with 'struct' in the same file as 'class'. Pin
WREY8-Oct-03 10:40
WREY8-Oct-03 10:40 
Thanks for replying. (Of the others that have been posted, your's make the most sense.)

Here's the code for the struct file:
#idndef STRUCT_H
#define STRUCT_H
struct  FirstStruct
{ etc. };
struct SecondStruct
{ etc. };
  ...
struct ThisStruct    // this is the one I physically removed
{ etc. };
#endif  // STRUCT_H
Here's the file containing the new class:
#idndef HDR_H
#define HDR_H
struct ThisStruct    // this is where it now physically exists
{ etc. };
class NewClass
{ ctor; dtor; etc. };

#endif  // HDR_H
Clearly it's a Visual C++ misdoing, because there's no C++ syntactical error involved, and if I were to put the 'struct' back to where it was originally located, the program compiles and links well. Then if I were to replace it back with the new class again, the linker acts up and produces the error. Next, if I were to comment out the 'struct' (where it exists in the file with the new class) it compiles and links well. It's ONLY when it appears openly (but separately and apart) from the new class, that the LNK2005 error message reappears.

Of the many situations I tried in getting it resolved, more than half of them involved doing a total "Rebuild all", but the problem still persist.

Yes, I've also deleted the ".ncb" file and a few others too, followed by a "Rebuild all". No difference.

Confused | :confused:


William

Fortes in fide et opere!
GeneralRe: Problem with 'struct' in the same file as 'class'. Pin
Mike Dimmick9-Oct-03 0:24
Mike Dimmick9-Oct-03 0:24 
GeneralFound it !! Pin
WREY9-Oct-03 6:58
WREY9-Oct-03 6:58 
GeneralRe: Problem with 'struct' in the same file as 'class'. Pin
WREY9-Oct-03 10:46
WREY9-Oct-03 10:46 
GeneralRe: Problem with 'struct' in the same file as 'class'. Pin
Mike Dimmick9-Oct-03 22:45
Mike Dimmick9-Oct-03 22:45 
GeneralRe: Problem with 'struct' in the same file as 'class'. Pin
WREY9-Oct-03 23:29
WREY9-Oct-03 23:29 
GeneralRe: Problem with 'struct' in the same file as 'class'. Pin
Mike Dimmick10-Oct-03 0:34
Mike Dimmick10-Oct-03 0:34 
GeneralRe: Problem with 'struct' in the same file as 'class'. Pin
Anthony_Yio8-Oct-03 1:23
Anthony_Yio8-Oct-03 1:23 
GeneralRe: Problem with 'struct' in the same file as 'class'. Pin
David Crow8-Oct-03 2:52
David Crow8-Oct-03 2:52 
GeneralRe: Problem with 'struct' in the same file as 'class'. Pin
Anthony_Yio8-Oct-03 16:48
Anthony_Yio8-Oct-03 16:48 
GeneralRe: Problem with 'struct' in the same file as 'class'. Pin
WREY8-Oct-03 9:50
WREY8-Oct-03 9:50 
GeneralRe: Problem with 'struct' in the same file as 'class'. Pin
Anthony_Yio8-Oct-03 16:26
Anthony_Yio8-Oct-03 16:26 
Generalstatic libraries & templates Pin
Themis7-Oct-03 22:21
Themis7-Oct-03 22:21 
GeneralRe: static libraries & templates Pin
Anthony_Yio8-Oct-03 1:03
Anthony_Yio8-Oct-03 1:03 
GeneralRe: static libraries & templates Pin
ZoogieZork8-Oct-03 5:18
ZoogieZork8-Oct-03 5:18 
GeneralRe: static libraries & templates Pin
cmk8-Oct-03 9:55
cmk8-Oct-03 9:55 
GeneralSecure wireless pc Pin
aprogrammer20027-Oct-03 21:52
aprogrammer20027-Oct-03 21:52 
GeneralMultiple choice..Creating Splitter windows Pin
DarkestDreams7-Oct-03 21:24
sussDarkestDreams7-Oct-03 21:24 

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.