Skip to content
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

vs2019 compile error #445

Open
yuntong613 opened this issue Oct 11, 2022 · 4 comments
Open

vs2019 compile error #445

yuntong613 opened this issue Oct 11, 2022 · 4 comments

Comments

@yuntong613
Copy link

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

@HUHANK
Copy link

HUHANK commented Jun 3, 2024

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

@yuntong613
Copy link
Author

yuntong613 commented Jun 3, 2024

在源码\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

@HUHANK
Copy link

HUHANK commented Jun 5, 2024

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

@yuntong613
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants