C++: Setenv(). Undefined identifier in Visual Studio

前端 未结 4 1462
春和景丽
春和景丽 2020-12-09 19:51

Look my code seems to be correct, according to all the documentation I can find online. My IDE is MS Visual Studio Xpress 4 Windows Desktop 2012, and it\'s compiler is throw

4条回答
  •  独厮守ぢ
    2020-12-09 20:00

    the reason you encountered the linkage error is that, if you take a look at the content of the library of stdlib.h, you will find that, setenv() is not declared there. At the first glance, it is a C standard API, but looks like Windows do not follow all of the standard. Or, you might be able to configure your VS to use CRT instead of Windows runtime, in that case, I think setenv will be identified.

提交回复
热议问题