CPPUnitをWindows上でコンパイルする

スポンサーリンク

ダウンロードとかはここから。
http://sourceforge.net/apps/mediawiki/cppunit/index.php?title=Main_Page

でも、VC6より上のVersionを使うとエラーが出るみたい。
こういうの多いと困りますよねぇ。

エラーの内容はこんな感じ。

MsDevCallerListCtrl.cpp
.MsDevCallerListCtrl.cpp(67) : error C3505: cannot load type library ‘{80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2}’
.MsDevCallerListCtrl.cpp(67) : fatal error C1104: fatal error importing libid: ’80cc9f66-e7d8-4ddd-85b6-d9e6cd0e93e2′

解決方法はここに乗ってた。

http://codereflect.com/2007/12/25/cppunit-error-c3505-cannot-load-type-library-80cc9f66-e7d8-4ddd-85b6-d9e6cd0e93e2-whats-it/

まず、MsDevCallerListCtrl.cppを変更する。

#pragma warning( disable : 4278 )
#pragma warning( disable : 4146 )
//The following #import imports EnvDTE based on its LIBID.
#import “libid:80cc9f66-e7d8-4ddd-85b6-d9e6cd0e93e2” version(“8.0”) lcid(“0”) raw_interfaces_only named_guids
//The following #import imports EnvDTE80 based on its LIBID.
#import “libid:1A31287A-4D7D-413e-8E32-3B374931BD89” version(“8.0”) lcid(“0”) raw_interfaces_only named_guids
#pragma warning( default : 4146 )
#pragma warning( default : 4278 )

そして、ファイルを置くパスに半角スペースがない状態にする。
Program Files化とかはまずいってことですね。

これでコンパイルできました。

コメント

タイトルとURLをコピーしました