本文介绍了Visual Studio C ++ - 未解析的符号__environ的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用VS 2008并使用多线程调试(/ MTd)编译我的应用程序。
在链接时,我收到以下错误:

 错误LNK2001:未解析的外部符号__environ 



符号定义在哪里?



感谢
Dima

解决方案

当使用/ Md(或变体)时,符号 _environ _wenviron 由函数调用替换。您需要跟踪使用这些(过时和已弃用)符号的代码,并使它们。我发现很多与您在。



我发现了一些更多细节:

_environ 到宽字符版本 _wenviron ,您的原始代码可能会工作。


I'm using VS 2008 and compile my application with Multi-threaded Debug (/MTd). At link time I receive the following error:

error LNK2001: unresolved external symbol __environ

Where the symbol is defined?

ThanksDima

解决方案

When you are using /Md (or variants), the symbols _environ and _wenviron are replaced by function calls. You need to track down the code that uses these (obsolete and deprecated) symbols, and make them use the proper function names. I found lots of people with the same problem as you in google also.

I found some more detail here:

If you change the use of the symbol _environ to the wide character version _wenviron, your original code will probably work.

这篇关于Visual Studio C ++ - 未解析的符号__environ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 11:07
查看更多