From: equine@eng.umd.edu
Newsgroups: comp.lang.c++
Date: 17 Jul 92 21:10 MDT
Subject: Problem compiling BC++ 3.0 code in 
Nf-ID: #N:1992Jul17.171019.4356@eng.umd.ed:-1438566115:001:3112
Nf-From: eng.umd.edu!equine    Jul 17 21:10:00 1992



Hi, I'm having some problems compiling code with BC++ 3.1 that worked
under version 3.0.  If anyone is familiar with the Object Graphics Library
(WhiteWater), MSWindows 3.1, and BC++ 3.1 I'd appreciate any suggestions.


I've tried similar definitions using int's instead of TColor's, and they
compile without problems.  Also, if I remove the "extern TColor" statements
I get "undefined" errors in the CLASMARK module.



// Header files for module TEST1.CPP - the code in this module compiles
// without errors in both BC++ versions 3.0 and 3.1.  This module is
// compiled first.

#include <windows.h>    // For MSWindows 3.1
#include <ogl.h>        // Object Graphics Library - TColor class defined
#include <gscrolle.h>   // code for window scroller bars.
#include <stdio.h>
#include "colors.h"
#include "menubutton.h" 
#include "clasmark.h"
#include "test1.h"
#define  WM_PARENTRESIZE WM_USER


.
.
.
.
.
.



---------------------------------------------------------------------

// Headers for module CLASMARK.CPP.  It is compiled after TEST1.CPP.
// BC++ version 3.0 compiles both modules without any errors, but the
// BC++ version 3.1 compiler outputs

// " Declaration Syntax Error "

// at     #include "colors.h"     for the "extern TColor" statements.

#if !defined CLASSIFICATION_INCLUDED
#define CLASSIFICATION_INCLUDED

#include <windows.h>
#include <ogl.h>       \
#include <rectangl.h>   \   // these are all part of
#include <label.h>      /   // Object Graphics Library
#include <textpen.h>   /
#include <string.h>
#define __colors__
#include "colors.h"                 // error occurs here
#include "clasmark.h"
.
.
.
.
.
.


---------------------------------------------------------------------

// Listing of header file COLORS.H
// color definitions

#if defined(__colors__)
TColor green     (  0, 255,   0);      // TColor's SetRGB (Red Green Blue)
TColor bkcolor   (  0, 128, 128);      // member function
TColor plum      (128,   0, 128);
TColor tealhatch ( 95, 159, 159);
TColor navy      (  0,   0, 128);
TColor medblue   ( 64,   0, 194);
TColor ltblue    (  0,  64, 128);
TColor white     (255, 255, 255);
TColor black     (  0,   0,   0);
TColor grey      (128, 128, 128);
TColor ltgrey    (192, 192, 192);
TColor red       (255,   0,   0);
TColor cyan      (  0, 255, 255);
TColor yellow    (255, 255,   0);
TColor gold      (255, 128,   0);
TColor blue      (  0,   0, 255);
TColor pink      (255,   0, 255);

#else
extern TColor green;       \
extern TColor bkcolor;      \
extern TColor plum;          \
extern TColor tealhatch;      \ 
extern TColor navy;            \
extern TColor medblue;          \
extern TColor ltblue;            \     Declaration Syntax Error
extern TColor white;              \    occurs for these statements.
extern TColor black;              /
extern TColor ltgrey;            /
extern TColor red;              /
extern TColor cyan;            /
extern TColor yellow;         /
extern TColor gold;          /
extern TColor blue;         /
extern TColor pink;        /

#endif

---------------------------------------------------------------------