nana icon indicating copy to clipboard operation
nana copied to clipboard

1.7.2 Build failed on vs2019

Open JacksiroKe opened this issue 5 years ago • 3 comments

I have nana 1.7.2 on Windows 10 pro and building nanapro on the latest vs2019 fails with the following 4 errors:

Error C2440 'return': cannot convert from 'std::basic_string<char8_t,std::char_traits<char8_t>,std::allocator<char8_t>>' to 'std::basic_string<char,std::char_traits,std::allocator>' (compiling source file ....\source\filesystem\filesystem.cpp) nana D:\nanapro\downloads\nana\include\nana\filesystem\filesystem_ext.hpp 44 Error C2679 binary '=': no operator found which takes a right-hand operand of type 'std::basic_string<char8_t,std::char_traits<char8_t>,std::allocator<char8_t>>' (or there is no acceptable conversion) nana D:\nanapro\downloads\nana\source\gui\msgbox.cpp 1250 Error C2440 'return': cannot convert from 'std::basic_string<char8_t,std::char_traits<char8_t>,std::allocator<char8_t>>' to 'std::basic_string<char,std::char_traits,std::allocator>' (compiling source file ....\source\paint\image.cpp) nana D:\nanapro\downloads\nana\include\nana\filesystem\filesystem_ext.hpp 44 Error C2440 'return': cannot convert from 'std::basic_string<char8_t,std::char_traits<char8_t>,std::allocator<char8_t>>' to 'std::basic_string<char,std::char_traits,std::allocator>' (compiling source file ....\source\gui\filebox.cpp) nana D:\nanapro\downloads\nana\include\nana\filesystem\filesystem_ext.hpp 44

when I try to comment out the lines with the errors the build goes well and finishes. But then I cant get to build a couple of samples which throw an error at the filesystem. Kindly advise on the way forward?

JacksiroKe avatar Dec 10 '19 09:12 JacksiroKe

We have fixed a number of bugs and a release is spectated: use - https://github.com/cnjinhao/nana/tree/develop and make sure your sln/project have std:c++17 or latest set.

qPCR4vir avatar Dec 10 '19 11:12 qPCR4vir

thanks for the quick response. Off course I am on c++17. There was some time i was using nana but i didnt have any problem building. And i never thought of using the develop branch till now.

JacksiroKe avatar Dec 10 '19 11:12 JacksiroKe

You should update the repository download, which you link to in your tutorial blog, as soon as possible. I could only get the VS2019 build solution to compile by

  • setting the language to std:c++17 (c++latest did not work because of std::generic_string_uint8)
  • you named a member variable with the keyword 'module', renaming worked. Defined in File categorize.cpp, class trigger::scheme, line 762.

NOTE: The spectate release mentioned by @qPCR4vir builds flawlessly. I am going to use that one now.

Superkuebel avatar Jan 08 '20 20:01 Superkuebel