openvinotoolkit / openvino

OpenVINO™ is an open-source toolkit for optimizing and deploying AI inference
https://docs.openvino.ai
Apache License 2.0
7.29k stars 2.27k forks source link

[Bug]: Linking openvino with static library results in error #24856

Closed feixuedudiao closed 5 months ago

feixuedudiao commented 5 months ago

OpenVINO Version

2024.01/2024.1.0

Operating System

Windows System

Device used for inference

CPU

Framework

None

Model used

No response

Issue description

When linking static libraries, error LNK2019: ????????? "declspec(dllimport) public: cdecl ov::CompiledModel:

Step-by-step reproduction

I linked it in cmakelist according to the document](https://github.com/openvinotoolkit/openvino/blob/master/docs/dev/static_libaries.md#link-static-openvino-runtime), but found that an error occurred when linking the library. The static library was compiled by vcpkg.

if(WIN32) if(CMAKE_BUILD_TYPE MATCHES "release") set(OPENVINO_AUTO_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino_auto_plugin.lib") set(OPENVINO_INTEL_CPU_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino_intel_cpu_plugin.lib") set(OPENVINO_INTEL_GPU_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino_intel_gpu_plugin.lib") set(OPENVINO_INTEL_GPU_RUNTIME_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino_intel_gpu_runtime.lib")
set(OPENVINO_ONEDNN_CPU_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino_onednn_cpu.lib") set(OPENVINO_IR_FRONT_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino_ir_frontend.lib") set(OPENVINO_REFER_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino_reference.lib") set(OPENVINO_SHAPE_INFER_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino_shape_inference.lib") set(OPENVINO_UTIL_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino_util.lib")
set(OPENVINO_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino.lib") set(OPENVINO_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/")

    file (GLOB opencv_libs  "${CMAKE_CURRENT_SOURCE_DIR}/../third_party/opencv/lib/x64/release/*.lib")      
    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi /O1")
    set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
else()
    set(OPENVINO_AUTO_LIBRARIES   "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Debug/openvino_auto_plugind.lib")
    set(OPENVINO_INTEL_CPU_LIBRARIES   "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Debug/openvino_intel_cpu_plugind.lib")
    set(OPENVINO_INTEL_GPU_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Debug/openvino_intel_gpu_plugind.lib")
    set(OPENVINO_INTEL_GPU_RUNTIME_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Debug/openvino_intel_gpu_runtimed.lib")
    set(OPENVINO_ONEDNN_CPU_LIBRARIES   "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Debug/openvino_onednn_cpud.lib")
    set(OPENVINO_IR_FRONT_LIBRARIES   "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Debug/openvino_ir_frontendd.lib")
    set(OPENVINO_REFER_LIBRARIES   "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Debug/openvino_referenced.lib")
    set(OPENVINO_SHAPE_INFER_LIBRARIES   "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Debug/openvino_shape_inferenced.lib")
    set(OPENVINO_UTIL_LIBRARIES   "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Debug/openvino_utild.lib")
    set(OPENVINO_LIBRARIES     "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Debug/openvinod.lib")
    set(OPENVINO_PATH      "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Debug/")

    file (GLOB opencv_libs  "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/opencv/lib/x64/debug/*.lib")

endif()

endif()

find_package(OpenVINO REQUIRED)

message("OPENVINO_LIBRARIES =" ${OpenVINO}) target_link_libraries(img_seg_Openvino PRIVATE ${OPENVINO_AUTO_LIBRARIES} ${OPENVINO_IR_FRONT_LIBRARIES} ${OPENVINO_SHAPE_INFER_LIBRARIES} ${OPENVINO_REFER_LIBRARIES} ${OPENVINO_INTEL_CPU_LIBRARIES} ${OPENVINO_INTEL_GPU_LIBRARIES} ${OPENVINO_INTEL_GPU_RUNTIME_LIBRARIES} ${OPENVINO_ONEDNN_CPU_LIBRARIES} ${OPENVINO_LIBRARIES} ${opencv_libs} ${TBB_LIBRARY} ) set_target_properties(img_seg_Openvino PROPERTIES LINK_FLAGS "/WHOLEARCHIVE:openvino_auto_plugin" ) set_target_properties(img_seg_Openvino PROPERTIES LINK_FLAGS "/WHOLEARCHIVE:openvino_ir_frontend" ) set_target_properties(img_seg_Openvino PROPERTIES LINK_FLAGS "/WHOLEARCHIVE:openvino" ) set_target_properties(img_seg_Openvino PROPERTIES LINK_FLAGS "/WHOLEARCHIVE:openvino_intel_cpu_plugin" ) set_target_properties(img_seg_Openvino PROPERTIES LINK_FLAGS "/WHOLEARCHIVE:openvino_intel_gpu_plugin" )

Relevant log output

LINK : warning LNK4217: ??"?inputs@CompiledModel@ov@@QEBAAEBV?$vector@V?$Output@$$CBVNode@ov@@@ov@@V?$allocator@V?$Outp
ut@$$CBVNode@ov@@@ov@@@std@@@std@@XZ (public: class std::vector<class ov::Output<class ov::Node const >,class std::allo
cator<class ov::Output<class ov::Node const > > > const & __cdecl ov::CompiledModel::inputs(void)const )"(?" openvino.l
ib(compiled_model.cpp.obj)"???)??"BlurSegProce.obj"(??""public: int __cdecl BlurSeg::initNet(void)" (?initNet@BlurSeg@@
QEAAHXZ)"?)?? [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
LINK : warning LNK4217: ??"?create_infer_request@CompiledModel@ov@@QEAA?AVInferRequest@2@XZ (public: class ov::InferReq
uest __cdecl ov::CompiledModel::create_infer_request(void))"(?" openvino.lib(compiled_model.cpp.obj)"???)??"BlurSegProc
e.obj"(??""public: int __cdecl BlurSeg::inferNet(struct tagImageInfo *,struct tagImageInfo *)" (?inferNet@BlurSeg@@QEAA
HPEAUtagImageInfo@@0@Z)"?)?? [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
BlurSegProce.obj : error LNK2019: ????????? "__declspec(dllimport) public: __cdecl ov::CompiledModel::CompiledModel(voi
d)" (__imp_??0CompiledModel@ov@@QEAA@XZ),?? "public: __cdecl BlurSeg::BlurSeg(void)" (??0BlurSeg@@QEAA@XZ) ??????? [F:\
Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
BlurSegProce.obj : error LNK2019: ????????? "__declspec(dllimport) public: class ov::CompiledModel & __cdecl ov::Compil
edModel::operator=(class ov::CompiledModel const &)" (__imp_??4CompiledModel@ov@@QEAAAEAV01@AEBV01@@Z),?? "public: int
__cdecl BlurSeg::initNet(void)" (?initNet@BlurSeg@@QEAAHXZ) ??????? [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_rel
ease_x64\src\img_seg_Openvino.vcxproj]
BlurSegProce.obj : error LNK2019: ????????? "__declspec(dllimport) public: __cdecl ov::Core::Core(class std::basic_stri
ng<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0Core@ov@@QEAA@AEBV?$basic_string
@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z),?? "public: int __cdecl BlurSeg::initNet(void)" (?initNet@BlurSeg@@Q
EAAHXZ) ??????? [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
BlurSegProce.obj : error LNK2019: ????????? "__declspec(dllimport) public: class std::shared_ptr<class ov::Model> __cde
cl ov::Core::read_model(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &
,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)const " (__imp_?read_m
odel@Core@ov@@QEBA?AV?$shared_ptr@VModel@ov@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@0@Z),?
? "public: int __cdecl BlurSeg::initNet(void)" (?initNet@BlurSeg@@QEAAHXZ) ??????? [F:\Share\OneDNN\OpenVINO\BlurSegOpe
nvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
BlurSegProce.obj : error LNK2019: ????????? "__declspec(dllimport) public: class ov::CompiledModel __cdecl ov::Core::co
mpile_model(class std::shared_ptr<class ov::Model const > const &,class std::basic_string<char,struct std::char_traits<
char>,class std::allocator<char> > const &,class std::map<class std::basic_string<char,struct std::char_traits<char>,cl
ass std::allocator<char> >,class ov::Any,struct std::less<class std::basic_string<char,struct std::char_traits<char>,cl
ass std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits
<char>,class std::allocator<char> > const ,class ov::Any> > > const &)" (__imp_?compile_model@Core@ov@@QEAA?AVCompiledM
odel@2@AEBV?$shared_ptr@$$CBVModel@ov@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@5@AEBV?$map@V?
$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VAny@ov@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$
allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VAny@ov@@
@std@@@2@@5@@Z),?? "public: class ov::CompiledModel __cdecl ov::Core::compile_model<struct std::pair<class std::basic_s
tring<char,struct std::char_traits<char>,class std::allocator<char> >,class ov::Any>,struct std::pair<class std::basic_
string<char,struct std::char_traits<char>,class std::allocator<char> >,class ov::Any>,struct std::pair<class std::basic
_string<char,struct std::char_traits<char>,class std::allocator<char> >,class ov::Any> >(class std::shared_ptr<class ov
::Model const > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &
,struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class ov::Any
> &&,struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class ov:
:Any> &&,struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class
 ov::Any> &&)" (??$compile_model@U?$pair@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VAny@ov@@@std@@U
