Jump to content
  • Advertisement


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


What does this error mean?

This topic is 6033 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

I keep getting the following error in Borland C++ when I try to compile my program: Module.h(21,3):Cannot create pre_compiled header: code in header What does this mean? Here's the header file that causes the error:
//Class declaration

class Module
   	Module *next;
        Module *prev;
   	void set_name(char *);
        void set_semester(int);
	char *get_name();
        int get_semester();

   	char name[40];
        int semester;
//End of class declaration

//Member functions definition

void Module::set_name(char *supp_name)
	strcpy(name, supp_name);

void Module::set_semester(int supp_semester)
	semester = supp_semester;


char *Module::get_name()

int Module::get_semester()
//End of member functions definition

[edited by - blue_harvester on April 17, 2002 2:28:46 PM]

Share this post

Link to post
Share on other sites
The problem is that you can''t write code in headers.

You have to split the header. Leave the class declaration in the header and move the class code to a .c file.

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!