When cmake compiles caffe, it prompts that "the CPP exception handler is used, but the unfold semantics is not enabled." Please specify / EHsc "and then output tons of errors

compiling caffe, cannot be compiled by following the instructions in the windows branch of caffe on Github.

The

system is Windows10,VS version 14.0 (VS2015). Follow the instructions for build_win.cmd, that runs the script directory to output warning at compile time.

warning C4530:  CPP  /EHsc [D:\caffe-windows\scripts\build\tools\caffe.bin.vcxproj]

and

warning C4577:  "noexcept"; /EHsc [D:\caffe-windows\scripts\build\tools\caffe.bin.vcxproj]

then there will be tons of errors, all of which are:

error LNK2001:  "void __cdecl boost::throw_exception(class std::exception const &)" (?throw_exception@boost@@YAXAEBVexception@std@@@Z) [D:\caffe-windows\scripts\build\tools\compute_image_mean.vcxproj]

found some solutions, but they are all about where to configure the VS project, but this is not a VS project. I am compiling things with cmake on the command line.

what should I modify to make it compile properly? The reason for laboratory machines can only be windows.

Thank you.

May.22,2021

set_target_properties (target PROPERTIES COMPILE_FLAGS "/ EHsc")
for more information, please refer to the god's blog:
https://blog.csdn.net/xum2008.

.
Menu