1. 程式人生 > >Solve Error: Unhandled exception at 0x00905a4d in xxx.exe: 0xC0000005: Access violation.

Solve Error: Unhandled exception at 0x00905a4d in xxx.exe: 0xC0000005: Access violation.

visual 發的 生成 可能 gsl 鏈接 slc exc mman

在使用Visual Studio進行項目開發的時候,有時候會遇到下面這個錯誤:

Unhandled exception at 0x00905a4d in xxx.exe: 0xC0000005: Access violation

產生這個錯誤的原因可能是在Visual Studio中鏈接了後綴為"*.a"的庫文件,這種庫文件應該是在Linux系統或者是使用MinGW編譯時鏈接的,用VS的話應該鏈接"*.lib"的庫文件,而下載的第三方庫中一般會包含"*.def"文件,比如科學計算庫libgsl裏就有這兩個文件libgsl.def和libgslcblas.def,我們可以將其轉換為"*.lib"的庫文件:

Start the "Visual Studio 2010 command lines"
Goto the gsl lib directory, and type:

lib /machine:i386 /def:libgsl.def
lib /machine:i386 /def:libgslcblas.def

這會生成libgsl.lib和libgslcblas.lib這兩個文件,加到Linker中即可。

Solve Error: Unhandled exception at 0x00905a4d in xxx.exe: 0xC0000005: Access violation.