keil C++ 与 C 函数调用问题

[复制链接]
 楼主| zhaoyk1981 发表于 2011-10-17 13:25 | 显示全部楼层 |阅读模式
main。cpp文件中 main函数,调用了FuncA(); FuncB()这两个函数;
app.c文件中,也调用了FuncA(); FuncB()这两个函数;
bsp。c文件中定义的FuncA(); FuncB()这两个函数;
编译的时候没有问题;
链接的时候提示undefined symbol  FuncA() referred from main.o;
                    undefined symbol  FuncB() referred from main.o;
app。c中调用FuncA(); FuncB(),链接是正常的!

谁能帮我解答一下啊! 谢谢
john_lee 发表于 2011-10-17 23:42 | 显示全部楼层
在声明FuncA(), FuncB()时,这样:
  1. #ifdef __cplusplus
  2. extern "C" {
  3. #endif
  4. void FuncA();
  5. void FuncB();
  6. #ifdef __cplusplus
  7. }
  8. #endif
 楼主| zhaoyk1981 发表于 2011-10-27 16:30 | 显示全部楼层
谢谢 按你说的改可以了!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

12

主题

28

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部

12

主题

28

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部