2012-02-03 13 views
1

私は学校プロジェクトのバックボーンを作成していますが、「未解決の外部シンボル」エラーが発生しています。このサイトで言及された以前の問題によると、プロジェクトを.libファイルに手動でリンクする必要があると思います。問題は、私はリンクする必要のある.libを正確に知りません。誰かが私が12歳のように説明できますか?さらに別のLNK2019:未解決の外部シンボル

1>------ Build started: Project: Birthday311, Configuration: Debug Win32 ------ 
1>Build started 2/2/2012 07:55:30 PM. 
1>InitializeBuildStatus: 
1> Touching "Debug\Birthday311.unsuccessfulbuild". 
1>ClCompile: 
1> All outputs are up-to-date. 
1>ManifestResourceCompile: 
1> All outputs are up-to-date. 
1>birthday_test.obj : error LNK2019: unresolved external symbol "public: int __thiscall Birthday::getDay(void)const " ([email protected]@@QBEHXZ) referenced in function "void __cdecl test_class_Birthday_default_ctor(class Tester &)" ([email protected]@[email protected]@@Z) 
1>birthday_test.obj : error LNK2019: unresolved external symbol "public: int __thiscall Birthday::getMonth(void)const " ([email protected]@@QBEHXZ) referenced in function "void __cdecl test_class_Birthday_default_ctor(class Tester &)" ([email protected]@[email protected]@@Z) 
1>birthday_test.obj : error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Birthday::getName(void)const " ([email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@XZ) referenced in function "void __cdecl test_class_Birthday_default_ctor(class Tester &)" ([email protected]@[email protected]@@Z) 
1>C:\Users\Ender\Documents\Visual Studio 2010\Projects\Birthday311\Debug\Birthday311.exe : fatal error LNK1120: 3 unresolved externals 
+0

どのような '.lib'ファイルを知っているべきですか? 'Birthday :: getDay'と' Birthday :: getMonth'関数の定義はどれですか?それらは私が知っている標準ライブラリの一部ではないので、あなた自身で書かなければなりませんでした。 –

+0

ああ、あなたは正しい答えを見つけ出すのを手伝ってくれました。私の.cppファイルを見てみると、単にint Birthday :: getDay()const'の代わりにgetDay関数とgetMonth関数を 'int getDay()'と呼ぶことに気付きました。 ありがとう! – derp

答えて

0

あなたが実際に機能getDay、getMonth、とのgetNameを実装していませんでしたように思えます。

+0

ああ、あなたは正しい答えを見つけ出すのを手伝った。私の.cppファイルを見て、私は単にint Birthday :: getDay()constの代わりにgetDayとgetMonth関数を 'int getDay()'と呼んでいることに気付きました。基本的に、私はgetDayとgetMonth関数を適切に実装しませんでした。ありがとう! – derp

関連する問題