how to add Caffe in Visual Studio C++ project ?

207 views
Skip to first unread message

Bae MinCheon

unread,
Jun 29, 2018, 9:48:43 AM6/29/18
to Caffe Users
after I finished building Caffe on Windows 10, I've managed to execute MNIST example too
next step was making my own project using Caffe...but I didn't find any clear solution this time

so many posts that I've found say about "old" Caffe or "different" environment such as LINUX OSX...
( I'm using the lastest BVLC/Caffe on Windows 10 )

because I don't have any idea about it, I decide to compile with including "caffe/caffe.hpp"
I thought that when compilation is successful, my project supports Caffe
I tried it this way

※ $PROJECT_ROOT = my project location
※ $CAFFE_ROOT = my Caffe location
※ $3RDPARTY_ROOT = 3rd party library location ( default : C:\Users\[USER_NAME]\.caffe\dependencies\libraries_v140_x64_py35_1.1.0\libraries )

0. making project
Visual C++ / Win32 Consol Application

1. making directories
$PROJECT_ROOT\caffe
$PROJECT_ROOT\caffe\include
$PROJECT_ROOT\caffe\lib

2. copy & paste
$CAFFE_ROOT\include → $PROJECT_ROOT\caffe\include



3. compile & error

error message looks like saying add 3rd party library


5. copy & paste

$3RDPARTY_ROOT\include → $PROJECT_ROOT\caffe\include


6. directory modify

$PROJECT_ROOT\include\boost-1_16\boost → $PROJECT_ROOT\caffe\include\boost


7. compile & error


8. copy & paste

$CAFFE_ROOT\scripts\build\include\caffe → $PROJECT_ROOT\caffe\include\caffe


9. compile & error

I don't know how to take care of this error

searching for "libboost_date_time-vc140-mt-1_61.lib" doesn't result something useful to solve this error

while searching in $3RDPARTY_ROOT, I eventually found "boost_date_time-vc140-mt-1_61.lib"

as the last resort, I supposed that this error may be caused by filename


10. copy & paste

$3RDPARTY_ROOT\lib\boost_date_time-vc140-mt-1_61.lib → $PROJECT_ROOT\caffe\lib

$3RDPARTY_ROOT\lib\boost_filesystem-vc140-mt-1_61.lib → $PROJECT_ROOT\caffe\lib

$3RDPARTY_ROOT\lib\boost_system-vc140-mt-1_61.lib → $PROJECT_ROOT\caffe\lib

( by the same reason, other 2 lib files are copied too )


11. rename
$PROJECT_ROOT\caffe\lib\boost_date_time-vc140-mt-1_61.lib → $PROJECT_ROOT\caffe\lib\libboost_date_time-vc140-mt-1_61.lib
$PROJECT_ROOT\caffe\lib\boost_filesystem-vc140-mt-1_61.lib → $PROJECT_ROOT\caffe\lib\libboost_filesystem-vc140-mt-1_61.lib
$PROJECT_ROOT\caffe\lib\boost_system-vc140-mt-1_61.lib → $PROJECT_ROOT\caffe\lib\libboost_system-vc140-mt-1_61.lib

12. compile & error

error seems saying add "boost_system-vc140-mt-1_61.dll"

13. copy & paste
$3RDPARTY_ROOT\lib\boost_system-vc140-mt-1_61.lib → ../$PROJECT_ROOT ./x64/Release


14. compile & error


finally done...

as you see, I've done it manually but I wonder that there is better way
any suggestion or hint would be helpful for me
thank you
Reply all
Reply to author
Forward
0 new messages