2015-07-19 64 views
1

所以,我正在處理我的項目,當時突然視覺工作室警告我說我的行結尾不一致。然後問我是否想重新編碼項目中的文件。我點擊是,然後選擇「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)" ([email protected]@@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) referenced in function "public: __thiscall Teste::Teste(int,int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,float)" ([email protected]@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) C:\Users\Leonardo\documents\visual studio 2013\Projects\lhengine\lhengine\teste.obj lhengine 
Error 2 error LNK2019: unresolved external symbol "public: __thiscall lh::Heightmap::~Heightmap(void)" ([email protected]@@[email protected]) referenced in function [email protected]@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]$7 C:\Users\Leonardo\documents\visual studio 2013\Projects\lhengine\lhengine\teste.obj lhengine 
Error 3 error LNK2019: unresolved external symbol "public: void __thiscall lh::Heightmap::draw(void)" ([email protected]@[email protected]@QAEXXZ) referenced in function "private: virtual void __thiscall Teste::render(void)" ([email protected]@@EAEXXZ) C:\Users\Leonardo\documents\visual studio 2013\Projects\lhengine\lhengine\teste.obj lhengine 
Error 4 error LNK1120: 3 unresolved externals C:\Users\Leonardo\documents\visual studio 2013\Projects\lhengine\Debug\lhengine.exe lhengine 

從我理解的是抱怨std :: string和char的東西,但我不知道該怎麼做。我保存了這些文件,現在它也向我顯示了這個警告:

warning C4067: unexpected tokens following preprocessor directive - expected a newline c:\users\leonardo\documents\visual studio 2013\projects\lhengine\lhengine\heightmap.cpp 1 1 lhengine 

回答

1

我設法發現錯誤。基本上,visual studio使用UTF8編碼保存文件,但使用Line結尾作爲Unicode Line Separator (LS)

由於某些原因,VS無法識別此行結尾。爲了使它再次工作,我重新保存了文件。 Save File as... >> Save with encoding...,行結尾爲Windows (CR LF)

相關問題