Compiler errors 如何将外部程序集与BCC一起使用

Compiler errors 如何将外部程序集与BCC一起使用,compiler-errors,turbo-c,Compiler Errors,Turbo C,我有一个非常基本的main.c程序,我正试图编译它,但是我不能用一个简单的外部汇编函数来编译它 让我给你看看我有什么 main.c: extern void putc(char c); int main() { return (0); } $ bcc -c main.c main.c:13.21: error: need ')' main.c:13.24: error: c not in argument list main.c:13.24: error: need ';' main

我有一个非常基本的main.c程序,我正试图编译它,但是我不能用一个简单的外部汇编函数来编译它

让我给你看看我有什么

main.c:

extern void putc(char c);

int main()
{
    return (0);
}
$ bcc -c main.c
main.c:13.21: error: need ')'
main.c:13.24: error: c not in argument list
main.c:13.24: error: need ';'
main.c:13.24: error: need '{'
main.c:13.24: error: bad expression
main.c:15.3: error: bad expression
main.c:15.8: error: need ';'
main.c:16.1: error: need ';'
main.c:17.15: error: compiler bug? - attempting to load non-scalar non-pointer
main.c:eof: error: need '}'
$
终端:

extern void putc(char c);

int main()
{
    return (0);
}
$ bcc -c main.c
main.c:13.21: error: need ')'
main.c:13.24: error: c not in argument list
main.c:13.24: error: need ';'
main.c:13.24: error: need '{'
main.c:13.24: error: bad expression
main.c:15.3: error: bad expression
main.c:15.8: error: need ';'
main.c:16.1: error: need ';'
main.c:17.15: error: compiler bug? - attempting to load non-scalar non-pointer
main.c:eof: error: need '}'
$
更新:
如果我把代码改成

extern void putc(c) char c;

int main();
{
    return(0);
}
然后我就

$ bcc -c main.c 
main.c:8.11: error: main not in argument list
main.c:10.14: error: compiler bug? - attempting to load non-scalar non-pointer
$

在你贴的线下有什么东西吗?(它们少于13行,但从输出中我可以理解,错误出现在第13行、第15行等等)。实际代码中有注释,但除了注释行之外,没有其他内容
extern void putc
是第13行,您可以试试
extern void putc(char)?IIRC两种形式
外部类型foo(类型arg)
外部类型foo(type)
应该可以接受,但第一个可能会惹恼bcc。然后我得到,
main.c:6.21:error:need')'main.c:6.22:error:need变量名main.c:6.23:error:not in参数列表main.c:eof:error:need'{main.c:eof:error:need'}“
显然它需要
-ansi
选项——我刚刚用
bcc-ansi-cmain.c
编译了您的示例。如果可以的话,试一下,看看效果如何