Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie trying to use #ifndef

Status
Not open for further replies.

jonnyknowsbest

Technical User
Feb 3, 2004
163
GB
I have a header file, and i am trying to get to grips with #ifndef, but i keep getting the following error message:
fatal error C1070: mismatched #if/#endif pair in file 'c:\program files\microsoft visual studio\vc98\include\conlib.h'

See code below:

/* Conlib.h */

/* NOTE: The original version included a #pragma once to check for redefinition, but i opted to change this to an #ifndef just to prove that i was paying attention to the tutorial */

/* Do a IFNDEF to make sure avoid redefinition */
#ifndef _CONLIB_H_
#define _CONLIB_H_

/* Windows standard header file */
#include <windows.h>

/* Conlib color codes */
enum ConColor
{
ConRed = 1,
ConGreen = 2,
ConBlue = 4
};

/* Conlib control class */
class ConLib
{
/* Screen and keyboard handles */
HANDLE m_Screen;
HANDLE m_Keyboard;

/* Color attributes */
WORD m_TextColor;
WORD m_BackgroundColor;

public:

/* Constructor / Destructor */

ConLib ();
~ConLib ();

/* Set attributes */
void SetBackgroundColor (WORD Color);
void SetTextColor (WORD Color);
void SetTitle (char * Title);
void SetPosition (COORD Position);

/* Output methods */
void Clear (void);
void OutputString (char * String);

/* Input methods */
void Read (char * Buffer, DWORD BufferSize);
int GetKey (void);
};
#endif
 
as I see, I believe your _CONLIB_H_ conflicts with a VisualC++ library located in predefined VisualStudio include directory. Change it to some _CON_MY_LIB_H_

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top