Thread: VC 6.0 compiled error

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    4

    VC 6.0 compiled error

    Pardon me, I had posted this in the Homework thread. Kermi, please ignore that posting. Hope this posting is now in NEW thread.


    Please let me know if this posting is not appropriate here. In this case, please give me the appropriate place for this posting.


    I copied and pasted a C++ example that is supposed to work. See Below, but I got a compiled error: code 1083.

    ==============================================
    ==============================================
    #include "stdafx.h"
    #include "resource.h"
    #include "GetWindow.h"
    #include "GetWindowDlg.h"


    #ifdef _DEBUG
    #undef THIS_FILE
    static char BASED_CODE THIS_FILE[] = __FILE__;
    #endif


    BEGIN_MESSAGE_MAP(CGetWindowApp, CWinApp)
    ON_COMMAND(ID_HELP, CWinApp::OnHelp)
    END_MESSAGE_MAP()


    CGetWindowApp::CGetWindowApp()
    {

    }

    BOOL CGetWindowApp::InitInstance()
    {
    CGetWindowDlg dlg;
    m_pMainWnd = &dlg;
    int nResponse = dlg.DoModal();

    return FALSE;
    }

    CGetWindowApp theApp;

    ==================================================
    ==========================================

    The output result below displays compiled error. Can someone correct it? I am puzzled at this error, because I did not add any file called GetWindow.pch.


    --------------------Configuration: GetWindow - Win32 Debug--------------------
    Compiling...
    GetWindow.cpp
    c:\unzipped\code_upload13544182001\getwindow.cpp(1 ) : fatal error C1083: Cannot open precompiled header file: 'Debug/GetWindow.pch': No such file or directory
    Error executing cl.exe.

    GetWindow.obj - 1 error(s), 0 warning(s)

  2. #2
    Registered User Esss's Avatar
    Join Date
    Aug 2001
    Posts
    133
    You have precompiled headers enabled, but you haven't included the precompiled header generation file.

    Add stdafx.cpp back to your project, and set it for 'Create precompiled header' (right-click on file in FileView, Settings, C/C++ tab, category 'Precompiled headers', select 'Create precompiled header file (.pch)' through 'stdafx.h'.
    Ess
    Like a rat in a maze who says,
    "Watch me choose my own direction"
    Are you under the illusion
    The path is winding your way?
    - Rush

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    4
    I want to inform you something else before I go into this.

    I now realize that all VC++ samples are not performing properly on my VC 6.0. For example, I clicked on the .dsw file (the existing work file) of an example and then it listed all files in CLASSFIEW and FILEVIEW into the VC 6.0 as expected. Then I assumed the next thing to do is to click on BUILD. But then the BUILD PROCESS was not able to end. There was no COMPILED messages. It became clear that the BUILD process was on hang.
    It remained the same with other examples. Each example have multifiles of cpp and h, but it should not matter.

    I wonder if it has something to do with the settings under PROJECT like you mentioned. I noticed that the object/library modules in the LINK tab is all empty.

  4. #4
    Registered User Esss's Avatar
    Join Date
    Aug 2001
    Posts
    133
    > I noticed that the object/library modules in the LINK tab is all empty.

    This is normal; the library references are embedded in the header files.

    It sounds as if your installation is corrupt. Make sure you have the latest Service Packs for your OS and for VC (SP6a for NT4, SP2 for Win2k, SP4 for VC). If that fails to resolve your problem, try reinstalling.
    Ess
    Like a rat in a maze who says,
    "Watch me choose my own direction"
    Are you under the illusion
    The path is winding your way?
    - Rush

  5. #5
    Registered User
    Join Date
    Sep 2001
    Posts
    4
    Your correct about the empty of object/library modules!
    It do not need them at this present time.

    It looks like my installation is corrupt, but there is one MS program called Scribble. It contained 7 separate independent program files; the first file started with STEP ONE, 2nd file with STEP TWO and so on.
    Only STEP TWO through STEP FIVE files of Scribble dsw files can work normally. The rest are not. I wonder if those are not working are still under development for further editing. But it does not make sense, because the dsw files are supposed to be able to compile/link and execute; otherwise no DSW files can be created! Right?


    Regarding the other samples that are accompanied on MDSN Library CDS with this VC 6.0 package. I begin to wonder if these MDSN Library CDS are not quite updated (dated 1992-1998) on VC 6.0 purchase a few months ago. They may be bundled together inspite of difference in "versions"

    I hope my installation is not corrupt. I think I will have to import files from those samples into my VC 6.0 and then do compile/link/execute on my Studio. What do you think? But I lack experience in doing this; time consuming, but perhaps it will help gain experience if doing properly.

    I think my VC 6.0 is SP5. I dont know how to find SP on those samples I run. If the samples are SP4 or before, how do I backward compatible them on my VC?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Testing some code, lots of errors...
    By Sparrowhawk in forum C Programming
    Replies: 48
    Last Post: 12-15-2008, 04:09 AM
  2. Errors including <windows.h>
    By jw232 in forum Windows Programming
    Replies: 4
    Last Post: 07-29-2008, 01:29 PM
  3. Avoiding Global variables
    By csonx_p in forum Windows Programming
    Replies: 32
    Last Post: 05-19-2008, 12:17 AM
  4. Connecting to a mysql server and querying problem
    By Diod in forum C++ Programming
    Replies: 8
    Last Post: 02-13-2006, 10:33 AM
  5. Problem with Visual C++ Object-Oriented Programming Book.
    By GameGenie in forum C++ Programming
    Replies: 9
    Last Post: 08-29-2005, 11:21 PM