c - 无法编译 super 简单的代码

标签 c visual-studio-2010 compiler-construction compilation linker

我不明白为什么,但是当两个文件之间有一些引用时,我无法在两个文件中编译 super 简单的 C 代码。我正在使用 Visual Studio 2010,打开 Empy C++ 项目 这是:

主.c:

extern void putc(char c);
int main() {
char c = ' ';
putc(c);
return;
}

另一个文件.c:

void putc(char c) {

}

我收到这些错误: My errors

我认为它会在一些项目配置中,但我不知道在哪里......

请帮忙。

最佳答案

在VC2012项目中,请禁用Precompiled Headers选项。这应该可以解决您面临的编译问题。

关于c - 无法编译 super 简单的代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15323351/

相关文章:

c - 如何将 C 中的多行宏与行尾的注释结合起来

c - 为什么函数不能有静态参数?

c - C的智能指针/安全内存管理?

visual-studio-2010 - 如何使 Visual Studio 架构比较忽略数据库引用

c++ - 从函数返回后的 std::string c_str() 作用域

使用宏进行比较时,CLion 给出 'expression expected'

.net - 多平台 VisualStudio 项目

Android eclipse错误: Unknown option '--auto-add-overlay'

c - 解析后的符号表总体;编译器构建

c++ - 我如何在 Boost Spirit 中实现 const?