extern “C” char** environ - Windows - C++/CLI
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have some old linux code I'm trying to port to Windows. When I first built it as a straight native DLL, I go no issues with this piece of code, but when I tried making it a mixed-mode C++/CLI DLL, I got an unresolved external object error on this: extern "C" char ** environ ; Why would this work for native and not CLI? Any idea how to work around this, or what it even does? 回答1: That holds the environment variables (PATH, etc, etc). The C standard (if i recall correctly) requires environ to point to an array of these variables.