{"id":684,"date":"2024-04-10T08:00:33","date_gmt":"2024-04-10T00:00:33","guid":{"rendered":"https:\/\/www.zhoubin.asia\/?p=684"},"modified":"2024-04-10T07:10:21","modified_gmt":"2024-04-09T23:10:21","slug":"hailort_windows","status":"publish","type":"post","link":"https:\/\/www.zhoubin.asia\/index.php\/2024\/04\/10\/hailort_windows\/","title":{"rendered":"[HailoRT]Hailort\u5728Windows\u4e2d\u4f7f\u7528\u7684\u6ce8\u610f\u4e8b\u9879"},"content":{"rendered":"<p>\u6700\u65b0\u76844.17.0\u7248\u672c\u7684Hailort\uff0c\u5728Windows\u4e0b\u57fa\u4e8eHailort\u7f16\u8bd1\u8fd0\u884cdemo\u65f6\uff0c\u6709\u65f6\u5ba2\u6237\u4f1a\u53cd\u9988\u4ee5\u4e0b\u62a5\u9519\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-685\" src=\"https:\/\/www.zhoubin.asia\/wp-content\/uploads\/2024\/04\/hailort_windows_error.png\" alt=\"\" width=\"413\" height=\"83\" \/><\/p>\n<p>\u7ecf\u8fc7\u6d4b\u8bd5\u9a8c\u8bc1\u53d1\u73b0\uff0c\u53ea\u6709\u5f53\u5e94\u7528\u7a0b\u5e8f\u5728x64-Debug\u6a21\u5f0f\u4e0b\u7f16\u8bd1\u8c03\u8bd5C++ API\u63a5\u53e3\u65f6\u624d\u4f1a\u6709\u6b64\u62a5\u9519\u3002\u5982\u679c\u4f7f\u7528C API\u63a5\u53e3\u6216\u8005x64-Release\u6a21\u5f0f\u4e0b\u5219\u6ca1\u6709\u6b64\u62a5\u9519\u3002<\/p>\n<p>\u8fd9\u4e2a\u95ee\u9898\u4e0eHailort C++\u63a5\u53e3\u4e2d\u4f7f\u7528\u4e86STL\u6709\u5173\uff0c\u56e0\u4e3a\u6211\u4eec\u6b63\u5e38\u5b89\u88c5\u7684libhailort.dll\u662fRelease\u7248\u672c\uff0c\u5982\u679c\u4f7f\u7528Debug\u6a21\u5f0f\u7f16\u8bd1\u5e94\u7528\u7a0b\u5e8f\uff0c\u5219\u4f1a\u51fa\u73b0\u517c\u5bb9\u6027\u95ee\u9898\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u5f0f\uff1a<\/p>\n<ol>\n<li>\u4f7f\u7528Release\u6a21\u5f0f\u7f16\u8bd1\u5e94\u7528\u7a0b\u5e8f<\/li>\n<li>\u81ea\u884c\u5728Windows\u4e0b\u7f16\u8bd1\u4e00\u4e2aDebug\u7684DLL\uff0c\u5c06\u6b64DLL\u653e\u5230\u6d4b\u8bd5\u7a0b\u5e8f.exe\u7684\u76ee\u5f55\u4e2d\u5373\u53ef\uff08Debug\u7684\u65f6\u5019\u4f1a\u4f18\u5148\u5bfb\u627e\u7a0b\u5e8f\u5f53\u524d\u76ee\u5f55\uff0c\u7136\u540e\u624d\u662f\u7cfb\u7edf\u8def\u5f84\u91cc\u7684\u76ee\u5f55\uff09<\/li>\n<li>\u5e94\u7528\u7a0b\u5e8f\u5728Release\u6a21\u5f0f\u4e0b\u7f16\u8bd1\u5219\u4f7f\u7528Release DLL, Debug\u6a21\u5f0f\u4e0b\u7f16\u8bd1\u5219\u4f7f\u7528Debug DLL.<\/li>\n<\/ol>\n<h3>Hailort\u5728Windows\u4e0b\u7684\u7f16\u8bd1\u65b9\u5f0f\uff1a<\/h3>\n<h4>Release:<\/h4>\n<pre><code>cmake -S . -B build -A x64 -DCMAKE_BUILD_TYPE=Release\r\ncmake --build build --config Release\r\n<\/code><\/pre>\n<h4>Debug:<\/h4>\n<pre><code>cmake -S . -B build -A x64 -DCMAKE_BUILD_TYPE=Debug\r\ncmake --build build --config Debug\r\n<\/code><\/pre>\n<p>\u53ef\u80fd<code>-DCMAKE_BUILD_TYPE=Release<\/code>\u90e8\u5206\u6ca1\u6709\u610f\u4e49(\u672a\u9a8c\u8bc1)\uff0c\u5173\u952e\u5728\u4e8e<code>--config Debug<\/code>\u90e8\u5206\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>\u5728Windows\u73af\u5883\u4e2d\u7f16\u8bd1Hailort + OpenCV Demo\u7684CMakeLists.txt\u63a8\u8350<\/h3>\n<pre><code>set(HAILORT_ROOT \"C:\/Program Files\/HailoRT\")\r\nset(HAILORT_INCLUDE \"${HAILORT_ROOT}\/include\")\r\nset(HAILORT_LIB \"${HAILORT_ROOT}\/lib\/libhailort.lib\")\r\nset(OpenCV_INCLUDE_DIRS \"C:\/opencv\/build\/include\")\r\nset(OpenCV_LIBS \"C:\/opencv\/build\/x64\/vc16\/lib\/opencv_world490d.lib\")\r\ninclude_directories(${HAILORT_INCLUDE})\r\ninclude_directories(${OpenCV_INCLUDE_DIRS})\r\n\r\nfind_package(Threads REQUIRED)\r\nfind_package(HailoRT REQUIRED)\r\n\r\ntarget_link_libraries(detection_app PRIVATE ${OpenCV_LIBS})\r\ntarget_link_libraries(detection_app PRIVATE ${HAILORT_LIB})\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u65b0\u76844.17.0\u7248\u672c\u7684Hailort\uff0c\u5728Windows\u4e0b\u57fa\u4e8eHailort\u7f16\u8bd1\u8fd0\u884cdemo\u65f6\uff0c\u6709\u65f6\u5ba2\u6237\u4f1a\u53cd\u9988 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[5,1],"tags":[],"class_list":["post-684","post","type-post","status-publish","format-standard","hentry","category-hailort","category-tech"],"_links":{"self":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts\/684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/comments?post=684"}],"version-history":[{"count":1,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts\/684\/revisions"}],"predecessor-version":[{"id":686,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts\/684\/revisions\/686"}],"wp:attachment":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/media?parent=684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/categories?post=684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/tags?post=684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}