【问题标题】:How to make my c++ have setenv?如何让我的 C++ 有 setenv?
【发布时间】:2016-05-30 02:55:07
【问题描述】:

这些是我在使用 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

然后我有两条消息,在Bootstrap.cmk/cmake_bootstrap.log ./configure aborted 时,可能与上述消息有关。

这些是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

【问题讨论】:

    标签: c++ mingw msys mingw-w64


    【解决方案1】:

    你需要包含stdlib.h:

    #include <cstdlib>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-03
      相关资源
      最近更新 更多