Mam jakiś tam sobie programik, może być nawet najprostszy. Podczas kompilacji wykakuje mi jednak blad:
fatal error C1010: unexpected end of file while looking for precompiled header directive
Odrazu uprzedzajac krzykaczy, którzy odesla mnie na google, mowie ze szukalem w ten sposob, ale to nie rozwiązało mojego problemu. Wylaczam precompiled headers w opcjach (zgodnie ze wskazowkami z google...) i nagle z 1 w/w blędu robi mi sie [ 16 error(s), 27 warning(s) ]
Co jest 5? HLP?
Question:
I try to compile a program with Visual C++ .NET (dot-net) which was originally written for the Apple Macintosh for Objective-C. I keep getting the following error message:
"fatal error C1010 - unexpected end of file while looking for precompiled header directive"
I looked into the header file but cannot find anything to be missing.
Answer:
MFC programs use many libraries, requiring the use of many header files. To save time, the compiler tries to precompile most of these header files, and use the predigested data instead of reading through all of these header files on every compilation. There are a number of ways to do this. The standard method for MFC programs is to lump all of these common header file references into one header file ("stdafx.h"). If you just have to ask what "stdafx" means, it comes from the early name of MFC, which was AFX (application framework).
When compiling each source (.cpp) file, the compiler skips through the source code, looking for the directive:
#include "stdafx.h"
Once it finds this directive, it substitutes the precompiled header information and then begins compiling the rest of the file. If your source file doesn't contain this directive, you get the C1010 error described above.
The simple solution is to insert the include directive to your source file, before any other library references or other code.
wow dzieki stary? wiec co mam zrobic?
Jezeli dobrze go zrozumiałem to musisz biblioteki dodać do programu
include "stdafx.h" dodaj to do programu prz wszystkimi innymi bibliotekami tak dalej na samej gorze
kompilowanie nie jest dostepne w Twoim kraju
You can go to Project/Project Settings in the menu, choose "C/C++" tab
and check the Automatic Use of Precompiled Headers Options with
the file "stdafx.h" being in the "Through Header" edit box.
fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
i w kolko to samo, jak nie ten pierwszy blad to taki
^^ EOT
wyłącz w opcjach kompilatora prekompilowany nagłówek albo ustaw jego automatyczne generowanie (jeśli chcesz z niego korzystać). To nie ma nic wspólnego z zapodanym przez Ciebie kodem.
Project/Project settings
Zakładka"
C/C++
Category: Precompiled headers
lol fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
to nie brakuje biblioteki w kompilatorze? jakiego uzywasz? do dev cpp brakuje tego DUUUUUUUUUUzo
wyłącz w opcjach kompilatora prekompilowany nagłówek albo ustaw jego automatyczne generowanie (jeśli chcesz z niego korzystać). To nie ma nic wspólnego z zapodanym przez Ciebie kodem.
Project/Project settings
Zakładka"
C/C++
Category: Precompiled headers
sorry za double posta cos sie wali ...
Wylaczam precompiled headers w opcjach
fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
bede pozniej lece na egzamin , ktos CI na bank pomoze
wypisz wariningi
wogole to polecam visual studio z msdnaa
Repomaniak uzywam Visuala jak w temacie
no to nie wiem
ja tylko wkleilem blad do googla ;p
Uwielbiam takich "pomocnikow". Nie lepiej zając sie czyms pozytecznym niz siedziec na nw i pisac bzdury?
omg co za żenada...
Ćwierćinteligencie zrób tak jak piszę [#13] WidzeCoPiszesz
oraz usuń linię:
#include "stdafx.h"
i to jest ten kwiat polskich inżynierów, rzygać się chce...
Nie pozdrawiam,
[FBI]ProTerran
kretynie, myślisz że nie próbowałem??
P.S
Cwierćinteligent to twoj stary. thx
#include "stdafx.h" i "stdafx.cpp" a w ogole masz takie plik w katalogu swoim? Bo to nie jest jakas odzielna biblioteka tylko Twoj wlasny plik.
ogolnie to w visualu musisz miec(tak mi sie wydaje, bo malo z niego korzystalem)
stdafx.cpp i stdafx.h
stdafx.h wyglada mniej wiecej tak
#pragma once
#include "targetver.h" // to jest raczje zbedne ;p
#include <stdio.h>
#include <tchar.h>
#include <iostream>
#include <string>
a stdafx.cpp tak
#include stdafx.h
a w swoim programie dajesz tylko
#include "stdafx.h" nie wiem u mnie to tak dziala mozliwe ze sie myle bo to troche dziwne srodowisko jest ;x ( tak jestem nabem)
aha i mam visuala 2k8