MPKLodz pisze:10 27 C:\Users\Michał\Desktop\C++\projekt1.cpp [Error] 'BLUE' was not declared in this scope
Z tego wynika, że stała
BLUE
jest nieznana w trakcie kompilacji. Teraz zerkamy do nagłówka i widzimy:
Kod: Zaznacz cały
#if defined(_WINDOWS_H) || defined(_GNU_H_WINDOWS_H)
/* MINGW32 G++ Compiler:
* Define the colors type in the same way that Borland does.
* Define CLR_INVALID from Borlands /win32/wingdi.h.
* Get the memset prototype from string.h. Note that sometimes <string.h> is
* actually <g++/String.h> for the Windows compiler because. In this case
* _STRING_H_ will not be defined but we can still pick it up from <../string.h>.
* Also define random for the bgidemo function.
*/
enum colors {
BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, LIGHTGRAY, DARKGRAY,
LIGHTBLUE, LIGHTGREEN, LIGHTCYAN, LIGHTRED, LIGHTMAGENTA, YELLOW, WHITE
};
#if !defined(CLR_INVALID)
#define CLR_INVALID 0xFFFFFFFF
#endif
#include <string.h>
#ifndef _STRING_H_
#include <../string.h>
#endif
#else
/* BORLAND Compiler:
* Colors are already defined in the BC5 conio.h, using COLORS.
* So for Borland I'll replace this enum with a #define definition.
*/
#define colors COLORS
#endif
A to sugeruje, że nie mamy zdefiniowanego symbolu. Spróbuj dodać symbol
przed linijką załączającą winbgim.h.
Aczkolwiek wypadałoby dokładnie sprawdzić, jak preprocesor właściwie przetworzył plik. No i mógłbyś podać, jakiego kompilatora używasz.