-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在VS2022中运行阿里云短信V1.0的c++版本示例报错: #156
Comments
感谢反馈,我们处理下 |
这个应该是VS编译器的报错,是要在windows上开发 Windows 平台 (UWP) 应用吗?若是如此应该用不了环境变量的方案https://learn.microsoft.com/zh-cn/cpp/cppcx/crt-functions-not-supported-in-universal-windows-platform-apps?view=msvc-170 |
对,是要在windoe上开发应用
…---原始邮件---
发件人: ***@***.***>
发送时间: 2025年1月10日(周五) 中午11:04
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [aliyun/aliyun-openapi-cpp-sdk] 在VS2022中运行阿里云短信V1.0的c++版本示例报错: (Issue #156)
这个应该是VS编译器的报错,是要在windows上开发 Windows 平台 (UWP) 应用吗?若是如此应该用不了环境变量的方案https://learn.microsoft.com/zh-cn/cpp/cppcx/crt-functions-not-supported-in-universal-windows-platform-apps?view=msvc-170
即把getenv删除,然后使用变量传递AK的两个值应该就好,出于安全我们不建议将AK明文写在代码中。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
我试了把getenv删除了,编译报错link2019
…---原始邮件---
发件人: ***@***.***>
发送时间: 2025年1月10日(周五) 中午11:04
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [aliyun/aliyun-openapi-cpp-sdk] 在VS2022中运行阿里云短信V1.0的c++版本示例报错: (Issue #156)
这个应该是VS编译器的报错,是要在windows上开发 Windows 平台 (UWP) 应用吗?若是如此应该用不了环境变量的方案https://learn.microsoft.com/zh-cn/cpp/cppcx/crt-functions-not-supported-in-universal-windows-platform-apps?view=msvc-170
即把getenv删除,然后使用变量传递AK的两个值应该就好,出于安全我们不建议将AK明文写在代码中。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
是没编译core文件夹吗 |
编译了
…---原始邮件---
发件人: ***@***.***>
发送时间: 2025年1月10日(周五) 中午1:04
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [aliyun/aliyun-openapi-cpp-sdk] 在VS2022中运行阿里云短信V1.0的c++版本示例报错: (Issue #156)
是没编译core文件夹吗
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
编译完整信息发下吧 看是哪行触发的编译报错 |
等晚上的吧,现在电脑没在身边
…---原始邮件---
发件人: ***@***.***>
发送时间: 2025年1月10日(周五) 下午2:27
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [aliyun/aliyun-openapi-cpp-sdk] 在VS2022中运行阿里云短信V1.0的c++版本示例报错: (Issue #156)
编译完整信息发下吧 看是哪行触发的编译报错
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
生成开始于 19:11...
1>------ 已启动生成: 项目: ZERO_CHECK, 配置: Release x64 ------
1>1>Checking Build System
2>------ 已启动生成: 项目: jsoncpp (ExternalProjectTargets\jsoncpp\jsoncpp), 配置: Release x64 ------
3>------ 已启动生成: 项目: curl (ExternalProjectTargets\curl\curl), 配置: Release x64 ------
4>------ 已启动生成: 项目: catch (ExternalProjectTargets\catch\catch), 配置: Release x64 ------
2>Creating directories for 'jsoncpp'
3>Creating directories for 'curl'
2>Building Custom Rule D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/3rdparty/CMakeLists.txt
4>Creating directories for 'catch'
3>Building Custom Rule D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/3rdparty/CMakeLists.txt
2>Performing download step (verify and extract) for 'jsoncpp'
3>Performing download step (verify and extract) for 'curl'
2>-- verifying file...
2> file='D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/3rdparty/jsoncpp-0.10.5.tar.gz'
4>Building Custom Rule D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/3rdparty/CMakeLists.txt
2>-- verifying file... done
3>-- verifying file...
3> file='D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/3rdparty/curl-7.55.1.tar.gz'
2>-- extracting...
2> src='D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/3rdparty/jsoncpp-0.10.5.tar.gz'
2> dst='D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/jsoncpp-prefix/src/jsoncpp'
4>No download step for 'catch'
3>-- verifying file... done
2>-- extracting... [tar xfz]
3>-- extracting...
3> src='D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/3rdparty/curl-7.55.1.tar.gz'
3> dst='D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/curl-prefix/src/curl'
3>-- extracting... [tar xfz]
4>No update step for 'catch'
2>-- extracting... [analysis]
2>-- extracting... [rename]
2>-- extracting... [clean up]
2>-- extracting... done
4>No patch step for 'catch'
2>No update step for 'jsoncpp'
2>No patch step for 'jsoncpp'
4>No configure step for 'catch'
2>Performing configure step for 'jsoncpp'
4>No build step for 'catch'
2>CMake Deprecation Warning at CMakeLists.txt:3 (CMAKE_MINIMUM_REQUIRED):
2> Compatibility with CMake < 3.10 will be removed from a future version of
2> CMake.
2>
2> Update the VERSION argument <min> value. Or, use the <min>...<max> syntax
2> to tell CMake that the project requires at least <min> but has been updated
2> to work with policies introduced by <max> or earlier.
2>
2>
2>-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
4>Performing install step for 'catch'
3>-- extracting... [analysis]
3>-- extracting... [rename]
3>-- extracting... [clean up]
3>-- extracting... done
3>No update step for 'curl'
4>Completed 'catch'
3>No patch step for 'curl'
3>Performing configure step for 'curl'
3>CMake Deprecation Warning at CMakeLists.txt:41 (cmake_minimum_required):
3> Compatibility with CMake < 3.10 will be removed from a future version of
3> CMake.
3>
3> Update the VERSION argument <min> value. Or, use the <min>...<max> syntax
3> to tell CMake that the project requires at least <min> but has been updated
3> to work with policies introduced by <max> or earlier.
3>
3>
3>-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
2>-- The C compiler identification is MSVC 19.38.33138.0
3>-- The C compiler identification is MSVC 19.38.33138.0
3>-- Detecting C compiler ABI info
2>-- The CXX compiler identification is MSVC 19.38.33138.0
2>-- Detecting C compiler ABI info
3>-- Detecting C compiler ABI info - done
3>-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped
3>-- Detecting C compile features
3>-- Detecting C compile features - done
3>CMake Warning at CMakeLists.txt:49 (message):
3> the curl cmake build system is poorly maintained. Be aware
3>
3>
3>-- curl version=[7.55.1]
3>-- Found Perl: C:/Strawberry/perl/bin/perl.exe (found version "5.22.1")
3>-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
2>-- Detecting C compiler ABI info - done
2>-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped
2>-- Detecting C compile features
2>-- Detecting C compile features - done
2>-- Detecting CXX compiler ABI info
3>-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
3>-- Looking for pthread_create in pthreads
3>-- Looking for pthread_create in pthreads - not found
3>-- Looking for pthread_create in pthread
2>-- Detecting CXX compiler ABI info - done
2>-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped
2>-- Detecting CXX compile features
2>-- Detecting CXX compile features - done
2>-- JsonCpp Version: 0.10.5
2>CMake Warning (dev) at CMakeLists.txt:101 (elseif):
2> Policy CMP0054 is not set: Only interpret if() arguments as variables or
2> keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
2> details. Use the cmake_policy command to set the policy and suppress this
2> warning.
2>
2> Quoted variables like "MSVC" will no longer be dereferenced when the policy
2> is set to NEW. Since the policy is not set the OLD behavior will be used.
2>This warning is for project developers. Use -Wno-dev to suppress it.
2>
2>-- Configuring done (7.4s)
2>-- Generating done (0.1s)
2>-- Build files have been written to: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/jsoncpp-prefix/src/jsoncpp-build
2>Performing build step for 'jsoncpp'
2>閫傜敤浜?.NET Framework MSBuild 鐗堟湰 17.10.4+10fbfbf2e
2>
2> 1>Checking Build System
3>-- Looking for pthread_create in pthread - not found
3>-- Found Threads: TRUE
3>-- Looking for getch in ws2_32;
2> Building Custom Rule D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/jsoncpp-prefix/src/jsoncpp/src/lib_json/CMakeLists.txt
2> json_reader.cpp
2> json_value.cpp
2> json_writer.cpp
3>-- Looking for getch in ws2_32; - found
3>-- Looking for getch in winmm;ws2_32
2> 姝e湪鐢熸垚浠g爜...
2> jsoncpp_lib_static.vcxproj -> D:\Visual Studio\Projects\aliyun-openapi-cpp-sdk-master\sdk_build\3rdparty\jsoncpp-prefix\src\jsoncpp-build\src\lib_json\Release\jsoncpp.lib
2> Building Custom Rule D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/jsoncpp-prefix/src/jsoncpp/CMakeLists.txt
2>Performing install step for 'jsoncpp'
3>-- Looking for getch in winmm;ws2_32 - found
3>-- Looking for idn2_lookup_ul in idn2;winmm;ws2_32;crypt32
2>閫傜敤浜?.NET Framework MSBuild 鐗堟湰 17.10.4+10fbfbf2e
2>
2> jsoncpp_lib_static.vcxproj -> D:\Visual Studio\Projects\aliyun-openapi-cpp-sdk-master\sdk_build\3rdparty\jsoncpp-prefix\src\jsoncpp-build\src\lib_json\Release\jsoncpp.lib
2> 1>
2> -- Install configuration: "Release"
2> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/jsoncpp-prefix/lib/jsoncpp.lib
2> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/jsoncpp-prefix/include/json/assertions.h
2> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/jsoncpp-prefix/include/json/autolink.h
2> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/jsoncpp-prefix/include/json/config.h
2> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/jsoncpp-prefix/include/json/features.h
2> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/jsoncpp-prefix/include/json/forwards.h
2> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/jsoncpp-prefix/include/json/json.h
2> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/jsoncpp-prefix/include/json/reader.h
2> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/jsoncpp-prefix/include/json/value.h
2> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/jsoncpp-prefix/include/json/version.h
2> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/jsoncpp-prefix/include/json/writer.h
2>Completed 'jsoncpp'
3>-- Looking for idn2_lookup_ul in idn2;winmm;ws2_32;crypt32 - not found
3>-- Could NOT find LibSSH2 (missing: LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY)
3>-- Performing Test USE_UNIX_SOCKETS
3>-- Performing Test USE_UNIX_SOCKETS - Failed
3>-- Looking for include file windows.h
3>-- Looking for include file windows.h - found
3>-- Looking for include files windows.h, winsock.h
3>-- Looking for include files windows.h, winsock.h - found
3>-- Looking for 3 include files windows.h, ..., ws2tcpip.h
3>-- Looking for 3 include files windows.h, ..., ws2tcpip.h - found
3>-- Looking for 4 include files windows.h, ..., winsock2.h
3>-- Looking for 4 include files windows.h, ..., winsock2.h - found
3>-- Looking for 5 include files windows.h, ..., stdio.h
3>-- Looking for 5 include files windows.h, ..., stdio.h - found
3>-- Looking for 6 include files windows.h, ..., sys/filio.h
3>-- Looking for 6 include files windows.h, ..., sys/filio.h - not found
3>-- Looking for 6 include files windows.h, ..., sys/ioctl.h
3>-- Looking for 6 include files windows.h, ..., sys/ioctl.h - not found
3>-- Looking for 6 include files windows.h, ..., sys/resource.h
3>-- Looking for 6 include files windows.h, ..., sys/resource.h - not found
3>-- Looking for 8 include files windows.h, ..., sys/uio.h
3>-- Looking for 8 include files windows.h, ..., sys/uio.h - not found
3>-- Looking for 8 include files windows.h, ..., sys/un.h
3>-- Looking for 8 include files windows.h, ..., sys/un.h - not found
3>-- Looking for 9 include files windows.h, ..., sys/xattr.h
3>-- Looking for 9 include files windows.h, ..., sys/xattr.h - not found
3>-- Looking for 9 include files windows.h, ..., arpa/tftp.h
3>-- Looking for 9 include files windows.h, ..., arpa/tftp.h - not found
3>-- Looking for 9 include files windows.h, ..., assert.h
3>-- Looking for 9 include files windows.h, ..., assert.h - found
3>-- Looking for 10 include files windows.h, ..., crypto.h
3>-- Looking for 10 include files windows.h, ..., crypto.h - not found
3>-- Looking for 10 include files windows.h, ..., des.h
3>-- Looking for 10 include files windows.h, ..., des.h - not found
3>-- Looking for 10 include files windows.h, ..., err.h
3>-- Looking for 10 include files windows.h, ..., err.h - not found
3>-- Looking for 10 include files windows.h, ..., errno.h
3>-- Looking for 10 include files windows.h, ..., errno.h - found
3>-- Looking for 12 include files windows.h, ..., idn2.h
3>-- Looking for 12 include files windows.h, ..., idn2.h - not found
3>-- Looking for 12 include files windows.h, ..., ifaddrs.h
3>-- Looking for 12 include files windows.h, ..., ifaddrs.h - not found
3>-- Looking for 13 include files windows.h, ..., krb.h
3>-- Looking for 13 include files windows.h, ..., krb.h - not found
3>-- Looking for 13 include files windows.h, ..., libgen.h
3>-- Looking for 13 include files windows.h, ..., libgen.h - not found
3>-- Looking for 13 include files windows.h, ..., limits.h
3>-- Looking for 13 include files windows.h, ..., limits.h - found
3>-- Looking for 14 include files windows.h, ..., locale.h
3>-- Looking for 14 include files windows.h, ..., locale.h - found
3>-- Looking for 15 include files windows.h, ..., netinet/tcp.h
3>-- Looking for 15 include files windows.h, ..., netinet/tcp.h - not found
3>-- Looking for 15 include files windows.h, ..., pem.h
3>-- Looking for 15 include files windows.h, ..., pem.h - not found
3>-- Looking for 15 include files windows.h, ..., poll.h
3>-- Looking for 15 include files windows.h, ..., poll.h - not found
3>-- Looking for 15 include files windows.h, ..., rsa.h
3>-- Looking for 15 include files windows.h, ..., rsa.h - not found
3>-- Looking for 17 include files windows.h, ..., ssl.h
3>-- Looking for 17 include files windows.h, ..., ssl.h - not found
3>-- Looking for 17 include files windows.h, ..., stdbool.h
3>-- Looking for 17 include files windows.h, ..., stdbool.h - found
3>-- Looking for 21 include files windows.h, ..., stropts.h
3>-- Looking for 21 include files windows.h, ..., stropts.h - not found
3>-- Looking for 23 include files windows.h, ..., stddef.h
3>-- Looking for 23 include files windows.h, ..., stddef.h - found
3>-- Looking for 26 include files windows.h, ..., sys/utsname.h
3>-- Looking for 26 include files windows.h, ..., sys/utsname.h - not found
3>-- Check size of size_t
3>-- Check size of size_t - done
3>-- Check size of ssize_t
3>-- Check size of ssize_t - failed
3>-- Check size of long long
3>-- Check size of long long - done
3>-- Check size of long
3>-- Check size of long - done
3>-- Check size of short
3>-- Check size of short - done
3>-- Check size of int
3>-- Check size of int - done
3>-- Check size of __int64
3>-- Check size of __int64 - done
3>-- Check size of time_t
3>-- Check size of time_t - done
3>-- Looking for basename
3>-- Looking for basename - not found
3>-- Looking for strncmpi
3>-- Looking for strncmpi - not found
3>-- Looking for alarm
3>-- Looking for alarm - not found
3>-- Looking for gethostbyname
3>-- Looking for gethostbyname - found
3>-- Looking for strtoll
3>-- Looking for strtoll - found
3>-- Looking for _strtoi64
3>-- Looking for _strtoi64 - found
3>-- Looking for strerror_r
3>-- Looking for strerror_r - not found
3>-- Looking for siginterrupt
3>-- Looking for siginterrupt - not found
3>-- Looking for fork
3>-- Looking for fork - not found
3>-- Looking for freeaddrinfo
3>-- Looking for freeaddrinfo - found
3>-- Looking for freeifaddrs
3>-- Looking for freeifaddrs - not found
3>-- Looking for pipe
3>-- Looking for pipe - not found
3>-- Looking for ftruncate
3>-- Looking for ftruncate - not found
3>-- Looking for getprotobyname
3>-- Looking for getprotobyname - found
3>-- Looking for getrlimit
3>-- Looking for getrlimit - not found
3>-- Looking for setlocale
3>-- Looking for setlocale - found
3>-- Looking for setrlimit
3>-- Looking for setrlimit - not found
3>-- Looking for fcntl
3>-- Looking for fcntl - not found
3>-- Looking for ioctl
3>-- Looking for ioctl - not found
3>-- Looking for setsockopt
3>-- Looking for setsockopt - found
3>-- Looking for inet_pton
3>-- Looking for inet_pton - found
3>-- Looking for fsetxattr
3>-- Looking for fsetxattr - not found
3>-- Performing Curl Test HAVE_FCNTL_O_NONBLOCK
3>-- Performing Curl Test HAVE_FCNTL_O_NONBLOCK - Failed
3>-- Performing Curl Test HAVE_IOCTLSOCKET
3>-- Performing Curl Test HAVE_IOCTLSOCKET - Success
3>-- Performing Curl Test HAVE_IOCTLSOCKET_CAMEL
3>-- Performing Curl Test HAVE_IOCTLSOCKET_CAMEL - Failed
3>-- Performing Curl Test HAVE_IOCTLSOCKET_CAMEL_FIONBIO
3>-- Performing Curl Test HAVE_IOCTLSOCKET_CAMEL_FIONBIO - Success
3>-- Performing Curl Test HAVE_IOCTLSOCKET_FIONBIO
3>-- Performing Curl Test HAVE_IOCTLSOCKET_FIONBIO - Success
3>-- Performing Curl Test HAVE_IOCTL_FIONBIO
3>-- Performing Curl Test HAVE_IOCTL_FIONBIO - Failed
3>-- Performing Curl Test HAVE_IOCTL_SIOCGIFADDR
3>-- Performing Curl Test HAVE_IOCTL_SIOCGIFADDR - Failed
3>-- Performing Curl Test HAVE_SETSOCKOPT_SO_NONBLOCK
3>-- Performing Curl Test HAVE_SETSOCKOPT_SO_NONBLOCK - Failed
3>-- Performing Curl Test HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
3>-- Performing Curl Test HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID - Failed
3>-- Performing Curl Test HAVE_SOCKLEN_T
3>-- Performing Curl Test HAVE_SOCKLEN_T - Success
3>-- Performing Curl Test HAVE_BOOL_T
3>-- Performing Curl Test HAVE_BOOL_T - Success
3>-- Performing Curl Test HAVE_FILE_OFFSET_BITS
3>-- Performing Curl Test HAVE_FILE_OFFSET_BITS - Failed
3>-- Check size of off_t
3>-- Check size of off_t - done
3>-- Performing Curl Test HAVE_GLIBC_STRERROR_R
3>-- Performing Curl Test HAVE_GLIBC_STRERROR_R - Failed
3>-- Performing Curl Test HAVE_POSIX_STRERROR_R
3>-- Performing Curl Test HAVE_POSIX_STRERROR_R - Failed
3>-- Check size of socklen_t
3>-- Check size of socklen_t - done
3>-- Performing Test curl_cv_recv
3>-- Performing Test curl_cv_recv - Success
3>-- Performing Test curl_cv_func_recv_test
3>-- Performing Test curl_cv_func_recv_test - Success
3>-- Tested: int recv(SOCKET, char *, int, int)
3>-- Performing Test curl_cv_send
3>-- Performing Test curl_cv_send - Success
3>-- Performing Test curl_cv_func_send_test
3>-- Performing Test curl_cv_func_send_test - Success
3>-- Tested: int send(SOCKET, const char *, int, int)
3>-- Performing Test HAVE_MSG_NOSIGNAL
3>-- Performing Test HAVE_MSG_NOSIGNAL - Failed
3>-- Performing Test HAVE_STRUCT_TIMEVAL
3>-- Performing Test HAVE_STRUCT_TIMEVAL - Success
3>-- Performing Test HAVE_POLL_FINE
3>-- Performing Test HAVE_POLL_FINE - Failed
3>-- Check size of sig_atomic_t
3>-- Check size of sig_atomic_t - done
3>-- Performing Test HAVE_SIG_ATOMIC_T_NOT_VOLATILE
3>-- Performing Test HAVE_SIG_ATOMIC_T_NOT_VOLATILE - Success
3>-- Check size of struct sockaddr_storage
3>-- Check size of struct sockaddr_storage - done
3>-- Enabled features: WinSSL IPv6 AsynchDNS Largefile SSPI SPNEGO Kerberos NTLM
3>-- Enabled protocols: HTTP HTTPS
3>-- Configuring done (114.5s)
3>-- Generating done (0.5s)
3>-- Build files have been written to: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/curl-prefix/src/curl-build
3>Performing build step for 'curl'
3>閫傜敤浜?.NET Framework MSBuild 鐗堟湰 17.10.4+10fbfbf2e
3>
3> 1>Checking Build System
3> Building Custom Rule D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/curl-prefix/src/curl/lib/CMakeLists.txt
3> file.c
3> timeval.c
3> base64.c
3> hostip.c
3> progress.c
3> formdata.c
3> cookie.c
3> http.c
3> sendf.c
3> ftp.c
3> url.c
3> dict.c
3> if2ip.c
3> speedcheck.c
3> ldap.c
3> version.c
3> getenv.c
3> escape.c
3> mprintf.c
3> telnet.c
3> 姝e湪鐢熸垚浠g爜...
3> 姝e湪缂栬瘧...
3> netrc.c
3> getinfo.c
3> transfer.c
3> strcase.c
3> easy.c
3> security.c
3> curl_fnmatch.c
3> fileinfo.c
3> ftplistparser.c
3> wildcard.c
3> krb5.c
3> memdebug.c
3> http_chunks.c
3> strtok.c
3> connect.c
3> llist.c
3> hash.c
3> multi.c
3> content_encoding.c
3> share.c
3> 姝e湪鐢熸垚浠g爜...
3> 姝e湪缂栬瘧...
3> http_digest.c
3> md4.c
3> md5.c
3> http_negotiate.c
3> inet_pton.c
3> strtoofft.c
3> strerror.c
3> amigaos.c
3> hostasyn.c
3> hostip4.c
3> hostip6.c
3> hostsyn.c
3> inet_ntop.c
3> parsedate.c
3> select.c
3> tftp.c
3> splay.c
3> strdup.c
3> socks.c
3> ssh.c
3> 姝e湪鐢熸垚浠g爜...
3> 姝e湪缂栬瘧...
3> curl_addrinfo.c
3> socks_gssapi.c
3> socks_sspi.c
3> curl_sspi.c
3> slist.c
3> nonblock.c
3> curl_memrchr.c
3> imap.c
3> pop3.c
3> smtp.c
3> pingpong.c
3> rtsp.c
3> curl_threads.c
3> warnless.c
3> hmac.c
3> curl_rtmp.c
3> openldap.c
3> curl_gethostname.c
3> gopher.c
3> idn_win32.c
3> 姝e湪鐢熸垚浠g爜...
3> 姝e湪缂栬瘧...
3> http_proxy.c
3> non-ascii.c
3> asyn-ares.c
3> asyn-thread.c
3> curl_gssapi.c
3> http_ntlm.c
3> curl_ntlm_wb.c
3> curl_ntlm_core.c
3> curl_sasl.c
3> rand.c
3> curl_multibyte.c
3> hostcheck.c
3> conncache.c
3> pipeline.c
3> dotdot.c
3> x509asn1.c
3> http2.c
3> smb.c
3> curl_endian.c
3> curl_des.c
3> 姝e湪鐢熸垚浠g爜...
3> 姝e湪缂栬瘧...
3> system_win32.c
3> vauth.c
3> cleartext.c
3> cram.c
3> digest.c
3> digest_sspi.c
3> krb5_gssapi.c
3> krb5_sspi.c
3> ntlm.c
3> ntlm_sspi.c
3> oauth2.c
3> spnego_gssapi.c
3> spnego_sspi.c
3> openssl.c
3> gtls.c
3> vtls.c
3> nss.c
3> polarssl.c
3> polarssl_threadlock.c
3> axtls.c
3> 姝e湪鐢熸垚浠g爜...
3> 姝e湪缂栬瘧...
3> cyassl.c
3> schannel.c
3> darwinssl.c
3> gskit.c
3> mbedtls.c
3> 姝e湪鐢熸垚浠g爜...
3> libcurl.vcxproj -> D:\Visual Studio\Projects\aliyun-openapi-cpp-sdk-master\sdk_build\3rdparty\curl-prefix\src\curl-build\lib\Release\libcurl.lib
3> Building Custom Rule D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/curl-prefix/src/curl/CMakeLists.txt
3>Performing install step for 'curl'
3>閫傜敤浜?.NET Framework MSBuild 鐗堟湰 17.10.4+10fbfbf2e
3>
3> libcurl.vcxproj -> D:\Visual Studio\Projects\aliyun-openapi-cpp-sdk-master\sdk_build\3rdparty\curl-prefix\src\curl-build\lib\Release\libcurl.lib
3> 1>
3> -- Install configuration: "Release"
3> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/curl-prefix/bin/curl-config
3> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/curl-prefix/lib/pkgconfig/libcurl.pc
3> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/curl-prefix/include/curl
3> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/curl-prefix/include/curl/curl.h
3> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/curl-prefix/include/curl/curlver.h
3> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/curl-prefix/include/curl/easy.h
3> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/curl-prefix/include/curl/mprintf.h
3> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/curl-prefix/include/curl/multi.h
3> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/curl-prefix/include/curl/stdcheaders.h
3> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/curl-prefix/include/curl/system.h
3> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/curl-prefix/include/curl/typecheck-gcc.h
3> -- Installing: D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/3rdparty/curl-prefix/lib/libcurl.lib
3>Completed 'curl'
5>------ 已启动生成: 项目: core, 配置: Release x64 ------
5>Building Custom Rule D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/core/CMakeLists.txt
5>AlibabaCloud.cc
5>AsyncCallerContext.cc
5>ClientConfiguration.cc
5>CommonClient.cc
5>CommonRequest.cc
5>CommonResponse.cc
5>CoreClient.cc
5>Credentials.cc
5>CredentialsProvider.cc
5>CurlHttpClient.cc
5>EcsMetadataFetcher.cc
5>EndpointProvider.cc
5>Error.cc
5>Executor.cc
5>HmacSha1Signer.cc
5>D:\Visual Studio\Projects\aliyun-openapi-cpp-sdk-master\core\src\HmacSha1Signer.cc(41,10): warning C4200: 使用了非标准扩展: 结构/联合中的零大小数组
5>D:\Visual Studio\Projects\aliyun-openapi-cpp-sdk-master\core\src\HmacSha1Signer.cc(44,15): warning C4267: “初始化”: 从“size_t”转换到“DWORD”,可能丢失数据
5>D:\Visual Studio\Projects\aliyun-openapi-cpp-sdk-master\core\src\HmacSha1Signer.cc(50,30): warning C4267: “=”: 从“size_t”转换到“DWORD”,可能丢失数据
5>D:\Visual Studio\Projects\aliyun-openapi-cpp-sdk-master\core\src\HmacSha1Signer.cc(67,59): warning C4267: “参数”: 从“size_t”转换到“DWORD”,可能丢失数据
5>HttpClient.cc
5>HttpMessage.cc
5>HttpResponse.cc
5>HttpRequest.cc
5>InstanceProfileCredentialsProvider.cc
5>D:\Visual Studio\Projects\aliyun-openapi-cpp-sdk-master\core\include\alibabacloud\core\InstanceProfileCredentialsProvider.h(31,14): warning C4275: 非 dll 接口 class“AlibabaCloud::EcsMetadataFetcher”用作 dll 接口 class“AlibabaCloud::InstanceProfileCredentialsProvider”的基
5>正在生成代码...
5>正在编译...
5>NetworkProxy.cc
5>Outcome.cc
5>Runnable.cc
5>RoaServiceClient.cc
5>RoaServiceRequest.cc
5>RpcServiceClient.cc
5>RpcServiceRequest.cc
5>ServiceRequest.cc
5>ServiceResult.cc
5>Signer.cc
5>SimpleCredentialsProvider.cc
5>StsAssumeRoleCredentialsProvider.cc
5>Url.cc
5>Utils.cc
5>D:\Visual Studio\Projects\aliyun-openapi-cpp-sdk-master\core\src\Utils.cc(52,62): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据
5>D:\Visual Studio\Projects\aliyun-openapi-cpp-sdk-master\core\src\Utils.cc(62,64): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据
5>D:\Visual Studio\Projects\aliyun-openapi-cpp-sdk-master\core\src\Utils.cc(78,40): warning C4267: “参数”: 从“size_t”转换到“DWORD”,可能丢失数据
5>LocationClient.cc
5>D:\Visual Studio\Projects\aliyun-openapi-cpp-sdk-master\core\src\location\LocationClient.cc(69,8): warning C4858: 正在放弃返回值: The result of 'std::async' should be stored in a variable. If the return value is discarded, the temporary 'std::future' is destroyed, waiting for an async result or evaluating a deferred result, thus defeating the purpose of 'std::async'.
5>LocationRequest.cc
5>DescribeEndpointsRequest.cc
5>DescribeEndpointsResult.cc
5>StsClient.cc
5>StsRequest.cc
5>正在生成代码...
5>正在编译...
5>AssumeRoleRequest.cc
5>AssumeRoleResult.cc
5>GetCallerIdentityRequest.cc
5>GetCallerIdentityResult.cc
5>正在生成代码...
5> 正在创建库 D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/lib/Release/alibabacloud-sdk-core.lib 和对象 D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/sdk_build/lib/Release/alibabacloud-sdk-core.exp
5>core.vcxproj -> D:\Visual Studio\Projects\aliyun-openapi-cpp-sdk-master\sdk_build\bin\Release\alibabacloud-sdk-core.dll
5>已完成生成项目“core.vcxproj”的操作。
6>------ 已启动生成: 项目: ALL_BUILD, 配置: Release x64 ------
6>Building Custom Rule D:/Visual Studio/Projects/aliyun-openapi-cpp-sdk-master/CMakeLists.txt
7>------ 已跳过“生成”: 项目: INSTALL, 配置: Release x64 ------
7>没有为此解决方案配置选中要生成的项目
========== 生成: 6 成功,0 失败,0 最新,1 已跳过 ==========
========== 生成 于 19:14 完成,耗时 02:26.792 分钟 ==========
…------------------ 原始邮件 ------------------
发件人: "aliyun/aliyun-openapi-cpp-sdk" ***@***.***>;
发送时间: 2025年1月10日(星期五) 下午2:27
***@***.***>;
抄送: "The ***@***.******@***.***>;
主题: Re: [aliyun/aliyun-openapi-cpp-sdk] 在VS2022中运行阿里云短信V1.0的c++版本示例报错: (Issue #156)
编译完整信息发下吧 看是哪行触发的编译报错
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#include
#include
#include <alibabacloud/core/AlibabaCloud.h>
#include <alibabacloud/core/CommonRequest.h>
#include <alibabacloud/core/CommonClient.h>
#include <alibabacloud/core/CommonResponse.h>
using namespace std;
using namespace AlibabaCloud;
int main( int argc, char** argv )
{
AlibabaCloud::InitializeSdk();
AlibabaCloud::ClientConfiguration configuration( "cn-qingdao" );
// specify timeout when create client.
configuration.setConnectTimeout(1500);
configuration.setReadTimeout(4000);
// Please ensure that the environment variables ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET are set.
AlibabaCloud::Credentials credential( getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"), getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET") );
/* use STS Token
credential.setSessionToken( getenv("ALIBABA_CLOUD_SECURITY_TOKEN") );
*/
AlibabaCloud::CommonClient client( credential, configuration );
AlibabaCloud::CommonRequest request(AlibabaCloud::CommonRequest::RequestPattern::RpcPattern);
request.setHttpMethod(AlibabaCloud::HttpRequest::Method::Post);
request.setDomain("dysmsapi.aliyuncs.com");
request.setVersion("2017-05-25");
request.setQueryParameter("Action", "SendSms");
}
报错如下:
错误 C4996 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. test-2-alibaba D:\Visual Studio\Projects\test-2-alibaba D:\Visual Studio\Projects\test-2-alibaba\test-2-alibaba.cpp 19
The text was updated successfully, but these errors were encountered: