[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 205
  • Last Modified:

CString and Link Errors

I asked why I got all those error. This is not a question but the answer for the experts who tried to help.  I appreciate that.The real problem was that the code was sent to me by someone using an newer compiler and he used the header stdafx.h. That is not where CString is defined in VC 4.0. It is in afx.h..... I got a compile and run after that simple change....
0
Cyberdater
Asked:
Cyberdater
  • 2
  • 2
1 Solution
 
CyberdaterAuthor Commented:
Edited text of question
0
 
nietodCommented:
Thanks for letting us know.
0
 
RONSLOWCommented:
Your stdafx.h should INCLUDE afx.h anyway.

Try creating a new project with AppZiard and get the stdafx.h from that.

0
 
CyberdaterAuthor Commented:
I generated both an Application and Console workspace before and after I inserted the .cpp.  Also if I include stdafx.h as well as afx.h I get into errors.  I read the stdafx.h and it does contain afx.h in the core headers.  Something really odd to me is that stdafx.h is located in mfcdevstd\mfc\src instead of mfcdevstd\mfc\include and the applications cannnot find it until I put the src into the include paths under options..directory.
0
 
RONSLOWCommented:
you should have your own stdafx.h (make a copy of the one in MFC source or use the one AppWizard writes for you).  Don't directly refer to the one in MFC source area.

do NOT put any code or preprocessor statments before #include "stdafx.h" as any lines there are ignored when precompiled headers are used.

0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now