diff --git a/deploy/cpp_infer/CMakeLists.txt b/deploy/cpp_infer/CMakeLists.txt index 4f2dc88a8f1a9d185b7274a1a723c0e670bd1bf1..0cf20635f8849cbb405118fd0e2fa8538eb3fa06 100644 --- a/deploy/cpp_infer/CMakeLists.txt +++ b/deploy/cpp_infer/CMakeLists.txt @@ -37,10 +37,8 @@ endif() if (WIN32) - include_directories("${PADDLE_LIB}/paddle/fluid/inference") include_directories("${PADDLE_LIB}/paddle/include") link_directories("${PADDLE_LIB}/paddle/lib") - link_directories("${PADDLE_LIB}/paddle/fluid/inference") find_package(OpenCV REQUIRED PATHS ${OPENCV_DIR}/build/ NO_DEFAULT_PATH) else () diff --git a/deploy/cpp_infer/src/config.cpp b/deploy/cpp_infer/src/config.cpp index a0ac1d08c93d1ff1e51f769465b2df2b4355fbc0..050b75ede9475432f250cafac2cd5fbed17fea0a 100644 --- a/deploy/cpp_infer/src/config.cpp +++ b/deploy/cpp_infer/src/config.cpp @@ -21,12 +21,18 @@ std::vector OCRConfig::split(const std::string &str, std::vector res; if ("" == str) return res; - char strs[str.length() + 1]; + + int strlen = str.length() + 1; + chars *strs = new char[strlen]; std::strcpy(strs, str.c_str()); - char d[delim.length() + 1]; + int delimlen = delim.length() + 1; + char *d = new char[delimlen]; std::strcpy(d, delim.c_str()); + delete[] strs; + delete[] d; + char *p = std::strtok(strs, d); while (p) { std::string s = p;