项目A通过dll或lib的方式调用项目B中的函数,在Release下调用时发生
问题。问题如下:
在
执行到jpeg_read_header函数时,
调试中断, 出现“0x76ee8dc9 处最可能的异常: 0xC0000005: 写入位置 0x00000014 时发生访问冲突”这个
错误,同时跳转到-file.c文件中的这个函数:void __cdecl _lock_file。函数描述如下:
- void __cdecl _lock_file (
- FILE *pf
- )
- {
- /*
- * The way the FILE (pointed to by pf) is locked depends on whether
- * it is part of _iob[] or not
- */
- if ( (pf >= _iob) && (pf <= (&_iob[_IOB_ENTRIES-1])) )
- {
- /*
- * FILE lies in _iob[] so the lock lies in _locktable[].
- */
- _lock( _STREAM_LOCKS + (int)(pf - _iob) );
- /* We set _IOLOCKED to indicate we locked the stream */
- pf->_flag |= _IOLOCKED;
- }
- else
- /*
- * Not part of _iob[]. Therefore, *pf is a _FILEX and the
- * lock field of the struct is an initialized critical
- * section.
- */
- EnterCriticalSection( &(((_FILEX *)pf)->lock) );
- }
我Google了一下,好像是file*指针在不同的crt版本中传递出现的问题。我仔细检查了一下,我的所有
文件的crt配置都是MD,这究竟是怎么一回事呢?该怎么解决啊,求帮忙