更改编码后未生成项目
Project does not build after changing encoding
所以,我正在处理我的项目,突然visual studio警告我,我的行结尾不一致。然后它问我是否愿意重新编码项目中的文件。我点击了"是"并选择了"unicode"选项。
在那之后,我就不能再构建我的项目了,它给出的错误真的很抽象。
它基本上说有3个未解析的符号,代码为LNK2019
。
我真的很失落,因为我没有更改任何会导致它崩溃的代码。我也很快地浏览了这条消息,所以我读不太多
在项目属性中,字符集为Use Unicode Character Set
。此外,语言扩展选项未被禁用。
Error 1 error LNK2019: unresolved external symbol "public: __thiscall lh::Heightmap::Heightmap(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,int,int,int)" (??0Heightmap@lh@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@HHH@Z) referenced in function "public: __thiscall Teste::Teste(int,int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,float)" (??0Teste@@QAE@HHV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@M@Z) C:UsersLeonardodocumentsvisual studio 2013Projectslhenginelhengineteste.obj lhengine
Error 2 error LNK2019: unresolved external symbol "public: __thiscall lh::Heightmap::~Heightmap(void)" (??1Heightmap@lh@@QAE@XZ) referenced in function __unwindfunclet$??0Teste@@QAE@HHV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@M@Z$7 C:UsersLeonardodocumentsvisual studio 2013Projectslhenginelhengineteste.obj lhengine
Error 3 error LNK2019: unresolved external symbol "public: void __thiscall lh::Heightmap::draw(void)" (?draw@Heightmap@lh@@QAEXXZ) referenced in function "private: virtual void __thiscall Teste::render(void)" (?render@Teste@@EAEXXZ) C:UsersLeonardodocumentsvisual studio 2013Projectslhenginelhengineteste.obj lhengine
Error 4 error LNK1120: 3 unresolved externals C:UsersLeonardodocumentsvisual studio 2013ProjectslhengineDebuglhengine.exe lhengine
据我所知,它在抱怨std::string和一些带有char的东西,但我不知道该怎么办。我保存了这些文件,现在它也向我显示了这个警告:
warning C4067: unexpected tokens following preprocessor directive - expected a newline c:usersleonardodocumentsvisual studio 2013projectslhenginelhengineheightmap.cpp 1 1 lhengine
我设法发现了这个错误。visualstudio基本上是使用UTF8编码保存文件,但行结尾为Unicode Line Separator (LS)
。
由于某种原因,VS无法识别这一行的结尾。为了让它再次工作,我重新保存了文件。具有以CCD_ 5结尾的行的CCD_。
相关文章:
- 我的项目不会像"undefined reference to `grpc::g_core_codegen_interface'"那样使用未定义的引用错误进行编译
- 在 Mac 上使用 CMAKE 将 FFTW 和 FFTWPP 链接到项目中时未定义的符号
- 在编译时,C++项目抛出错误 C2228,这是预期的,因为控件在运行时未达到该点
- MacOS 上的 Xcode 11 项目不在一个函数中使用 sin 和 cos:未定义的符号"___sincosf_stret"
- CTest 项目目录.未发现任何测试
- 自定义 QML QQuick彩绘项目成员锚点未在 qml 中设置为父级
- 尝试在 QT 项目中调用 Java 代码时未找到类异常
- 当我在libtorrent上调用dht_get_item时,警报显示该项目未初始化
- 我的 Visual c++ 托管单元测试项目未读取输入文件
- QT5构建/调试项目未更新/否更改
- 将Qt项目转换为VC++项目 - 未解析的外部符号
- QT,Linux上的VTK项目未运行
- Eclipse C++项目未解析LD_LIBRARY_PATH包含变量
- libmediainfo:qt5 项目未定义的符号错误
- 无法在Qt创建器中创建普通C++项目 - 未找到有效的工具包
- Windows上的DLL项目:未解析的外部符号
- 链接HDF5库到Visual c++ DLL项目:未解析的外部符号__imp__*
- C++ CUDA 项目未在 VS2012 中编译,"<<<"错误
- Codelite 中的项目未编译
- Cocos2dx 215 Xcode 5.1 新项目未构建(叮叮当当:错误:未知参数:'-websockets')