How to resolve the linker error in C++ compiler

我只是一个虾纸丫 提交于 2019-12-02 09:32:24
  1. Don't compile C source code with a C++ compiler. Just compile it with a C compiler and link it into your C++ program using a C++ linker.
  2. Declare all C symbols in an extern "C" block; either wrap your #include directives in such a block, or put it in the headers themselves. (Check whether there's not such a block in the headers already.)

See also How to mix C and C++ in the C++ FAQ.

When C symbols become undefined in a C++ program it means that their declarations are not marked as extern "C".

The standard way to handle it is to wrap C headers with:

#ifdef __cplusplus
extern "C" {
#endif

// C declarations here

#ifdef __cplusplus
}
#endif

It's linker error in your pjsip project. Are you using xcode or anyother IDE to develop this project?

This error is because, the above files are not linked to your project successfully.

Add this below missing library file into your project.

=>>libsrtp-arm-apple-darwin9.a

Follow the below link to link your library file into your project.

SOURCE: https://www.chilkatsoft.com/xcode-link-static-lib.asp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!