2011-01-25 8 views
0

lib id3を使用してmp3タグにアクセスしようとしましたが、mp3音楽ファイルからアルバムアートにアクセスすることを究極の目的としています。id3ライブラリを使用してサンプルプログラムをリンクできませんでした

問題は、私もid3ライブラリに付属のサンプルプログラムをコンパイルできなかったことです。私は私のソースファイルに

#define ID3LIB_LINKOPTION 1 

を追加しようとすると、私のプロジェクトの例プログラムをコンパイルしようと 問題1. はまず、このエラー

1>*** NOTICE *** (not a real error) 
1>* You should include a define in your project which reflect how you link the library 
1>* If you use id3lib.lib or libprj/id3lib.dsp (you link static) you should add 
1>* ID3LIB_LINKOPTION=1 to your preprocessor definitions of your project. 
1>* If you use id3lib.dll (you link dynamic) you should add ID3LIB_LINKOPTION=3 
1>* to your preprocessor definitions of your project. 

を生成し、私はより多くのエラーが発生します。

1>Linking... 
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: void __thiscall std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in id3lib.lib(tag_parse.obj) 
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,int)" ([email protected][email protected][email protected]@[email protected]@@[email protected]@[email protected]) already defined in id3lib.lib(tag_file.obj) 
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: static bool __cdecl std::char_traits<char>::eq_int_type(int const &,int const &)" ([email protected][email protected]@[email protected]@[email protected]) already defined in id3lib.lib(tag_parse.obj) 
1>msvcprtd.lib(MSVCP90D.dll) : error LNK2005: "public: static int __cdecl std::char_traits<char>::eof(void)" ([email protected][email protected]@[email protected]@SAHXZ) already defined in id3lib.lib(tag_parse.obj) 

これらのエラーから、問題の原因は追加の依存関係ではid3lib.libだとします。しかし、私が依存関係から削除しても、私はまだこれらのエラーを取得します。

1>Linking... 
1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall ID3_Tag::~ID3_Tag(void)" ([email protected]@[email protected]) referenced in function _main 
1>main.obj : error LNK2019: unresolved external symbol "public: class ID3_Field & __thiscall ID3_Frame::Field(enum ID3_FieldID)const " ([email protected][email protected]@[email protected]@[email protected]@@Z) referenced in function _main 
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall ID3_Frame::Contains(enum ID3_FieldID)const " ([email protected][email protected]@[email protected]@@Z) referenced in function _main 
1>main.obj : error LNK2019: unresolved external symbol "public: class ID3_Frame * __thiscall ID3_Tag::Find(enum ID3_FrameID)const " ([email protected][email protected]@[email protected]@[email protected]@@Z) referenced in function _main 
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ID3_Tag::ID3_Tag(char const *)" ([email protected]@[email protected]@Z) referenced in function _main 
1>C:\Users\GuestUser\Documents\Visual Studio 2008\Projects\idlib example\Debug\idlib example.exe : fatal error LNK1120: 5 unresolved externals 

私を助けてください。 C++初心者:(

答えて

1

が既にid3lib.libに含まれるデフォルトのライブラリであるMSVCPRTD.LIBにリンクしないでくださいように感じるように始めています。

あなたは間違いなくid3lib.lib

にリンクします
+0

私はid3lib.libに明示的にリンクしていますが、私は個人的にmsvcprtd.libにリンクしていません。どのように動いているのか分かりません。 –

+0

aveをあきらめてください:(タグアブを試しています –

+0

デフォルトライブラリは自動的にリンクされます。除外するリンクオプションがあります。 – T33C

関連する問題