Advertisement

Game Programming Guru's Chap 1 - getting whole project to compile in VisC++

Started by May 22, 2002 08:58 PM
3 comments, last by Underdawg 22 years, 7 months ago
I am as green as we newbies get. =] This is a great book! I do Java by day but don''t hold that against me. Been a while since I''ve done C++, but am diggin'' the book and want to follow along. I am trying to get oriented in Vis C++ by adding his blackbox.cpp, freakout.cpp, blackout.h. I even added the ddraw.lib to my Win32.exe app. I keep getting these errors: --------------------Configuration: FreakOut - Win32 Debug-------------------- Compiling... blackbox.cpp c:\program files\microsoft visual studio\myprojects\freakout\blackbox.cpp(413) : fatal error C1010: unexpected end of file while looking for precompiled header directive FreakOut.cpp c:\program files\microsoft visual studio\myprojects\freakout\freakout.cpp(604) : fatal error C1010: unexpected end of file while looking for precompiled header directive Generating Code... Error executing cl.exe. FreakOut.exe - 2 error(s), 0 warning(s) I am reading through the help docs and a Using Vis C++ book, but not finding the answers I need. I have seen some great help in this forum, and was crossing my fingers to get the same. Thanks for any help I can get. Thanks, Padawan Learner
The strangest life I''ve ever known.-Jim
ok found answer at post 95806, but then that only got me as far as he is . . . . after turning off precompiled headers I get 4 errors:

--------------------Configuration: FreakOut - Win32 Debug--------------------
Compiling...
blackbox.cpp
c:\program files\microsoft visual studio\myprojects\freakout\blackbox.h(34) : error C2146: syntax error : missing '';'' before identifier ''lpdd''
c:\program files\microsoft visual studio\myprojects\freakout\blackbox.h(34) : fatal error C1004: unexpected end of file found
FreakOut.cpp
c:\program files\microsoft visual studio\myprojects\freakout\blackbox.h(34) : error C2146: syntax error : missing '';'' before identifier ''lpdd''
c:\program files\microsoft visual studio\myprojects\freakout\blackbox.h(34) : fatal error C1004: unexpected end of file found
Generating Code...
Error executing cl.exe.

FreakOut.exe - 4 error(s), 0 warning(s)
The strangest life I''ve ever known.-Jim
Advertisement
Tools->Options...->Directories->Includes, Libraries

You haven''t properly set up your header and library files. MSVC comes with old DX headers and libs, so you need to specify to the IDE in the above indicated dialog box where to search for files. Remember to move any paths you add to the top; MSVC searches top-down.
Yo great job on that Oluseyi! I looked under Tools->Options->"Show DIrectories For ''pull down menu''". I looked at the include files and the library files. They both seemed to be pointing to the right place in VC98, however, when I read the guru book, it said to reference HIS DirectX files in HIS dirs. Turns out, his DDraw.h is version 0x006 whereas the VC++ DDraw.h is version 0x005!! So when I pointed my include dir and my lib dir at his files, I get no errors, yet I get 2 warnings:
--------------------Configuration: FreakOut - Win32 Debug--------------------
Compiling...
blackbox.cpp
FreakOut.cpp
c:\program files\microsoft visual studio\myprojects\freakout\freakout.cpp(149) : warning C4101: ''ps'' : unreferenced local variable
c:\program files\microsoft visual studio\myprojects\freakout\freakout.cpp(148) : warning C4101: ''hdc'' : unreferenced local variable
Generating Code...
Linking...

FreakOut.exe - 0 error(s), 2 warning(s)

But when I build FeakOut.exe I get 0 warnings 0 errors! I just ran the game and it finally works! Thanks alot! I will be stepping through this book all week, so for everyone else who wants to follow along, follow this thread!
The strangest life I''ve ever known.-Jim
The warning - " C4101: ''ps'' : unreferenced local variable " means that when created the variable wasn''t assigned a value.
masterghttp:/masterg.andyc.org

This topic is closed to new replies.

Advertisement