rocketmq-client-cpp
rocketmq-client-cpp copied to clipboard
vs2019 compile error
Environment: Windows 10,vs2019,vcpkg and rocketmq master branch. Error Info : There is no "setenv" method in vs2019,but _putenv or _putenv_s
@yuntong613 这个问题有解决吗?不修改代码的情况下
在源码\rocketmq-client-cpp\src\common\UtilAll.h 引入自己的头文件,比如名字叫env.h
以下是自己写的env.h内容 #include <stdlib.h> #ifdef WIN32 int setenv( const char* name, const char* value, int overwrite ) { int errcode = 0; if( !overwrite ) { size_t envsize = 0; errcode = getenv_s( &envsize, NULL, 0, name ); if( errcode || envsize ) return errcode; } return _putenv_s( name, value ); } #endif
@yuntong613 hello, 你有详细的VS2019 编译 rocketmq-cpp-client 2.2.0 的说明文档吗?我这边编译遇到问题老是不成功
@HUHANK 工程地址在这里,https://github.com/yuntong613/RocketMQ