Thread: [Dev-C++] Compiling errors using Borland Graphics Interface
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Paolo S. <snt...@ne...> - 2003-09-16 13:31:26
|
Hi All,
I need use the Borland Graphics Interface (graphics.h) under Dev-
C++ V 4.9.8.0 installed on WinMe.
I get some errors at compile time.
I have downloaded the files to the correct locations
winbgim.h (download to /Dev-C++/include)
winbgim.cpp (download to /Dev-C++/include)
libbgi.a (download to /Dev-C++/lib)
and added -lbgi -lgdi32 in the "Further object files and linker options"
field.
My test code is:
#include <winbgim.h>
int main()
{
initwindow(400,300); //open a 400x300 graphics window
moveto(0,0);
lineto(50,50);
while(!kbhit()); //wait for user to press a key
closegraph(); //close graphics window
return 0;
}
When compiled I get some errors:
Compilatore: Default compiler
Building Makefile: "C:\Dev-Cpp\Examples\bgi\Makefile.win"
Finding dependencies for file: C:\Dev-Cpp\Examples\bgi\main.cpp
Esecuzione di make...
make.exe -f "C:\Dev-Cpp\Examples\bgi\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/DEV-CPP/include/c++" -I"C:/DEV-
CPP/include/c++/mingw32" -I"C:/DEV-CPP/include/c++/backward" -I"C:
/DEV-CPP/include" -lbgi -lgdi32
In file included from main.cpp:1:
C:/DEV-CPP/include/winbgim.h:59: conflicting types for `BLACK'
C:/DEV-CPP/include/conio.h:25: previous declaration as `COLORS BLACK'
C:/DEV-CPP/include/winbgim.h:59: conflicting types for `BLUE'
C:/DEV-CPP/include/conio.h:26: previous declaration as `COLORS BLUE'
C:/DEV-CPP/include/winbgim.h:59: conflicting types for `GREEN'
C:/DEV-CPP/include/conio.h:27: previous declaration as `COLORS GREEN'
C:/DEV-CPP/include/winbgim.h:59: conflicting types for `CYAN'
C:/DEV-CPP/include/conio.h:28: previous declaration as `COLORS CYAN'
C:/DEV-CPP/include/winbgim.h:59: conflicting types for `RED'
C:/DEV-CPP/include/conio.h:29: previous declaration as `COLORS RED'
C:/DEV-CPP/include/winbgim.h:59: conflicting types for `MAGENTA'
C:/DEV-CPP/include/conio.h:30: previous declaration as `COLORS MAGENTA'
C:/DEV-CPP/include/winbgim.h:59: conflicting types for `BROWN'
C:/DEV-CPP/include/conio.h:31: previous declaration as `COLORS BROWN'
C:/DEV-CPP/include/winbgim.h:59: conflicting types for `LIGHTGRAY'
C:/DEV-CPP/include/conio.h:32: previous declaration as `COLORS LIGHTGRAY'
C:/DEV-CPP/include/winbgim.h:59: conflicting types for `DARKGRAY'
C:/DEV-CPP/include/conio.h:33: previous declaration as `COLORS DARKGRAY'
C:/DEV-CPP/include/winbgim.h:60: conflicting types for `LIGHTBLUE'
C:/DEV-CPP/include/conio.h:34: previous declaration as `COLORS LIGHTBLUE'
C:/DEV-CPP/include/winbgim.h:60: conflicting types for `LIGHTGREEN'
C:/DEV-CPP/include/conio.h:35: previous declaration as `COLORS LIGHTGREEN'
C:/DEV-CPP/include/winbgim.h:60: conflicting types for `LIGHTCYAN'
C:/DEV-CPP/include/conio.h:36: previous declaration as `COLORS LIGHTCYAN'
C:/DEV-CPP/include/winbgim.h:60: conflicting types for `LIGHTRED'
C:/DEV-CPP/include/conio.h:37: previous declaration as `COLORS LIGHTRED'
C:/DEV-CPP/include/winbgim.h:60: conflicting types for `LIGHTMAGENTA'
C:/DEV-CPP/include/conio.h:38: previous declaration as `COLORS LIGHTMAGENTA'
C:/DEV-CPP/include/winbgim.h:60: conflicting types for `YELLOW'
C:/DEV-CPP/include/conio.h:39: previous declaration as `COLORS YELLOW'
C:/DEV-CPP/include/winbgim.h:61: conflicting types for `WHITE'
C:/DEV-CPP/include/conio.h:41: previous declaration as `COLORS WHITE'
g++.exe main.o -o "Progetto1.exe" -L"C:/DEV-CPP/lib"
G__~1.EXE: main.o: No such file or directory
G__~1.EXE: no input files
Esecuzione terminata
Can Anybody help me ??
Thanks in advance.
Paolo Santinelli.
|
|
From: <ri...@un...> - 2003-09-16 14:44:48
|
I'm not sure but I think you should first to initialize the graphical mod=
e
with these sentences, for instance: (at least, in the past, I got to use=20
the
bgi library with success in dev-cpp),
********************************
int graphdriver =3D DETECT, graphmode;
initgraph(&graphdriver, &graphmode, "c:\\dev-cpp\\bgi");
if (graphresult() < 0) /* make sure initialized OK */
return;
// and here your graphical functions and code.
****************************************
and take care to include the correct header files:
#include <winbgim.h> /* For graphics library functions */
#include <stdlib.h> /* =BFFor kbhit( )? */
#include <stdio.h>
|
|
From: <ten...@ne...> - 2003-09-16 16:23:59
|
Try changing the ordering of the linker options.and adding one which is
something similar to -lmingw32 or so.
Paolo Santinelli wrote:
>Hi All,
>
>I need use the Borland Graphics Interface (graphics.h) under Dev-
>C++ V 4.9.8.0 installed on WinMe.
>
>I get some errors at compile time.
>
>I have downloaded the files to the correct locations
>
>winbgim.h (download to /Dev-C++/include)
>winbgim.cpp (download to /Dev-C++/include)
>libbgi.a (download to /Dev-C++/lib)
>
>and added -lbgi -lgdi32 in the "Further object files and linker options"
>field.
>
>My test code is:
>
>#include <winbgim.h>
>
> int main()
> {
> initwindow(400,300); //open a 400x300 graphics window
> moveto(0,0);
> lineto(50,50);
> while(!kbhit()); //wait for user to press a key
> closegraph(); //close graphics window
> return 0;
> }
>
>
>
>
>When compiled I get some errors:
>
>
>
>Compilatore: Default compiler
>Building Makefile: "C:\Dev-Cpp\Examples\bgi\Makefile.win"
>Finding dependencies for file: C:\Dev-Cpp\Examples\bgi\main.cpp
>Esecuzione di make...
>make.exe -f "C:\Dev-Cpp\Examples\bgi\Makefile.win" all
>g++.exe -c main.cpp -o main.o -I"C:/DEV-CPP/include/c++" -I"C:/DEV-
>CPP/include/c++/mingw32" -I"C:/DEV-CPP/include/c++/backward" -I"C:
>/DEV-CPP/include" -lbgi -lgdi32
>
>In file included from main.cpp:1:
>C:/DEV-CPP/include/winbgim.h:59: conflicting types for `BLACK'
>C:/DEV-CPP/include/conio.h:25: previous declaration as `COLORS BLACK'
>C:/DEV-CPP/include/winbgim.h:59: conflicting types for `BLUE'
>C:/DEV-CPP/include/conio.h:26: previous declaration as `COLORS BLUE'
>C:/DEV-CPP/include/winbgim.h:59: conflicting types for `GREEN'
>C:/DEV-CPP/include/conio.h:27: previous declaration as `COLORS GREEN'
>C:/DEV-CPP/include/winbgim.h:59: conflicting types for `CYAN'
>C:/DEV-CPP/include/conio.h:28: previous declaration as `COLORS CYAN'
>C:/DEV-CPP/include/winbgim.h:59: conflicting types for `RED'
>C:/DEV-CPP/include/conio.h:29: previous declaration as `COLORS RED'
>C:/DEV-CPP/include/winbgim.h:59: conflicting types for `MAGENTA'
>
>C:/DEV-CPP/include/conio.h:30: previous declaration as `COLORS MAGENTA'
>C:/DEV-CPP/include/winbgim.h:59: conflicting types for `BROWN'
>C:/DEV-CPP/include/conio.h:31: previous declaration as `COLORS BROWN'
>
>C:/DEV-CPP/include/winbgim.h:59: conflicting types for `LIGHTGRAY'
>C:/DEV-CPP/include/conio.h:32: previous declaration as `COLORS LIGHTGRAY'
>C:/DEV-CPP/include/winbgim.h:59: conflicting types for `DARKGRAY'
>C:/DEV-CPP/include/conio.h:33: previous declaration as `COLORS DARKGRAY'
>C:/DEV-CPP/include/winbgim.h:60: conflicting types for `LIGHTBLUE'
>
>C:/DEV-CPP/include/conio.h:34: previous declaration as `COLORS LIGHTBLUE'
>C:/DEV-CPP/include/winbgim.h:60: conflicting types for `LIGHTGREEN'
>
>C:/DEV-CPP/include/conio.h:35: previous declaration as `COLORS LIGHTGREEN'
>C:/DEV-CPP/include/winbgim.h:60: conflicting types for `LIGHTCYAN'
>
>C:/DEV-CPP/include/conio.h:36: previous declaration as `COLORS LIGHTCYAN'
>C:/DEV-CPP/include/winbgim.h:60: conflicting types for `LIGHTRED'
>C:/DEV-CPP/include/conio.h:37: previous declaration as `COLORS LIGHTRED'
>C:/DEV-CPP/include/winbgim.h:60: conflicting types for `LIGHTMAGENTA'
>C:/DEV-CPP/include/conio.h:38: previous declaration as `COLORS LIGHTMAGENTA'
>C:/DEV-CPP/include/winbgim.h:60: conflicting types for `YELLOW'
>C:/DEV-CPP/include/conio.h:39: previous declaration as `COLORS YELLOW'
>C:/DEV-CPP/include/winbgim.h:61: conflicting types for `WHITE'
>C:/DEV-CPP/include/conio.h:41: previous declaration as `COLORS WHITE'
>
>g++.exe main.o -o "Progetto1.exe" -L"C:/DEV-CPP/lib"
>
>G__~1.EXE: main.o: No such file or directory
>G__~1.EXE: no input files
>
>Esecuzione terminata
>
>
>Can Anybody help me ??
>
>
>Thanks in advance.
>
>Paolo Santinelli.
>
>
>
>
>
>
>
>
>-------------------------------------------------------
>This sf.net email is sponsored by:ThinkGeek
>Welcome to geek heaven.
>http://thinkgeek.com/sf
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
>
>
|