rocketmq-client-cpp icon indicating copy to clipboard operation
rocketmq-client-cpp copied to clipboard

vs2019 compile error

Open yuntong613 opened this issue 2 years ago • 4 comments

Environment: Windows 10,vs2019,vcpkg and rocketmq master branch. Error Info : There is no "setenv" method in vs2019,but _putenv or _putenv_s

yuntong613 avatar Oct 11 '22 07:10 yuntong613

@yuntong613 这个问题有解决吗?不修改代码的情况下

HUHANK avatar Jun 03 '24 07:06 HUHANK

在源码\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 avatar Jun 03 '24 08:06 yuntong613

@yuntong613 hello, 你有详细的VS2019 编译 rocketmq-cpp-client 2.2.0 的说明文档吗?我这边编译遇到问题老是不成功

HUHANK avatar Jun 05 '24 05:06 HUHANK

@HUHANK 工程地址在这里,https://github.com/yuntong613/RocketMQ

yuntong613 avatar Jun 05 '24 05:06 yuntong613