From 99165f2149f351bb1c54b1a303ce083b2eb8efc1 Mon Sep 17 00:00:00 2001 From: DefTruth <31974251+DefTruth@users.noreply.github.com> Date: Mon, 12 Dec 2022 09:46:55 +0800 Subject: [PATCH] [Bug Fix] fix win examples build error (#855) * Update CMakeLists.txt * Update infer_rkyolo.cc --- examples/CMakeLists.txt | 5 +++++ examples/vision/detection/rkyolo/cpp/infer_rkyolo.cc | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 8aa469b6a..ee46e64b9 100755 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -51,6 +51,11 @@ function(add_fastdeploy_executable FIELD CC_FILE) if(TARGET gflags) if(UNIX AND (NOT APPLE) AND (NOT ANDROID)) target_link_libraries(${TEMP_TARGET_NAME} PRIVATE gflags pthread) + elseif(WIN32) + target_link_libraries(${TEMP_TARGET_NAME} PRIVATE gflags) + if (HAVE_SHLWAPI) + target_link_libraries(${TEMP_TARGET_NAME} PRIVATE shlwapi.lib) + endif() else() target_link_libraries(${TEMP_TARGET_NAME} PRIVATE gflags) endif() diff --git a/examples/vision/detection/rkyolo/cpp/infer_rkyolo.cc b/examples/vision/detection/rkyolo/cpp/infer_rkyolo.cc index c7c1be43b..86ba7f985 100644 --- a/examples/vision/detection/rkyolo/cpp/infer_rkyolo.cc +++ b/examples/vision/detection/rkyolo/cpp/infer_rkyolo.cc @@ -14,8 +14,6 @@ #include "fastdeploy/vision.h" void RKNPU2Infer(const std::string& model_file, const std::string& image_file) { - struct timeval start_time, stop_time; - auto option = fastdeploy::RuntimeOption(); option.UseRKNPU2();