2

我看到每个人都建议只使用 openGL 和其他一些,但我不想。我只是想知道graphic.h是否只能在turbo c中编译而不是在gcc中编译,谢谢

4

2 回答 2

1

You might get graphics.h compiled (as #included part of some sources), but the linking (coming after the compilation) will fail, as gcc's linker (ld) would not link the compilation's result against the library (graphics.lib) implementing what graphics.h prototyped.

于 2013-10-23T10:31:38.300 回答
1

当然你可以编译 graphics.hgcc但你必须遵循某些步骤。

  1. graphics.h图形libbgi.a中获取文件。
  2. graphics.h文件复制到includegcc 编译器的目录。
  3. libbgi.a文件复制到libgcc 编译器的目录。
  4. 之后执行代码:

    C:\>gcc your_filename.c -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32

    此外,如果您正在执行 c++ 程序,请使用g++而不是gcc.

于 2015-01-28T12:52:32.367 回答