2012-01-28 12 views
-2

私はC++で ヘッダーが.hの中で定義されていますが、プログラムをコンパイルしようとしていますがリンクすることはできませんし、定義がCPPファイルであるC++リンクエラー:問題は、私はリンクエラーをgottingだということです オブジェクト

layer.obj : error LNK2005: "public: __thiscall input_layer::input_layer(int,int)" ([email protected]@[email protected]@Z) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: __thiscall input_layer::~input_layer(void)" ([email protected]@[email protected]) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: virtual void __thiscall input_layer::calc_out(void)" ([email protected][email protected]@UAEXXZ) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: __thiscall output_layer::output_layer(int,int)" ([email protected]@[email protected]@Z) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: __thiscall output_layer::~output_layer(void)" ([email protected]@[email protected]) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: virtual void __thiscall output_layer::calc_out(void)" ([email protected][email protected]@UAEXXZ) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall output_layer::calc_error(float &)" ([email protected][email protected]@[email protected]) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall output_layer::randomize_weights(void)" ([email protected][email protected]@QAEXXZ) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall output_layer::update_weights(float)" ([email protected][email protected]@[email protected]) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall output_layer::list_weights(void)" ([email protected][email protected]@QAEXXZ) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall output_layer::list_errors(void)" ([email protected][email protected]@QAEXXZ) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall output_layer::write_weights(int,struct _iobuf *)" ([email protected][email protected]@[email protected]@@Z) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall output_layer::read_weights(int,struct _iobuf *)" ([email protected][email protected]@[email protected]@@Z) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall output_layer::list_outputs(void)" ([email protected][email protected]@QAEXXZ) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: __thiscall middle_layer::middle_layer(int,int)" ([email protected]@[email protected]@Z) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: __thiscall middle_layer::~middle_layer(void)" ([email protected]@[email protected]) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall middle_layer::calc_error(void)" ([email protected][email protected]@QAEXXZ) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: __thiscall network::network(void)" ([email protected]@[email protected]) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: __thiscall network::~network(void)" ([email protected]@[email protected]) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall network::set_training(unsigned int const &)" ([email protected]@@[email protected]) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: unsigned int __thiscall network::get_training_value(void)" ([email protected]@@QAEIXZ) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall network::get_layer_info(void)" ([email protected]@@QAEXXZ) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall network::set_up_network(void)" ([email protected]@@QAEXXZ) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall network::randomize_weights(void)" ([email protected]@@QAEXXZ) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall network::update_weights(float)" ([email protected]@@[email protected]) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall network::write_weights(struct _iobuf *)" ([email protected]@@[email protected]@@Z) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall network::read_weights(struct _iobuf *)" ([email protected]@@[email protected]@@Z) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall network::list_weights(void)" ([email protected]@@QAEXXZ) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall network::list_outputs(void)" ([email protected]@@QAEXXZ) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall network::write_outputs(struct _iobuf *)" ([email protected]@@[email protected]@@Z) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall network::list_errors(void)" ([email protected]@@QAEXXZ) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: int __thiscall network::fill_IObuffer(struct _iobuf *)" ([email protected]@@[email protected]@@Z) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall network::set_up_pattern(int)" ([email protected]@@[email protected]) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall network::forward_prop(void)" ([email protected]@@QAEXXZ) already defined in kohonen.obj 
layer.obj : error LNK2005: "public: void __thiscall network::backward_prop(float &)" ([email protected]@@[email protected]) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: __thiscall Kohonen_layer::Kohonen_layer(int,int,int)" ([email protected]@[email protected]@Z) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: __thiscall Kohonen_layer::~Kohonen_layer(void)" ([email protected]@[email protected]) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: virtual void __thiscall Kohonen_layer::calc_out(void)" ([email protected][email protected]@UAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall Kohonen_layer::randomize_weights(void)" ([email protected][email protected]@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall Kohonen_layer::update_neigh_size(int)" ([email protected][email protected]@[email protected]) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall Kohonen_layer::update_weights(float)" ([email protected][email protected]@[email protected]) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall Kohonen_layer::list_weights(void)" ([email protected][email protected]@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall Kohonen_layer::list_outputs(void)" ([email protected][email protected]@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: float __thiscall Kohonen_layer::get_win_dist(void)" ([email protected][email protected]@QAEMXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: __thiscall Kohonen_network::Kohonen_network(void)" ([email protected]@[email protected]) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: __thiscall Kohonen_network::~Kohonen_network(void)" ([email protected]@[email protected]) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall Kohonen_network::get_layer_info(void)" ([email protected][email protected]@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall Kohonen_network::set_up_network(int)" ([email protected][email protected]@[email protected]) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall Kohonen_network::randomize_weights(void)" ([email protected][email protected]@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall Kohonen_network::update_neigh_size(int)" ([email protected][email protected]@[email protected]) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall Kohonen_network::update_weights(float)" ([email protected][email protected]@[email protected]) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall Kohonen_network::list_weights(void)" ([email protected][email protected]@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall Kohonen_network::list_outputs(void)" ([email protected][email protected]@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall Kohonen_network::get_next_vector(struct _iobuf *)" ([email protected][email protected]@[email protected]@@Z) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall Kohonen_network::process_next_pattern(void)" ([email protected][email protected]@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: float __thiscall Kohonen_network::get_win_dist(void)" ([email protected][email protected]@QAEMXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: int __thiscall Kohonen_network::get_win_index(void)" ([email protected][email protected]@QAEHXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: __thiscall input_layer::input_layer(int,int)" ([email protected]@[email protected]@Z) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: __thiscall input_layer::~input_layer(void)" ([email protected]@[email protected]) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: virtual void __thiscall input_layer::calc_out(void)" ([email protected][email protected]@UAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: __thiscall output_layer::output_layer(int,int)" ([email protected]@[email protected]@Z) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: __thiscall output_layer::~output_layer(void)" ([email protected]@[email protected]) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: virtual void __thiscall output_layer::calc_out(void)" ([email protected][email protected]@UAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall output_layer::calc_error(float &)" ([email protected][email protected]@[email protected]) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall output_layer::randomize_weights(void)" ([email protected][email protected]@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall output_layer::update_weights(float)" ([email protected][email protected]@[email protected]) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall output_layer::list_weights(void)" ([email protected][email protected]@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall output_layer::list_errors(void)" ([email protected][email protected]@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall output_layer::write_weights(int,struct _iobuf *)" ([email protected][email protected]@[email protected]@@Z) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall output_layer::read_weights(int,struct _iobuf *)" ([email protected][email protected]@[email protected]@@Z) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall output_layer::list_outputs(void)" ([email protected][email protected]@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: __thiscall middle_layer::middle_layer(int,int)" ([email protected]@[email protected]@Z) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: __thiscall middle_layer::~middle_layer(void)" ([email protected]@[email protected]) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall middle_layer::calc_error(void)" ([email protected][email protected]@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: __thiscall network::network(void)" ([email protected]@[email protected]) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: __thiscall network::~network(void)" ([email protected]@[email protected]) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall network::set_training(unsigned int const &)" ([email protected]@@[email protected]) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: unsigned int __thiscall network::get_training_value(void)" ([email protected]@@QAEIXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall network::get_layer_info(void)" ([email protected]@@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall network::set_up_network(void)" ([email protected]@@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall network::randomize_weights(void)" ([email protected]@@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall network::update_weights(float)" ([email protected]@@[email protected]) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall network::write_weights(struct _iobuf *)" ([email protected]@@[email protected]@@Z) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall network::read_weights(struct _iobuf *)" ([email protected]@@[email protected]@@Z) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall network::list_weights(void)" ([email protected]@@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall network::list_outputs(void)" ([email protected]@@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall network::write_outputs(struct _iobuf *)" ([email protected]@@[email protected]@@Z) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall network::list_errors(void)" ([email protected]@@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: int __thiscall network::fill_IObuffer(struct _iobuf *)" ([email protected]@@[email protected]@@Z) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall network::set_up_pattern(int)" ([email protected]@@[email protected]) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall network::forward_prop(void)" ([email protected]@@QAEXXZ) already defined in kohonen.obj 
layerk.obj : error LNK2005: "public: void __thiscall network::backward_prop(float &)" ([email protected]@@[email protected]) already defined in kohonen.obj 
Debug/Test4.exe : fatal error LNK1169: one or more multiply defined symbols found 

プログラムのコードソースがエラーだけで、あなたのコードを見ていなければ、ここで http://blog.drsofts.com/konohen.zip

+5

質問を再定式化する必要があります。この形式では、おそらく閉鎖されます。誰もあなたのプログラムをダウンロードして検査するつもりはない。いくつかの協力**が必要です**。 – kkm

+0

同じオブジェクトファイルを2回リンクするか、#includesなどを混乱させて同じ関数を2回定義するかのように見えます。冗長な出力にリンクして、より多くの情報を取得してみてください。プロジェクトからkohonen.cppを取り出してみてください。次に、試したこととその結果を説明します。 – kkm

答えて

4

ダウンロードすることができ、あなたが次のいずれかを行っているようだ:

  1. が.cppファイルの代わりに

はI」のヘッダファイルが含まれ

  • 実現される機能は、異なるオブジェクトファイルに乗算関数をインラインでマーキングすることなく、ヘッダ内しかし、クラス定義外部いくつかの機能を実装しdは個人的には3番目のケースだと推測します。この問題についてはkohonen.cppとlayerk.cppを確認してください。また、これらのファイルに含まれるヘッダーの1つに含まれている場合もあります。 -Eまたは/ Eコンパイラー・オプションを使用して、ファイルの前処理結果を取得することができます。これは、関数定義がどこから由来しているかを見つけるのに役立ちます。

  • 関連する問題