Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

zip7000

header, library what is it for?

This topic is 5690 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, I tried to compile a program that I got from a book but the following error comes up: g:\programmation\stydx7in24\source\hour 12\example\d3dutil.cpp(325) : fatal error C1010: unexpected end of file while looking for precompiled header directive Generating Code... Error executing cl.exe. the file d3dutil.cpp is at the right place. more generally what is the role of a header? (.h) what is the role of a library? (.lib) is there a difference between a .cpp and .lib file? what is the difference between : #include <file.h> and #include "file.h" thank you for any help you can give zip7000

Share this post


Link to post
Share on other sites
Advertisement
My understanding, the role of the header file is to declare the code you are gonna use. The role of the cpp file is to define the code you declared in the header file. A library file is a compiled version of a Cpp file, and is unreadable to the user so you could provide the header and the library file for people to use and they wouldn''t be able to modify your source.

would be if you were using the standard headers
"file.h" is if you are getting a header from your directory..

The error you get is probably because your project is trying to use precompiled headers and the code doesn''t use them.. Go to your project, right click, selecting properties. Then select the C/C++ tab, in the drop down, select precompiled headers and then say No to precompiled headers.

Oh, and if I got any of my understandings mixed up here, I am sure people will correct me and I can learn from this..

=*=
If things seem bad, think that they can get a whole load worse, and they don''t seem so bad anymore

=*=

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
hey zip7000. that sounds like a MSVC++ project problem. try adding a #include "stdafx.h" line at the top of each of your cpp files. assuming you have a stdafx.h file in your project files, that is. if not, then try what hammerstein_02 suggests.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!