gpt4 book ai didi

c++ - 如何让我的c++有setenv?

转载 作者:行者123 更新时间:2023-12-02 15:03:37 26 4
gpt4 key购买 nike

这些是我在使用 MinGW64+MSYS 时输入 CMAKE-3.2.3 的 ./configure 时收到的消息。

CMake 3.2.3, Copyright 2000-2015 Kitware, Inc.
Found GNU toolchain
C compiler on this system is: gcc
C++ compiler on this system is: g++
Makefile processor on this system is: make
g++ is GNU compiler
g++ does not have setenv
g++ does not have unsetenv
g++ has environ in stdlib.h

然后,当 ./configure 中止时,我在 Bootstrap.cmk/cmake_bootstrap.log 中收到两条消息,这可能与上述消息有关。

这些是cmake_bootstrap.log中的消息

c:/src/products/oss/cmake-3.2.3/Source/kwsys/kwsysPlatformTestsCXX.cxx:4
33:28: error: 'setenv' was not declared in this scope^M"
c:/src/products/oss/cmake-3.2.3/Source/kwsys/kwsysPlatformTestsCXX.cxx:4
41:15: error: 'unsetenv' was not declared in this scope^M"

现在我的问题是,

如何让我的 C++ 具有 setenvunsetenv

有人知道哪个版本的 C++ 有 setenvunsetenv 吗?

最佳答案

您需要包含stdlib.h:

#include <cstdlib>

关于c++ - 如何让我的c++有setenv?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35473039/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com