函数调用注意声明原型
2014-06-03 21:23
344 查看
When you compile your program that uses a dynamic library, object files are left with references to the library functions just as for any other external reference.
You need to include the header for the library so that the compiler knows the specific types of the functions you are calling. Note the compiler only needs to know
the types associated with a function (such as, it takes an int and returns a char *) so that it can correctly allocate space for the function call.
大致的意思就是说,是使用函数的时候,需要声明原型(#include相应的头文件;或者extern)。这有助于编译器生成相应的正确代码。否则,函数调用关系时产生的代码可能有错误。
You need to include the header for the library so that the compiler knows the specific types of the functions you are calling. Note the compiler only needs to know
the types associated with a function (such as, it takes an int and returns a char *) so that it can correctly allocate space for the function call.
大致的意思就是说,是使用函数的时候,需要声明原型(#include相应的头文件;或者extern)。这有助于编译器生成相应的正确代码。否则,函数调用关系时产生的代码可能有错误。
相关文章推荐
- RTX:RTX系统调用函数分类、声明、功能及注意事项
- DLL导出函数的声明和调用
- js 函数 调用 另一函数返回值须注意
- vb2005 下webbrowser 控件调用窗体函数的注意事项
- 调用参数为pchar类型的函数或过程时注意点
- 关于warning: function declaration isn’t a prototype(函数声明不是原型)的解决办法
- DLL导出函数的声明和调用
- “函数声明”、“函数原型”与“函数定义”辨析
- 关于函数调用的一个注意点
- 在无函数声明的情况下运行时动态调用DLL函数
- 通过GetProcAddress函数动态调用dll中地函数,是否必须通过extern C声明导出函数?(转)
- 调用自定义函数注意事项
- 注意函数/变量的声明与定义
- 编译器报:未调用原型函数(是有意用变量定义的吗?)(本文为原创,转载清注明出外)
- 在C++ 程序中调用被 C编译器编译后的函数,为什么要加 extern “C”声明?
- J2ME程序开发要注意函数调用对性能的影响
- .NET工程中以 C 和 C++ 两种方式编译时,函数调用注意事项
- 如何在类里调用MXML内声明的函数
- 显示调用DLL 应该注意DLL导出函数的调用约定问题
- template的友元声明-如果友元是限定版本,则必须声明友元之前声明函数原型