DEV c++的使用问题!

seaman117 2004-10-02 10:11:31
想用tc下的图形库,如何把它加入到dev中来,
include了不行!!
...全文
467 23 打赏 收藏 转发到动态 举报
写回复
用AI写文章
23 条回复
切换为时间正序
请发表友善的回复…
发表回复
realee 2004-11-22
  • 打赏
  • 举报
回复
:)
crazyvv 2004-11-22
  • 打赏
  • 举报
回复
http://www14.brinkster.com/aditsu/console/
xingyafei 2004-11-22
  • 打赏
  • 举报
回复
.........................
用VC吧
crazyvv 2004-11-22
  • 打赏
  • 举报
回复
How to use the winbgim library for the free mingw32 gnu C++ compiler

Download and install the free cs1300 tools, as described in www.cs.colorado.edu/~main/cs1300/README.html.

The header file: Change to the cs1300\include subdirectory and check whether you have the file winbgim.h. If not, then download this file into that directory by holding down the left-shift key and clicking on this link: http://www.cs.colorado.edu/~main/bgi/winbgim.h.

The archieved library file: Change to the cs1300\lib subdirectory and check whether you have the file libbgi.a. If not, then download this file into that directory by holding down the left-shift key and clicking on this link: http://www.cs.colorado.edu/~main/bgi/libbgi.a.

Write your program as you normally would, using the BGI graphics functions. Instead of including graphics.h, you should have this statement:
#include <winbgim.h>


In order to actually process graphics events, the program should regularly call kbhit, getch, or delay (which are described below). Otherwise the graphics events may end up in a buffer that doesn't get processed. You may also call some new functions for mouse control and full RGB color, as described below.

When you create an executable (exe) program that uses the winbgim library, you must add the three options -lbgi -lgdi32 -luser32 (in that order) after any other file arguments to the compiler. For example, to compile the bgidemo0.cpp program you would give the compile command:
g++ bgidemo0.cpp -lbgi -lgdi32 -luser32 -o bgidemo0.exe

Note that each of these library options begins with the letter l (not the number one). This command creates an executable file called bgidemo0.exe. Note that when it runs, it creates a small graphics window where all the bgi operations are performed. Any text i/o with cin and cout will be done in the other (console) window.
crazyvv 2004-11-22
  • 打赏
  • 举报
回复
还是没有搞很懂
searoom 2004-11-22
  • 打赏
  • 举报
回复
占个茅坑
seaman117 2004-10-04
  • 打赏
  • 举报
回复
抬出来看看
xqlez 2004-10-04
  • 打赏
  • 举报
回复
临时性的存放,
ftp://ftp.sdedu.net/upload/DevPak/winbgim.DevPak
xqlez 2004-10-04
  • 打赏
  • 举报
回复
C++编译
柯本 2004-10-03
  • 打赏
  • 举报
回复
当然可以的,dev-cpp有console level GDI 包,以下是一个EX(几乎与TC的一样)
#undef __STRICT_ANSI__
#include <conio.h>
#include <winbgim.h>
#include <stdio.h>

int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;

/* initialize graphics mode */
initgraph(&gdriver, &gmode, "");

/* read result of initialization */
errorcode = graphresult();

if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* return with error code */
}

/* draw a line */
line(0, 0, getmaxx(), getmaxy());

/* clean up */
getch();
closegraph();
return 0;
}

编译时要加入-l bgi -l gdi32选项
jennifer_yang 2004-10-03
  • 打赏
  • 举报
回复
难用的dev c++ 偶还是喜欢TC
Aisatlarge 2004-10-03
  • 打赏
  • 举报
回复
你可以使用FLTK类库,http://www.fltk.net.有为dev-cpp编译好的包。
seaman117 2004-10-03
  • 打赏
  • 举报
回复
呵呵,刚刚准备问楼上这个!
CGDI的包已经安装了,project的option里的complier也加了-l bgi -l gdi32
link里也加了libbgi.a,但还是出错!顺便问一下,在TC里用system("pause")怎么暂停不了啊,加了stdlib.h和stdio.h了
3 F:\TEMP\yaya\main.c In file included from main.c
389 D:\DEV\DEVCPP\include\winbgim.h parse error before "ismouseclick"
389 D:\DEV\DEVCPP\include\winbgim.h [Warning] data definition has no type or storage class
390 D:\DEV\DEVCPP\include\winbgim.h parse error before '&' token
[Linker error] undefined reference to `textbackground'
[Linker error] undefined reference to `textcolor'
[Linker error] undefined reference to `clrscr'

newegg2002 2004-10-03
  • 打赏
  • 举报
回复
见识生来就是长的..
还有一点..上面哥们说的包我的都打了..
如果要想运行类似这样的程序.应该怎么作:
int main()
{
...
clrscr();
gotoxy();
...

}
要对头文件如何包含..
xqlez 2004-10-03
  • 打赏
  • 举报
回复
dev-cpp的两个包:
http://public.planetmirror.com/pub/devcpp/CGDI.DevPak
http://public.planetmirror.com/pub/devcpp/CLGDIV32.DevPak
xqlez 2004-10-03
  • 打赏
  • 举报
回复
还是keiy() 动作快

http://www.cs.colorado.edu/~main/bgi/doc/
积木 2004-10-03
  • 打赏
  • 举报
回复
添加之前加没有加载库啊?
seaman117 2004-10-03
  • 打赏
  • 举报
回复
to keiy() :
是在Complier option里的Add following commands when calling complier里添加
进-l bgi -l gdi32吗?
我添加了,但是还是提示出错!
sharkhuang 2004-10-03
  • 打赏
  • 举报
回复
你要加入库在工程里面!project选项里面有。就不用自己改makefile
louisqiang 2004-10-02
  • 打赏
  • 举报
回复
可以啊,在编译的时候指定库文件就可以。
加载更多回复(3)

69,375

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