Tuesday 19 June 2018

.net - Linker error when rebuilding C++-CLI project std::basic_string

I'm writing a C++ application in Visual Studio 2008. I've added a Windows Form to my project, enabled CLR support and added a line to instantiate the form.



Since doing this, I get a load of linker errors as follows:





error LNK2001: unresolved external symbol "public: virtual class std::basic_string,class std::allocator > __thiscall ... " (...)




Any ideas what I'm doing wrong?



Full error (anonymised):



1>Linking...
1> Creating library C:\***.lib and object C:\***.exp

1>getProducts.obj : error LNK2001: unresolved external symbol "public: virtual class std::basic_string,class std::allocator > __thiscall ***::GetClassName(void)const " (?GetClassName@***@@UBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>getProducts.obj : error LNK2001: unresolved external symbol "protected: virtual class std::basic_string,class std::allocator > __thiscall ***::GetClassName(void)const " (?GetClassName@***@@MBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>getProducts.obj : error LNK2001: unresolved external symbol "protected: virtual class std::basic_string,class std::allocator > __thiscall ***::GetClassName(void)const " (?GetClassName@***@@MBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>getProducts.obj : error LNK2001: unresolved external symbol "protected: virtual class std::basic_string,class std::allocator > __thiscall ***::GetClassName(void)const " (?GetClassName@***@@MBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>getProducts.obj : error LNK2001: unresolved external symbol "protected: virtual class std::basic_string,class std::allocator > __thiscall ***::GetClassName(void)const " (?GetClassName@***@@MBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>getProducts.obj : error LNK2001: unresolved external symbol "protected: virtual class std::basic_string,class std::allocator > __thiscall ***::GetClassName(void)const " (?GetClassName@***@@MBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>getProducts.obj : error LNK2001: unresolved external symbol "protected: virtual class std::basic_string,class std::allocator > __thiscall ***::GetClassName(void)const " (?GetClassName@***@@MBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>getProducts.obj : error LNK2001: unresolved external symbol "protected: virtual class std::basic_string,class std::allocator > __thiscall ***::GetClassName(void)const " (?GetClassName@***@@MBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>MSVCRT.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>C:\***.exe : fatal error LNK1120: 9 unresolved externals

1>Build log was saved at "file://c:\***\BuildLog.htm"
1>getProducts - 10 error(s), 12 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ========

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...