12@U12@@Core@ov@@QEAA?AVCompiledModel@1@AEBV?$shared_ptr@$$CBVModel@ov@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@
@V?$allocator@D@2@@4@$$QEAU?$pair@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VAny@ov@@@4@22@Z) ?????
?? [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
BlurSegProce.obj : error LNK2019: ????????? "__declspec(dllimport) public: void __cdecl ov::Core::set_property(class st
d::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class ov::Any,struct std
::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<s
truct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,class ov
::Any> > > const &)" (__imp_?set_property@Core@ov@@QEAAXAEBV?$map@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D
@2@@std@@VAny@ov@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$
basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VAny@ov@@@std@@@2@@std@@@Z),?? "public: void __cdecl ov::Cor
e::set_property<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>
>,class ov::Any> >(struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<cha
r> >,class ov::Any> &&)" (??$set_property@U?$pair@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VAny@ov
@@@std@@@Core@ov@@QEAAX$$QEAU?$pair@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VAny@ov@@@std@@@Z) ??
????? [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
BlurSegProce.obj : error LNK2019: ????????? "__declspec(dllimport) public: class ov::Any __cdecl ov::Core::get_property
(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_strin
g<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::map<class std::basic_string<char,s
truct std::char_traits<char>,class std::allocator<char> >,class ov::Any,struct std::less<class std::basic_string<char,s
truct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_stri
ng<char,struct std::char_traits<char>,class std::allocator<char> > const ,class ov::Any> > > const &)const " (__imp_?ge
t_property@Core@ov@@QEBA?AVAny@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0AEBV?$map@V?$basic_s
tring@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VAny@ov@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocato
r@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VAny@ov@@@std@@@2
@@5@@Z),?? "public: class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<c
har> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >
 __cdecl ov::Core::get_property<class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std:
:allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator
<char> > > >,0>(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct
ov::Property<class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,
class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >,0> con
st &)const " (??$get_property@V?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$b
asic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@$0A@@Core@ov@@QEBA?AV?$vector@V?$basic_string@DU?$ch
ar_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@
std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@3@AEBU?$Property@V?$vector@V?$basic_string@DU?$char_tr
aits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@
$0A@@1@@Z) ??????? [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
BlurSegProce.obj : error LNK2019: ????????? "__declspec(dllimport) public: __cdecl ov::Core::~Core(void)" (__imp_??1Cor
e@ov@@QEAA@XZ),?? "public: int __cdecl BlurSeg::initNet(void)" (?initNet@BlurSeg@@QEAAHXZ) ??????? [F:\Share\OneDNN\Ope
nVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
BlurSegProce.obj : error LNK2001: ????????? "public: __cdecl ov::Core::~Core(void)" (??1Core@ov@@QEAA@XZ) [F:\Share\One
DNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(adaptive_pooling.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits
 const & __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN
\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(multi_tensor_variable_state.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::fo
rmat_traits const & __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\S
hare\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(graph.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const & __
cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVINO\B
lurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(convert.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const &
__cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVINO
\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(constant.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const &
 __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVIN
O\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(broadcast.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const
& __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVI
NO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(batch_to_space.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits c
onst & __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\O
penVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(embedding_bag.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits co
nst & __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\Op
enVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(eltwise.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const &
__cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVINO
\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(custom.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const & _
_cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVINO\
BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(ctc_greedy_decoder.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_trai
ts const & __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneD
NN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(experimental_detectron_roi_feature_extractor.cpp.obj) : error LNK2001: ????????? "public:
 struct cldnn::format_traits const & __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_t
raits@2@XZ) [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(experimental_detectron_prior_grid_generator.cpp.obj) : error LNK2001: ????????? "public:
struct cldnn::format_traits const & __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_tr
aits@2@XZ) [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(experimental_detectron_generate_proposals_single_image.cpp.obj) : error LNK2001: ????????
? "public: struct cldnn::format_traits const & __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAE
BUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(experimental_detectron_detection_output.cpp.obj) : error LNK2001: ????????? "public: stru
ct cldnn::format_traits const & __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits
@2@XZ) [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(generate_proposals.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_trai
ts const & __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneD
NN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(gather.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const & _
_cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVINO\
BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(gather_tree.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits cons
t & __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\Open
VINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(fully_connected.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits
const & __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\
OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(multinomial.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits cons
t & __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\Open
VINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(multiclass_nms.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits c
onst & __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\O
penVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(matrix_nms.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const
 & __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenV
INO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(loop.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const & __c
decl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVINO\Bl
urSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(pooling.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const &
__cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVINO
\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(parameter.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const
& __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVI
NO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(normalize_l2.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits con
st & __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\Ope
nVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(non_max_suppression.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_tra
its const & __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\One
DNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(reshape.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const &
__cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVINO
\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(reduce.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const & _
_cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVINO\
BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(range.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const & __
cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVINO\B
lurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(proposal.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const &
 __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVIN
O\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(select.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const & _
_cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVINO\
BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(roll.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const & __c
decl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVINO\Bl
urSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(rnn.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const & __cd
ecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVINO\Blu
rSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(result.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const & _
_cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVINO\
BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(variable_state.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits c
onst & __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\O
penVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(variable.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const &
 __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVIN
O\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(topk.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits const & __c
decl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\OpenVINO\Bl
urSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(space_to_batch.cpp.obj) : error LNK2001: ????????? "public: struct cldnn::format_traits c
onst & __cdecl cldnn::format::traits(void)const " (?traits@format@cldnn@@QEBAAEBUformat_traits@2@XZ) [F:\Share\OneDNN\O
penVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(variable_state.cpp.obj) : error LNK2019: ????????? "public: struct cldnn::tensor __cdecl
cldnn::layout::get_buffer_size(void)const " (?get_buffer_size@layout@cldnn@@QEBA?AUtensor@2@XZ),?? "protected: void __c
decl ov::intel_gpu::VariableState::update_device_buffer(void)" (?update_device_buffer@VariableState@intel_gpu@ov@@IEAAX
XZ) ??????? [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(constant.cpp.obj) : error LNK2001: ????????? "public: unsigned __int64 __cdecl cldnn::lay
out::get_linear_size(void)const " (?get_linear_size@layout@cldnn@@QEBA_KXZ) [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\c
make_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(variable_state.cpp.obj) : error LNK2001: ????????? "public: unsigned __int64 __cdecl cldn
n::layout::get_linear_size(void)const " (?get_linear_size@layout@cldnn@@QEBA_KXZ) [F:\Share\OneDNN\OpenVINO\BlurSegOpen
vino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(sync_infer_request.cpp.obj) : error LNK2001: ????????? "public: unsigned __int64 __cdecl
cldnn::layout::get_linear_size(void)const " (?get_linear_size@layout@cldnn@@QEBA_KXZ) [F:\Share\OneDNN\OpenVINO\BlurSeg
Openvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(rnn.cpp.obj) : error LNK2001: ????????? "public: unsigned __int64 __cdecl cldnn::layout::
get_linear_size(void)const " (?get_linear_size@layout@cldnn@@QEBA_KXZ) [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_
release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(normalize_l2.cpp.obj) : error LNK2001: ????????? "public: unsigned __int64 __cdecl cldnn:
:layout::get_linear_size(void)const " (?get_linear_size@layout@cldnn@@QEBA_KXZ) [F:\Share\OneDNN\OpenVINO\BlurSegOpenvi
no\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(broadcast.cpp.obj) : error LNK2001: ????????? "public: class std::vector<int,class std::a
llocator<int> > __cdecl cldnn::layout::get_dims(void)const " (?get_dims@layout@cldnn@@QEBA?AV?$vector@HV?$allocator@H@s
td@@@std@@XZ) [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(eltwise.cpp.obj) : error LNK2001: ????????? "public: class std::vector<int,class std::all
ocator<int> > __cdecl cldnn::layout::get_dims(void)const " (?get_dims@layout@cldnn@@QEBA?AV?$vector@HV?$allocator@H@std
@@@std@@XZ) [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(custom.cpp.obj) : error LNK2001: ????????? "public: class std::vector<int,class std::allo
cator<int> > __cdecl cldnn::layout::get_dims(void)const " (?get_dims@layout@cldnn@@QEBA?AV?$vector@HV?$allocator@H@std@
@@std@@XZ) [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(ctc_greedy_decoder.cpp.obj) : error LNK2001: ????????? "public: class std::vector<int,cla
ss std::allocator<int> > __cdecl cldnn::layout::get_dims(void)const " (?get_dims@layout@cldnn@@QEBA?AV?$vector@HV?$allo
cator@H@std@@@std@@XZ) [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(convert.cpp.obj) : error LNK2001: ????????? "public: class std::vector<int,class std::all
ocator<int> > __cdecl cldnn::layout::get_dims(void)const " (?get_dims@layout@cldnn@@QEBA?AV?$vector@HV?$allocator@H@std
@@@std@@XZ) [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(gather.cpp.obj) : error LNK2001: ????????? "public: class std::vector<int,class std::allo
cator<int> > __cdecl cldnn::layout::get_dims(void)const " (?get_dims@layout@cldnn@@QEBA?AV?$vector@HV?$allocator@H@std@
@@std@@XZ) [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(gather_tree.cpp.obj) : error LNK2001: ????????? "public: class std::vector<int,class std:
:allocator<int> > __cdecl cldnn::layout::get_dims(void)const " (?get_dims@layout@cldnn@@QEBA?AV?$vector@HV?$allocator@H
@std@@@std@@XZ) [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(fully_connected.cpp.obj) : error LNK2001: ????????? "public: class std::vector<int,class
std::allocator<int> > __cdecl cldnn::layout::get_dims(void)const " (?get_dims@layout@cldnn@@QEBA?AV?$vector@HV?$allocat
or@H@std@@@std@@XZ) [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]
openvino_intel_gpu_plugin.lib(embedding_bag.cpp.obj) : error LNK2001: ????????? "public: class std::vector<int,class st
d::allocator<int> > __cdecl cldnn::layout::get_dims(void)const " (?get_dims@layout@cldnn@@QEBA?AV?$vector@HV?$allocator
@H@std@@@std@@XZ) [F:\Share\OneDNN\OpenVINO\BlurSegOpenvino\cmake_release_x64\src\img_seg_Openvino.vcxproj]

Issue submission checklist

ilya-lavrenov commented 5 months ago

Hi @feixuedudiao

Any reason why do you explicitly mention all these libraries?

if(WIN32)
if(CMAKE_BUILD_TYPE MATCHES "release")
set(OPENVINO_AUTO_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino_auto_plugin.lib")
set(OPENVINO_INTEL_CPU_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino_intel_cpu_plugin.lib")
set(OPENVINO_INTEL_GPU_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino_intel_gpu_plugin.lib")
set(OPENVINO_INTEL_GPU_RUNTIME_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino_intel_gpu_runtime.lib")
set(OPENVINO_ONEDNN_CPU_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino_onednn_cpu.lib")
set(OPENVINO_IR_FRONT_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino_ir_frontend.lib")
set(OPENVINO_REFER_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino_reference.lib")
set(OPENVINO_SHAPE_INFER_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino_shape_inference.lib")
set(OPENVINO_UTIL_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino_util.lib")
set(OPENVINO_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/openvino.lib")
set(OPENVINO_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../third_pary/openvino/lib/intel64/Release/")

OpenVINO documentation recommends to rely on cmake interface, where you need to link with openvino::runtime as usual. It transitively adds all required internal libraries to link process

See https://github.com/openvinotoolkit/openvino/blob/master/docs/dev/static_libaries.md#cmake-interface

feixuedudiao commented 5 months ago

thanks.