Open aliushn opened 8 years ago
We added the lstm_unit_layer.cpp, lstm_layer.cpp and lstm_layer.hpp to the project . And build libcaffe.lib successfully. But got fatal errors when build the caffe.exe:
lstm_layer.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void cdecl caffe::RecurrentLayer::Backward_cpu(class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &,class std::vector<bool,class std::allocator > const &,class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &)" (?Backward_cpu@?$RecurrentLayer@M@caffe@@MEAAXAEBV?$vector@PEAV?$Blob@M@caffe@@V?$allocator@PEAV?$Blob@M@caffe@@@std@@@std@@AEBV?$vector@_NV?$allocator@_N@std@@@4@0@Z) 1>lstm_layer.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __cdecl caffe::RecurrentLayer::Forward_gpu(class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &,class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &)" (?Forward_gpu@?$RecurrentLayer@M@caffe@@MEAAXAEBV?$vector@PEAV?$Blob@M@caffe@@V?$allocator@PEAV?$Blob@M@caffe@@@std@@@std@@0@Z) 1>lstm_layer.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void cdecl caffe::RecurrentLayer::Forward_cpu(class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &,class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &)" (?Forward_cpu@?$RecurrentLayer@M@caffe@@MEAAXAEBV?$vector@PEAV?$Blob@M@caffe@@V?$allocator@PEAV?$Blob@M@caffe@@@std@@@std@@0@Z) 1>lstm_layer.obj : error LNK2001: 无法解析的外部符号 "public: virtual void cdecl caffe::RecurrentLayer::Reset(void)" (?Reset@?$RecurrentLayer@M@caffe@@UEAAXXZ) 1>lstm_layer.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __cdecl caffe::RecurrentLayer::Reshape(class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &,class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &)" (?Reshape@?$RecurrentLayer@M@caffe@@UEAAXAEBV?$vector@PEAV?$Blob@M@caffe@@V?$allocator@PEAV?$Blob@M@caffe@@@std@@@std@@0@Z) 1>lstm_layer.obj : error LNK2001: 无法解析的外部符号 "public: virtual void cdecl caffe::RecurrentLayer::LayerSetUp(class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &,class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &)" (?LayerSetUp@?$RecurrentLayer@M@caffe@@UEAAXAEBV?$vector@PEAV?$Blob@M@caffe@@V?$allocator@PEAV?$Blob@M@caffe@@@std@@@std@@0@Z) 1>lstm_layer.obj : error LNK2001: 无法解析的外部符号 "public: virtual void cdecl caffe::LSTMLayer::Backward_gpu(class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &,class std::vector<bool,class std::allocator > const &,class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &)" (?Backward_gpu@?$LSTMLayer@N@caffe@@UEAAXAEBV?$vector@PEAV?$Blob@N@caffe@@V?$allocator@PEAV?$Blob@N@caffe@@@std@@@std@@AEBV?$vector@_NV?$allocator@_N@std@@@4@0@Z) 1>lstm_layer.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __cdecl caffe::LSTMLayer::Forward_gpu(class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &,class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &)" (?Forward_gpu@?$LSTMLayer@N@caffe@@UEAAXAEBV?$vector@PEAV?$Blob@N@caffe@@V?$allocator@PEAV?$Blob@N@caffe@@@std@@@std@@0@Z) 1>lstm_layer.obj : error LNK2001: 无法解析的外部符号 "public: virtual void cdecl caffe::LSTMLayer::Backward_gpu(class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &,class std::vector<bool,class std::allocator > const &,class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &)" (?Backward_gpu@?$LSTMLayer@M@caffe@@UEAAXAEBV?$vector@PEAV?$Blob@M@caffe@@V?$allocator@PEAV?$Blob@M@caffe@@@std@@@std@@AEBV?$vector@_NV?$allocator@_N@std@@@4@0@Z) 1>lstm_layer.obj : error LNK2001: 无法解析的外部符号 "public: virtual void cdecl caffe::LSTMLayer::Forward_gpu(class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &,class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &)" (?Forward_gpu@?$LSTMLayer@M@caffe@@UEAAXAEBV?$vector@PEAV?$Blob@M@caffe@@V?$allocator@PEAV?$Blob@M@caffe@@@std@@@std@@0@Z) 1>lstm_layer.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void __cdecl caffe::RecurrentLayer::Backward_cpu(class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &,class std::vector<bool,class std::allocator > const &,class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &)" (?Backward_cpu@?$RecurrentLayer@N@caffe@@MEAAXAEBV?$vector@PEAV?$Blob@N@caffe@@V?$allocator@PEAV?$Blob@N@caffe@@@std@@@std@@AEBV?$vector@_NV?$allocator@_N@std@@@4@0@Z) 1>lstm_layer.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void cdecl caffe::RecurrentLayer::Forward_gpu(class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &,class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &)" (?Forward_gpu@?$RecurrentLayer@N@caffe@@MEAAXAEBV?$vector@PEAV?$Blob@N@caffe@@V?$allocator@PEAV?$Blob@N@caffe@@@std@@@std@@0@Z) 1>lstm_layer.obj : error LNK2001: 无法解析的外部符号 "protected: virtual void cdecl caffe::RecurrentLayer::Forward_cpu(class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &,class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &)" (?Forward_cpu@?$RecurrentLayer@N@caffe@@MEAAXAEBV?$vector@PEAV?$Blob@N@caffe@@V?$allocator@PEAV?$Blob@N@caffe@@@std@@@std@@0@Z) 1>lstm_layer.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __cdecl caffe::RecurrentLayer::Reset(void)" (?Reset@?$RecurrentLayer@N@caffe@@UEAAXXZ) 1>lstm_layer.obj : error LNK2001: 无法解析的外部符号 "public: virtual void cdecl caffe::RecurrentLayer::Reshape(class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &,class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &)" (?Reshape@?$RecurrentLayer@N@caffe@@UEAAXAEBV?$vector@PEAV?$Blob@N@caffe@@V?$allocator@PEAV?$Blob@N@caffe@@@std@@@std@@0@Z) 1>lstm_layer.obj : error LNK2001: 无法解析的外部符号 "public: virtual void __cdecl caffe::RecurrentLayer::LayerSetUp(class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &,class std::vector<class caffe::Blob ,class std::allocator<class caffe::Blob > > const &)" (?LayerSetUp@?$RecurrentLayer@N@caffe@@UEAAXAEBV?$vector@PEAV?$Blob@N@caffe@@V?$allocator@PEAV?$Blob@N@caffe@@@std@@@std@@0@Z) 1>D:\caffe\caffe-master816\caffe-master\windows..\Build\x64\Release\caffe.exe : fatal error LNK1120: 16 个无法解析的外部命令
Did you include lstm_unit_layer.cu?
no, I build a CPU version without CUDA
I met the same problem. Libcaffe is built successfully. But when I try to build caffe.cpp, I get the same error message.
We added the lstm_unit_layer.cpp, lstm_layer.cpp and lstm_layer.hpp to the project . And build libcaffe.lib successfully. But got fatal errors when build the caffe.exe: