字符串命令exe上显示太多

时间:2014-02-19 13:05:07

标签: c++ string visual-studio-2010

我在VC ++ 2010 Express中创建了一个应用程序,我想知道搜索字符串会显示我的可执行文件。我看到了很多字符串,但引起我注意的是我看到了VS为每个项目生成的.pdb文件的确切位置。

C:\Users\...\myapp\Debug\myapp.pdb

那个人真的很困扰我,因为我不认为应该透露这么多信息(例如我的用户名)。 除此之外,我还看到了很多错误消息,如

Stack memory around _alloca was corrupted 
A local variable was used before it was initialized 
Stack memory was corrupted 
A cast to a smaller data type has caused a loss of data.  If this was intentional, you     should mask the source of the cast with the appropriate bitmask.  For example:  
char c = (i & 0xFF); 
Changing the code in this way will not affect the quality of the resulting optimized code. 
The value of ESP was not properly saved across a function call.  This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention. 
Stack around the variable ' ' was corrupted. 
The variable ' ' is being used without being initialized. 

我真的不明白为什么他们出现(我的程序工作正常,没有一个适用)但我想我可以忍受。 我的问题是如何避免出现这种数据(尤其是我说的pdb位置)?我尝试在项目属性中找到一些但没有成功。

1 个答案:

答案 0 :(得分:1)

您想要的第一个选项是/PDBALTPATH:%_PDB% - 这会保留PDB名称但会丢弃其路径。

错误消息是由默认选项/GS/RTC引起的。但是,后者不是发布版本的默认值。 /GS-将关闭第一个,但这是一个安全风险。