Problem mit Visual C++ 6.0



  • Hallo, ich versuche gerade mit dem alten Visual C++ 6.0 eine Klasse zu erstellen ...

    test.cpp

    // test.cpp : Defines the entry point for the console application.
    //
    #include "stdafx.h"
    int main(int argc, char* argv[])
    {
    
    	std::cout<<"ok";
    
    	system("PAUSE");
    	return 0;
    }
    

    stdafx.h

    // stdafx.h : include file for standard system include files,
    //  or project specific include files that are used frequently, but
    //      are changed infrequently
    //
    
    #if !defined(AFX_STDAFX_H__B406AF03_C435_4211_9752_BB020476F175__INCLUDED_)
    #define AFX_STDAFX_H__B406AF03_C435_4211_9752_BB020476F175__INCLUDED_
    
    #if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000
    
    #define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
    
    #include <iostream>
    #include "Klassen\f.h"
    
    using namespace std;
    
    // TODO: reference additional headers your program requires here
    
    //{{AFX_INSERT_LOCATION}}
    // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
    
    #endif // !defined(AFX_STDAFX_H__B406AF03_C435_4211_9752_BB020476F175__INCLUDED_)
    

    f.h

    #ifndef fH
    #define fH
    
    #include <iostream>
    using namespace std;
    
    class call
    {
    
    	public:
    		void test();
    
    };
    
    extern call c;
    
    #endif
    

    f.cpp

    #include "Klassen\f.h"
    
    call c;
    
    void call :: test()
    {
     cout<<"test";
    }
    

    Compiler Fehlermeldung:

    --------------------Configuration: test - Win32 Debug--------------------
    Compiling...
    f.cpp
    e:\microsoft visual studio 6\myprojects\test\klassen\f.cpp(9) : fatal error C1010: unexpected end of file while looking for precompiled header directive
    Error executing cl.exe.
    
    test.exe - 1 error(s), 0 warning(s)
    

    Was mache ich da falsch? o_O



  • Fehlt da ein #include "stdafx.h" in f.cpp?



  • Ja genau das fehlte danke.


Anmelden zum Antworten