-D_GLIBCXX_USE_CXX11_ABI=0不要乱用,会导致野指针

在交叉编译过程中,使用-D_GLIBCXX_USE_CXX11_ABI=0选项可能导致程序在运行时出现野指针错误。当静态库中的函数与应用中使用的ABI不一致时,可能会出现此类问题。在移除该选项后,程序运行恢复正常,但具体原因尚不清楚。寻求帮助以理解这一现象。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天遇到一个问题:交叉编译jthread和jrtp,然后将生成的静态库文件copy到我们自己的工程里面,我们的工程调用jrtp.a里面的函数,从网络上获取rtp数据,但是在status = sess.Create(sessparams,&transparams);的时候程序崩溃了,原因是transparams变量对应的类

class JRTPLIB_IMPORTEXPORT RTPUDPv4TransmissionParams : public RTPTransmissionParams
{
public:
	RTPUDPv4TransmissionParams();

	/** Sets the IP address which is used to bind the sockets to \c ip. */
	void SetBindIP(uint32_t ip)									{ bindIP = ip; }

	/** Sets the multicast interface IP address. */
	void SetMulticastInterfaceIP(uint32_t ip)					{ mcastifaceIP = ip; }

	/** Sets the RTP portbase to \c pbase, which has to be an even number
	 *  unless RTPUDPv4TransmissionParams::SetAllowOddPortbase was called;
	 *  a port number of zero will cause a port to be chosen automatically. */
	void SetPortbase(uint16_t pbase)							{ portbase = pbase; }

	/** Sets the multicast TTL to be used to \c mcastTTL. */
	void SetMulticastTTL(uint8_t mcastTTL)						{ multicastTTL = mcastTTL; }

	/** Passes a 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值