• 3495阅读
  • 1回复

[提问]一个困惑已久的问题 [复制链接]

上一主题 下一主题
离线wjz2047
 

只看楼主 倒序阅读 楼主  发表于: 2014-03-23
项目A通过dll或lib的方式调用项目B中的函数,在Release下调用时发生问题。问题如下:
执行到jpeg_read_header函数时,调试中断, 出现“0x76ee8dc9 处最可能的异常: 0xC0000005: 写入位置 0x00000014 时发生访问冲突”这个错误,同时跳转到-file.c文件中的这个函数:void __cdecl _lock_file。函数描述如下:
  1. void __cdecl _lock_file (
  2.         FILE *pf
  3.         )
  4. {
  5.         /*
  6.          * The way the FILE (pointed to by pf) is locked depends on whether
  7.          * it is part of _iob[] or not
  8.          */
  9.         if ( (pf >= _iob) && (pf <= (&_iob[_IOB_ENTRIES-1])) )
  10.         {
  11.             /*
  12.              * FILE lies in _iob[] so the lock lies in _locktable[].
  13.              */
  14.             _lock( _STREAM_LOCKS + (int)(pf - _iob) );
  15.             /* We set _IOLOCKED to indicate we locked the stream */
  16.             pf->_flag |= _IOLOCKED;
  17.         }
  18.         else
  19.             /*
  20.              * Not part of _iob[]. Therefore, *pf is a _FILEX and the
  21.              * lock field of the struct is an initialized critical
  22.              * section.
  23.              */
  24.             EnterCriticalSection( &(((_FILEX *)pf)->lock) );
  25. }

我Google了一下,好像是file*指针在不同的crt版本中传递出现的问题。我仔细检查了一下,我的所有文件的crt配置都是MD,这究竟是怎么一回事呢?该怎么解决啊,求帮忙
离线wjz2047

只看该作者 1楼 发表于: 2014-03-23
已解决,哈哈
快速回复
限100 字节
 
上一个 下一个