BVLC / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
34.03k stars 18.7k forks source link

How to call function caffe::caffe_add in external project? #6848

Closed Mactarvish closed 4 years ago

Mactarvish commented 4 years ago

I'm trying to call caffe::caffe_add and caffe::caffe_div in my own project using VS2015. I've added head files that I may need in Additional Include Directories, and added the same .lib files with the "classification" example. But when I built the project, I got the error LNK2019 unresolved external symbol "void __cdecl caffe::caffe_add<int>(int,int const *,int const *,int *)" (??$caffe_add@H@caffe@@YAXHPEBH0PEAH@Z) referenced in function main ... Does this mean I added the wrong .lib file? Which .lib file contain the two functions? Thanks in advance.

Mactarvish commented 4 years ago

Such is my code: `#include <caffe\caffe.hpp>

int main() { int a = new int(1); int b = new int(1); int* y = new int(1); caffe::caffe_add(2, a, b, y); return 0; }

`