Advertisement

newbie question, i really do not get this compile error

Started by June 11, 2002 02:22 PM
5 comments, last by blind spy 22 years, 5 months ago
well i am currently trying to learn to use the morfit 3d game engine, so that i can actually make a few games with it then work on my own engine. anyway i tried to compile one of the sample programs and this what i get

--------------------Configuration: mf - Win32 Debug--------------------
Compiling...
main.cpp
C:\Program Files\DevStudio\MyProjects\mf\main.cpp(53) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe.

mf.exe - 1 error(s), 0 warning(s)
 
here is the source code:


#include "..\\..\\..\\Engine\\Include\\mrft_api.h"
#include <iostream.h>

void main(void)
{
	void Move_camera(DWORD camera);

	int rc = Morfit_engine_load_world ( "firstworld.wld", ".", "Bitmaps", USER_DEFINED_BEHAVIOR);
	if(rc==VR_ERROR) {
		cout << "Failed to load world, aborting\n";
		cout << "look at error.log to see why\n";
		return;
	}
	
	Morfit_engine_set_default_rendering_window_title("To move the camera, use arrow keys, ''f'', ''b''    -  Exit");
	Morfit_engine_maximize_default_rendering_window();
	ShowCursor(FALSE);  // Hide the cursor

	DWORD camera=Morfit_camera_get_default_camera();

	Morfit_camera_set_chase_type(camera,NO_CHASE);

	while( (GetAsyncKeyState(VK_ESCAPE)==0 ) {
		Move_camera(camera);
		Morfit_engine_render(NULL,camera);	
	}
}

void Move_camera(DWORD camera)
{
	double x,y,z;

	//Gets camera''s location coordinates 
	Morfit_camera_get_location(camera, &x,&y,&z);

	if(GetAsyncKeyState(VK_UP) < 0) // move camera up
		z +=25;
	if(GetAsyncKeyState(VK_DOWN) < 0) // move camera down
		z -=25;
	if(GetAsyncKeyState(VK_RIGHT) < 0) // move camera right
		y +=25;
	if(GetAsyncKeyState(VK_LEFT) < 0) // move camera left
		y -=25;
	if(GetAsyncKeyState(''B'') < 0) // move camera back
		x +=25;
	if(GetAsyncKeyState(''F'') < 0) // move camera forward
		x -=25;

	Morfit_camera_set_location(camera, x, y, z);
	return;
}

 
help would be appreciated!
Quick fix:

(Assuming VC++)
Project->Settings->C/C++
Select Category->Precompiled Headers
Select "Not using precompiled headers"
Advertisement
well when i started to use vc++ i got an error like that... go into like preferences or something and disable precompiled headers or something then start over with a new file...
Ok, the problem is that VC++ is looking for a pre-compiled header (.PCH) file to use, but it doesn''t exist.

The easiest thing to do is just not use precompiled headers.
To turn this feature off, do the following:

Go to Project -> Settings... -> C/C++

For Category, choose "Precompiled Headers"

Select "Not using precompiled headers"


The only real use for them is to speed up compilation. You don''t really need to worry about that until your projects get REALLY large.


Cheers
Another solution is to include the according header file (usually "stdafx.h") on top of each .c/.cpp-file. This has allready been disussed in the forum. Use the search function if you need more information.
thanks everyone
Advertisement
quote: Original post by Dez
The only real use for them is to speed up compilation. You don''t really need to worry about that until your projects get REALLY large.

I disagree and think that everyone should be using PCH. I notice the compile time difference even if only including windows.h at my 1.5 gig Athlon.
---visit #directxdev on afternet <- not just for directx, despite the name

This topic is closed to new replies.

Advertisement