本文介绍了VS2013类向导始终失败,“无法返回新的代码元素。可能的语法错误......“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 您好。 VS2013 Pro的问题 我想添加一个简单的类到一个C ++项目,但向导总是报告相同的错误,并没有添加任何东西,但它创建.h(而不是cpp)。 错误是:无法返回 新代码元素。可能的语法错误。新元素名称: 此处的类名 它总是创建.h而不是.cpp。 我尝试过: 在不同网站上发现有类似问题的几个技巧(注意到没有工作后恢复更改) 此解决方案无法返回新的代码元素不起作用,因为提到的文件不在项目文件夹中...... 修复 使用SP5从头开始卸载并重新安装。 尝试使用向导或添加类菜单添加类(默认参数S) - 调用向导 - 一些VC ++控制台项目,托管,非托管,MFC项目......同样的错误。 尝试删除解决方案1中建议的项目文件夹中的任何大文件。试图创建新项目并仅复制最少的源代码。仍然报告相同的错误。 恢复默认设置。解决方案 在链接上:文件名已更改。它现在是一个大数据文件。 (目录中最大的文件) 使用唯一的类名并检查文件是否存在,或者该类是否已被使用。 你好 我解决了这个问题。 我卸载了VS2013并执行了深度清理,非常深度清理删除所有文件夹,查找任何不明显的文件夹,卸载卸载程序留下的所有东西,删除卸载程序未删除的任何包等,并尽可能删除注册表项。由于所有过程都需要数小时,因此我不愿意经常这样做。 重新安装并且所有工作现在都完美(我也有一些intellisense问题,甚至还有'撤消'功能)。我按照惯例配置了选项,而不是从备份中恢复它们以防万一... 所以它已经解决但我不知道如何或在哪里问题是。感谢您的建议。 Hello.Problem is with VS2013 ProI am trying to add a simple class to a C++ project but the wizard always reports the same error and does not add anything, but it creates the .h (not the cpp).Error is: Failed to return new code element. Possible syntax error. New element name: "class name here"It always creates the .h but not .cpp.What I have tried:Several tricks found on different websites with similar problems (reverting changes after noticing none worked)This solution Failed to return new Code Element does not work because the mentioned files are not in project folder...RepairingUninstalling and reinstalling from scratch, with SP5.Tried adding a class (default parameterS) using the wizard or "add class" menu -that calls wizard- to some VC++ console projects, managed, unmanaged, MFC project... Same error.Tried to delete any "big" file in project folder as suggested in Solution1. Tried to create new project and copying only minimal source code. Still reporting same error.Restoring default settings. 解决方案 On link: the file name has changed. It is now a big data file. (the biggest file in the directory)Use a unique class name and check whether the file exist, or the class is already used.HelloI "solved" the problem.I uninstalled VS2013 and performed a deep cleaning, very deep cleaning removing all the folders, looking for any not-evident folder, desinstaling all the stuff the uninstaller left behind, removing anypackge not removed by the uninstaller, etc. and removing registry entries as much as possible. Since all the process takes hours it's not something I'm willing to do often.Reinstalled and all is working now perfectly (I also got some intellisense issues and even with the 'undo' feature). I configured options as I use to do, not recovering them from a backup just in case...So it's solved but I don't know how or where the problem was. Thanks for your suggestions guys. 这篇关于VS2013类向导始终失败,“无法返回新的代码元素。可能的语法错误......“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-21 12:53