链接Borland C++ 3.1中的图形库

Leo*_* F. 5 c dos borland-c++

我想在DOS应用程序中使用图形库.我添加#include <graphics.h>到我的源文件并使用密件抄送构建应用程序:

bcc -3 -ms  -P -IC:\BC3\INCLUDE -LC:\BC3\LIB AMtest.c ExtMem.ASM 
Run Code Online (Sandbox Code Playgroud)

但是,我收到链接错误:

Turbo Link  Version 5.1 Copyright (c) 1992 Borland International

Error: Undefined symbol _closegraph in module amtest.c
Error: Undefined symbol _outtext in module amtest.c
Error: Undefined symbol _moveto in module amtest.c
Error: Undefined symbol _settextstyle in module amtest.c
Error: Undefined symbol _setcolor in module amtest.c
Error: Undefined symbol _settextjustify in module amtest.c
Error: Undefined symbol _graphresult in module amtest.c
Error: Undefined symbol _initgraph in module amtest.c
Run Code Online (Sandbox Code Playgroud)

graphics.lib是在c:\bc3\lib文件夹中.如何链接图形库?

Vin*_*982 1

您使用了错误的命令。正确的命令是:

bcc -3 -ms -P -IC:\BC3\INCLUDE -LC:\BC3\LIB graphics.lib AMtest.c ExtMem.ASM
Run Code Online (Sandbox Code Playgroud)