我必须在编译器PJSIP
中CPP
编译。因为我正在将 API 与PJSIP
. 它在CPP
. 所以我必须使用g++
而不是gcc
. 但现在我没有集成任何其他 API。
但是我在CPP
编译器中遇到链接器错误。如果它是C
编译器,它工作正常。
错误:
架构臂的未定义符号: “_crypto_alloc”,引用自: srtp_stream_clone(srtp_stream_ctx_t const*, unsigned int, srtp_stream_ctx_t**) 在 libsrtp-arm-apple-darwin9.a(srtp.o) libsrtp-arm-apple-darwin9.a(srtp.o) 中的 srtp_stream_alloc(srtp_stream_ctx_t**, srtp_policy_t const*) _srtp_create 在 libsrtp-arm-apple-darwin9.a(srtp.o) “_aes_icm_context_init”,引用自: libsrtp-arm-apple-darwin9.a(srtp.o) 中的 srtp_kdf_init(srtp_kdf_t*, unsigned char const*) “_crypto_kernel_load_debug_module”,引用自: libsrtp-arm-apple-darwin9.a(srtp.o) 中的 _srtp_init “_rdbx_init”,引用自: libsrtp-arm-apple-darwin9.a(srtp.o) 中的 srtp_stream_init(srtp_stream_ctx_t*, srtp_policy_t const*) srtp_stream_clone(srtp_stream_ctx_t const*, unsigned int, srtp_stream_ctx_t**) 在 libsrtp-arm-apple-darwin9.a(srtp.o) “_key_limit_clone”,引用自: srtp_stream_clone(srtp_stream_ctx_t const*, unsigned int, srtp_stream_ctx_t**) 在 libsrtp-arm-apple-darwin9.a(srtp.o) “_auth_get_tag_length”,引用自: libsrtp-arm-apple-darwin9.a(srtp.o) 中的 _srtp_unprotect_rtcp libsrtp-arm-apple-darwin9.a(srtp.o) 中的 _srtp_protect_rtcp libsrtp-arm-apple-darwin9.a(srtp.o) 中的 _srtp_unprotect libsrtp-arm-apple-darwin9.a(srtp.o) 中的 _srtp_protect ... ...
其实我没有改变任何东西makefile
。
注意:
在srtp.c
文件中,已包含alloc.h
文件。我表扬了它并编译了它。我只得到了相同的链接器错误。我从两个方面考虑。但我不确定这一点。
1.不与.o
文件链接
2.不带头文件。(我不清楚这一点。)
请帮我解决这个问题。