English | 简体中文
Opening an Issue, Issues not conforming to the guidelines may be closed immediately.
Copyright 1999-present, Alibaba Cloud All rights reserved.
English | 简体中文
Opening an Issue, Issues not conforming to the guidelines may be closed immediately.
Copyright 1999-present, Alibaba Cloud All rights reserved.
操作系统:Window 10 (19045.2846)
CMake版本:3.21.2
开发工具: Microsoft Visual Studio Enterprise 2015 版本 14.0.24720.00 Update 1
按照ocr-api-20210707\README-CN.md中的说明,用vcpkg(vcpkg安装在D:/github/vcpkg)执行了:
vcpkg install boost openssl-windows cpprestsdk
结果为:
D:\github\vcpkg>vcpkg install boost cpprestsdk openssl-windows
warning: Starting with the September 2023 release, the default triplet for vcpkg libraries will change from x86-windows to the detected host triplet (x64-windows). To resolve this message, add --triplet x86-windows to keep the same behavior.
Computing installation plan...
The following packages are already installed:
boost[core]:x86-windows -> 1.82.0#1
cpprestsdk[brotli,compression,core,default-features]:x86-windows -> 2.10.18#2
openssl-windows[core]:x86-windows -> deprecated
boost:x86-windows is already installed
cpprestsdk:x86-windows is already installed
openssl-windows:x86-windows is already installed
Restored 0 package(s) from C:\Users\Administrator\AppData\Local\vcpkg\archives in 157 us. Use --debug to see more details.
Total install time: 2.38 ms
cpprestsdk provides CMake targets:
# this is heuristically generated, and may not be correct
find_package(cpprestsdk CONFIG REQUIRED)
target_link_libraries(main PRIVATE cpprestsdk::cpprest cpprestsdk::cpprestsdk_zlib_internal cpprestsdk::cpprestsdk_brotli_internal)
继续按照EADME-CN.md,并参照vcpkg的说明,使用“VS2015 开发人员命令提示”执行以下命令:
D:\github\alibabacloud-cpp-sdk\ocr-api-20210707>cd cmake_build
D:\github\alibabacloud-cpp-sdk\ocr-api-20210707\cmake_build>cmake .. -G "Visual Studio 14" -DCMAKE_TOOLCHAIN_FILE=D:/github/vcpkg/scripts/buildsystems/vcpkg.cmake
结果为:
-- alibabacloud_open_api : Project will be installed to C:/Program Files (x86)/alibabacloud_ocr_api_20210707
-- Installing LIB components to C:\Program Files (x86)\alibabacloud_ocr_api_20210707\lib
-- Installing BIN components to C:\Program Files (x86)\alibabacloud_ocr_api_20210707\bin
-- Installing INCLUDE components to C:\Program Files (x86)\alibabacloud_ocr_api_20210707\include
-- Installing CMAKE components to C:\Program Files (x86)\alibabacloud_ocr_api_20210707\CMake
-- alibabacloud_open_api_util could not be located, Building alibabacloud_open_api_util instead.
-- alibabacloud_endpoint_util could not be located, Building alibabacloud_endpoint_util instead.
-- Added alibabacloud_endpoint_util source : D:/github/alibabacloud-cpp-sdk/ocr-api-20210707/cmake_build/_deps/_alibabacloud_endpoint_util-src
-- Added alibabacloud_endpoint_util binary : D:/github/alibabacloud-cpp-sdk/ocr-api-20210707/cmake_build/_deps/_alibabacloud_endpoint_util-build
C++ compiler flags: /DWIN32 /D_WINDOWS /W3 /GR /EHsc -std=c++11 -std=c++11
-- The C++ compiler ID is: MSVC
-- The C++ compiler version is: 19.0.23506.0
-- Build type: Release
-- Install libraries
-- alibabacloud_endpoint_util : Project will be installed to C:/Program Files (x86)/alibabacloud_ocr_api_20210707
-- Installing LIB components to C:\Program Files (x86)\alibabacloud_ocr_api_20210707\lib
-- Installing BIN components to C:\Program Files (x86)\alibabacloud_ocr_api_20210707\bin
-- Installing INCLUDE components to C:\Program Files (x86)\alibabacloud_ocr_api_20210707\include
-- Installing CMAKE components to C:\Program Files (x86)\alibabacloud_ocr_api_20210707\CMake
-- darabonba_core could not be located, Building darabonba_core instead.
CMake Warning at C:/Program Files/CMake/share/cmake-3.21/Modules/FindBoost.cmake:1354 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.21/Modules/FindBoost.cmake:1477 (_Boost_COMPONENT_DEPENDENCIES)
C:/Program Files/CMake/share/cmake-3.21/Modules/FindBoost.cmake:2087 (_Boost_MISSING_DEPENDENCIES)
D:/github/vcpkg/installed/x86-windows/share/boost/vcpkg-cmake-wrapper.cmake:11 (_find_package)
D:/github/vcpkg/scripts/buildsystems/vcpkg.cmake:806 (include)
CMakeLists.txt:46 (find_package)
CMake Warning at C:/Program Files/CMake/share/cmake-3.21/Modules/FindBoost.cmake:1354 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.21/Modules/FindBoost.cmake:1477 (_Boost_COMPONENT_DEPENDENCIES)
C:/Program Files/CMake/share/cmake-3.21/Modules/FindBoost.cmake:2087 (_Boost_MISSING_DEPENDENCIES)
D:/github/vcpkg/installed/x86-windows/share/boost/vcpkg-cmake-wrapper.cmake:11 (_find_package)
D:/github/vcpkg/scripts/buildsystems/vcpkg.cmake:806 (include)
CMakeLists.txt:46 (find_package)
......
..... 这里省略部分类似的CMake Warning
......
CMake Warning at C:/Program Files/CMake/share/cmake-3.21/Modules/FindBoost.cmake:1354 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.21/Modules/FindBoost.cmake:1477 (_Boost_COMPONENT_DEPENDENCIES)
C:/Program Files/CMake/share/cmake-3.21/Modules/FindBoost.cmake:2087 (_Boost_MISSING_DEPENDENCIES)
D:/github/vcpkg/installed/x86-windows/share/boost/vcpkg-cmake-wrapper.cmake:11 (_find_package)
D:/github/vcpkg/scripts/buildsystems/vcpkg.cmake:806 (include)
CMakeLists.txt:46 (find_package)
CMake Warning at C:/Program Files/CMake/share/cmake-3.21/Modules/FindBoost.cmake:1354 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.21/Modules/FindBoost.cmake:1477 (_Boost_COMPONENT_DEPENDENCIES)
C:/Program Files/CMake/share/cmake-3.21/Modules/FindBoost.cmake:2087 (_Boost_MISSING_DEPENDENCIES)
D:/github/vcpkg/installed/x86-windows/share/boost/vcpkg-cmake-wrapper.cmake:11 (_find_package)
D:/github/vcpkg/scripts/buildsystems/vcpkg.cmake:806 (include)
CMakeLists.txt:46 (find_package)
-- alibabacloud_ocr_api_20210707 : Project will be installed to C:/Program Files (x86)/alibabacloud_ocr_api_20210707
-- Installing LIB components to C:\Program Files (x86)\alibabacloud_ocr_api_20210707\lib
-- Installing BIN components to C:\Program Files (x86)\alibabacloud_ocr_api_20210707\bin
-- Installing INCLUDE components to C:\Program Files (x86)\alibabacloud_ocr_api_20210707\include
-- Installing CMAKE components to C:\Program Files (x86)\alibabacloud_ocr_api_20210707\CMake
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CPPREST_LIB
linked by target "alibabacloud_ocr_api_20210707" in directory D:/github/alibabacloud-cpp-sdk/ocr-api-20210707
linked by target "darabonba_util" in directory D:/github/alibabacloud-cpp-sdk/ocr-api-20210707/cmake_build/_deps/_darabonba_util-src
linked by target "darabonba_core" in directory D:/github/alibabacloud-cpp-sdk/ocr-api-20210707/cmake_build/_deps/_darabonba_core-src
linked by target "alibabacloud_open_api" in directory D:/github/alibabacloud-cpp-sdk/ocr-api-20210707/cmake_build/_deps/_alibabacloud_open_api-src
linked by target "alibabacloud_credential" in directory D:/github/alibabacloud-cpp-sdk/ocr-api-20210707/cmake_build/_deps/_alibabacloud_credential-src
linked by target "alibabacloud_open_api_util" in directory D:/github/alibabacloud-cpp-sdk/ocr-api-20210707/cmake_build/_deps/_alibabacloud_open_api_util-src
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
看起来貌似是CMake没有找到CPPREST_LIB(boost库能找到但是有警告),这里有什么解决办法吗?
是否对开发工具版本,或者CMake版本有其他要求?
using namespace Alibabacloud_Ocr-api20210707 this code is in your origin code, could you give me some help how to complie this code? why is -api20210707, in the C++ the correct is _api20210707, could you complie this project completly?
In the directory ”dysmsapi-2017052”, the file “README-CN.md” line 58 execute the command “sh dysmsapi-20170525/scripts/install.sh”, but the file was not found in this directory
C++ compiler flags: -std=c++11
-- The C++ compiler ID is: GNU
-- The C++ compiler version is: 12.2.1
-- Build type: Release
-- Install libraries
-- darabonba_util could not be located, Building darabonba_util instead.
-- Added darabonba_util source : /home/zhangxued/alibabacloud-cpp-sdk/mse-20190531/cmake_build/_deps/_darabonba_util-src
-- Added darabonba_util binary : /home/zhangxued/alibabacloud-cpp-sdk/mse-20190531/cmake_build/_deps/_darabonba_util-build
C++ compiler flags: -std=c++11 -std=c++11
-- The C++ compiler ID is: GNU
-- The C++ compiler version is: 12.2.1
-- Build type: Release
-- Install libraries
-- darabonba_core could not be located, Building darabonba_core instead.
-- Added darabonba_core source : /home/zhangxued/alibabacloud-cpp-sdk/mse-20190531/cmake_build/_deps/_darabonba_core-src
-- Added darabonba_core binary : /home/zhangxued/alibabacloud-cpp-sdk/mse-20190531/cmake_build/_deps/_darabonba_core-build
C++ compiler flags: -std=c++11 -std=c++11 -Wall -std=c++11
-- Enable testing: OFF
-- Enable coverage: OFF
-- The C++ compiler ID is: GNU
-- The C++ compiler version is: 12.2.1
-- Build type: Release
-- Install libraries
-- Found Boost: /usr/include (found version "1.66.0") found components: random system thread filesystem chrono atomic date_time regex
-- Project will be installed to /usr/local
-- Installing LIB components to /usr/local/lib64
-- Installing BIN components to /usr/local/bin
-- Installing INCLUDE components to /usr/local/include
-- Installing CMAKE components to /usr/local/share/cmake/darabonba_core
-- darabonba_util : Project will be installed to /usr/local
-- Installing LIB components to /usr/local/lib64
-- Installing BIN components to /usr/local/bin
-- Installing INCLUDE components to /usr/local/include
-- Installing CMAKE components to /usr/local/share/cmake/darabonba_util
-- alibabacloud_open_api could not be located, Building alibabacloud_open_api instead.
-- Added alibabacloud_open_api source : /home/zhangxued/alibabacloud-cpp-sdk/mse-20190531/cmake_build/_deps/_alibabacloud_open_api-src
-- Added alibabacloud_open_api binary : /home/zhangxued/alibabacloud-cpp-sdk/mse-20190531/cmake_build/_deps/_alibabacloud_open_api-build
C++ compiler flags: -std=c++11 -std=c++11
-- The C++ compiler ID is: GNU
-- The C++ compiler version is: 12.2.1
-- Build type: Release
-- Install libraries
-- darabonba_util could not be located, Building darabonba_util instead.
-- alibabacloud_credential could not be located, Building alibabacloud_credential instead.
-- Added alibabacloud_credential source : /home/zhangxued/alibabacloud-cpp-sdk/mse-20190531/cmake_build/_deps/_alibabacloud_credential-src
-- Added alibabacloud_credential binary : /home/zhangxued/alibabacloud-cpp-sdk/mse-20190531/cmake_build/_deps/_alibabacloud_credential-build
C++ compiler flags: -std=c++11 -std=c++11 -std=c++11
-- The C++ compiler ID is: GNU
-- The C++ compiler version is: 12.2.1
-- Build type: Release
-- Install libraries
-- darabonba_core could not be located, Building darabonba_core instead.
-- alibabacloud_credential : Project will be installed to /usr/local
-- Installing LIB components to /usr/local/lib64
-- Installing BIN components to /usr/local/bin
-- Installing INCLUDE components to /usr/local/include
-- Installing CMAKE components to /usr/local/share/cmake/darabonba_util
-- alibabacloud_open_api_util could not be located, Building alibabacloud_open_api_util instead.
-- Added alibabacloud_open_api_util source : /home/zhangxued/alibabacloud-cpp-sdk/mse-20190531/cmake_build/_deps/_alibabacloud_open_api_util-src
-- Added alibabacloud_open_api_util binary : /home/zhangxued/alibabacloud-cpp-sdk/mse-20190531/cmake_build/_deps/_alibabacloud_open_api_util-build
C++ compiler flags: -std=c++11 -std=c++11 -std=c++11
-- The C++ compiler ID is: GNU
-- The C++ compiler version is: 12.2.1
-- Build type: Release
-- Install libraries
-- darabonba_core could not be located, Building darabonba_core instead.
-- darabonba_util could not be located, Building darabonba_util instead.
-- alibabacloud_open_api_util : Project will be installed to /usr/local
-- Installing LIB components to /usr/local/lib64
-- Installing BIN components to /usr/local/bin
-- Installing INCLUDE components to /usr/local/include
-- Installing CMAKE components to /usr/local/share/cmake/darabonba_util
-- darabonba_core could not be located, Building darabonba_core instead.
-- alibabacloud_open_api : Project will be installed to /usr/local
-- Installing LIB components to /usr/local/lib64
-- Installing BIN components to /usr/local/bin
-- Installing INCLUDE components to /usr/local/include
-- Installing CMAKE components to /usr/local/share/cmake/darabonba_util
-- alibabacloud_open_api_util could not be located, Building alibabacloud_open_api_util instead.
-- alibabacloud_endpoint_util could not be located, Building alibabacloud_endpoint_util instead.
-- Added alibabacloud_endpoint_util source : /home/zhangxued/alibabacloud-cpp-sdk/mse-20190531/cmake_build/_deps/_alibabacloud_endpoint_util-src
-- Added alibabacloud_endpoint_util binary : /home/zhangxued/alibabacloud-cpp-sdk/mse-20190531/cmake_build/_deps/_alibabacloud_endpoint_util-build
C++ compiler flags: -std=c++11 -std=c++11
-- The C++ compiler ID is: GNU
-- The C++ compiler version is: 12.2.1
-- Build type: Release
-- Install libraries
-- alibabacloud_endpoint_util : Project will be installed to /usr/local
-- Installing LIB components to /usr/local/lib64
-- Installing BIN components to /usr/local/bin
-- Installing INCLUDE components to /usr/local/include
-- Installing CMAKE components to /usr/local/share/cmake/darabonba_util
-- darabonba_core could not be located, Building darabonba_core instead.
-- alibabacloud_mse_20190531 : Project will be installed to /usr/local
-- Installing LIB components to /usr/local/lib64
-- Installing BIN components to /usr/local/bin
-- Installing INCLUDE components to /usr/local/include
-- Installing CMAKE components to /usr/local/share/cmake/darabonba_util
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zhangxued/alibabacloud-cpp-sdk/mse-20190531/cmake_build
[ 4%] Building CXX object _deps/_alibabacloud_endpoint_util-build/CMakeFiles/alibabacloud_endpoint_util.dir/src/endpoint_util.cpp.o
[ 9%] Linking CXX shared library libalibabacloud_endpoint_util.so
[ 9%] Built target alibabacloud_endpoint_util
[ 13%] Building CXX object _deps/_darabonba_core-build/CMakeFiles/darabonba_core.dir/src/model.cpp.o
[ 18%] Building CXX object _deps/_darabonba_core-build/CMakeFiles/darabonba_core.dir/src/core.cpp.o
[ 22%] Building CXX object _deps/_darabonba_core-build/CMakeFiles/darabonba_core.dir/src/error.cpp.o
[ 27%] Building CXX object _deps/_darabonba_core-build/CMakeFiles/darabonba_core.dir/src/response.cpp.o
[ 31%] Building CXX object _deps/_darabonba_core-build/CMakeFiles/darabonba_core.dir/src/request.cpp.o
[ 36%] Linking CXX shared library libdarabonba_core.so
[ 36%] Built target darabonba_core
[ 40%] Building CXX object _deps/_darabonba_util-build/CMakeFiles/darabonba_util.dir/src/util.cpp.o
[ 45%] Building CXX object _deps/_darabonba_util-build/CMakeFiles/darabonba_util.dir/src/assert.cpp.o
[ 50%] Building CXX object _deps/_darabonba_util-build/CMakeFiles/darabonba_util.dir/src/default.cpp.o
[ 54%] Building CXX object _deps/_darabonba_util-build/CMakeFiles/darabonba_util.dir/src/parse.cpp.o
/home/zhangxued/alibabacloud-cpp-sdk/mse-20190531/cmake_build/_deps/_darabonba_util-src/src/parse.cpp:8:10: fatal error: json/json.h: No such file or directory
8 | #include <json/json.h>
| ^~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [_deps/_darabonba_util-build/CMakeFiles/darabonba_util.dir/build.make:118: _deps/_darabonba_util-build/CMakeFiles/darabonba_util.dir/src/parse.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:541: _deps/_darabonba_util-build/CMakeFiles/darabonba_util.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
-- alibabacloud_dysmsapi_20170525 : Project will be installed to /usr/local
-- Installing LIB components to /usr/local/lib
-- Installing BIN components to /usr/local/bin
-- Installing INCLUDE components to /usr/local/include
-- Installing CMAKE components to /usr/local/share/cmake/darabonba_util
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/alibaba/dysmsapi-20170525/cmake_build
[ 9%] Built target alibabacloud_endpoint_util
[ 36%] Built target darabonba_core
[ 59%] Built target darabonba_util
[ 68%] Built target alibabacloud_open_api_util
[ 81%] Built target alibabacloud_credential
[ 90%] Built target alibabacloud_open_api
Scanning dependencies of target alibabacloud_dysmsapi_20170525
[ 95%] Building CXX object CMakeFiles/alibabacloud_dysmsapi_20170525.dir/src/dysmsapi_20170525.cpp.o
/opt/alibaba/dysmsapi-20170525/src/dysmsapi_20170525.cpp: In member function ‘std::__cxx11::string Alibabacloud_Dysmsapi20170525::Client::getEndpoint(std::shared_ptr<std::__cxx11::basic_string >, std::shared_ptr<std::__cxx11::basic_string >, std::shared_ptr<std::__cxx11::basic_string >, std::shared_ptr<std::__cxx11::basic_string >, std::shared_ptr<std::__cxx11::basic_string >, std::shared_ptr<std::map<std::__cxx11::basic_string, std::__cxx11::basic_string > >, std::shared_ptr<std::__cxx11::basic_string >)’:
/opt/alibaba/dysmsapi-20170525/src/dysmsapi_20170525.cpp:41:142: error: no match for ‘operator[]’ (operand types are ‘std::__shared_ptr_access<std::map<std::__cxx11::basic_string, std::__cxx11::basic_string >, (__gnu_cxx::_Lock_policy)2, false, false>::element_type’ {aka ‘std::map<std::__cxx11::basic_string, std::__cxx11::basic_string >’} and ‘std::shared_ptr<std::__cxx11::basic_string >’)
Darabonba_Util::Client::isUnset<map<string, string>>(endpointMap) && !Darabonba_Util::Client::empty(make_shared((*endpointMap)[regionId]))) {
after execute cmd:
sh chatbot-20220408/scripts/install.sh
the out errror is:
-- The C++ compiler ID is: GNU
-- The C++ compiler version is: 10.2.1
-- Build type: Release
-- Install libraries
-- alibabacloud_endpoint_util : Project will be installed to /usr/local
-- Installing LIB components to /usr/local/lib64
-- Installing BIN components to /usr/local/bin
-- Installing INCLUDE components to /usr/local/include
-- Installing CMAKE components to /usr/local/share/cmake/darabonba_util
-- darabonba_core could not be located, Building darabonba_core instead.
-- alibabacloud_chatbot_20220408 : Project will be installed to /usr/local
-- Installing LIB components to /usr/local/lib64
-- Installing BIN components to /usr/local/bin
-- Installing INCLUDE components to /usr/local/include
-- Installing CMAKE components to /usr/local/share/cmake/darabonba_util
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CPPREST_LIB
linked by target "alibabacloud_chatbot_20220408" in directory /home/alibabacloud-cpp-sdk/chatbot-20220408
linked by target "darabonba_util" in directory /home/alibabacloud-cpp-sdk/chatbot-20220408/cmake_build/_deps/_darabonba_util-src
linked by target "darabonba_core" in directory /home/alibabacloud-cpp-sdk/chatbot-20220408/cmake_build/_deps/_darabonba_core-src
linked by target "alibabacloud_open_api" in directory /home/alibabacloud-cpp-sdk/chatbot-20220408/cmake_build/_deps/_alibabacloud_open_api-src
linked by target "alibabacloud_credential" in directory /home/alibabacloud-cpp-sdk/chatbot-20220408/cmake_build/_deps/_alibabacloud_credential-src
linked by target "alibabacloud_open_api_util" in directory /home/alibabacloud-cpp-sdk/chatbot-20220408/cmake_build/_deps/_alibabacloud_open_api_util-src
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
i compile the sdk follow the steps in link:
https://github.com/alibabacloud-sdk-cpp/chatbot-20220408/?spm=api-workbench.SDK%20Document.0.0.31151d204a0lj5
using namespace Alibabacloud_Ocr-api20210707 this code is in your origin code, could you give me some help how to complie this code? why is -api20210707, in the C++ the correct is _api20210707, could you complie this project completly?
The error is as follows:
CMake Error at CMakeLists.txt:4 (project):
Generator
Visual Studio 16 2019
could not find any instance of Visual Studio.
What should I do?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.