compilation error in interactswithio.cpp
nurettin opened this issue · 7 comments
I wanted to give TinyORM a go but I got this error while compiling master branch:
tom/src/tom/concerns/interactswithio.cpp line 276
cannot convert const TableRow
..................... to const Row_t&
Here's the full cmake log:
[ 88%] Building CXX object CMakeFiles/TinyOrm.dir/tom/src/tom/concerns/guesscommandname.cpp.o
[ 89%] Building CXX object CMakeFiles/TinyOrm.dir/tom/src/tom/concerns/interactswithio.cpp.o
/home/nurettin/code/qt_test/TinyORM/tom/src/tom/concerns/interactswithio.cpp: In member function ‘const Tom::Concerns::InteractsWithIO& Tom::Concerns::InteractsWithIO::table(const TableRow&, const std::vector<std::vector<std::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, const char*, tabulate::Table> > >&, Tom::Concerns::InteractsWithIO::Verbosity) const’:
/home/nurettin/code/qt_test/TinyORM/tom/src/tom/concerns/interactswithio.cpp:276:19: error: cannot convert ‘const TableRow’ {aka ‘const std::vector<std::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, const char*, tabulate::Table> >’} to ‘const Row_t&’ {aka ‘const std::vector<std::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, const char*, std::basic_string_view<char, std::char_traits<char> >, tabulate::Table> >&’}
276 | table.add_row(headers);
| ^~~~~~~
| |
| const TableRow {aka const std::vector<std::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, const char*, tabulate::Table> >}
compilation terminated due to -Wfatal-errors.
make[2]: *** [CMakeFiles/TinyOrm.dir/build.make:1709: CMakeFiles/TinyOrm.dir/tom/src/tom/concerns/interactswithio.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/TinyOrm.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
I think I see the problem.
Tabulate's Row_t is std::variant<std::string, char const*, string_view, tabulate::Table>
But TableRow is std::variant<std::string, char const*, tabulate::Table>
(if Tabulate version is >= 1.3.0)
It looks like Tabulate 1.4.0 updated its code to include more string representations.
[ 25%] Building CXX object CMakeFiles/TinyOrm.dir/tom/src/tom/concerns/interactswithio.cpp.o
[ 26%] Building CXX object CMakeFiles/TinyOrm.dir/tom/src/tom/concerns/pretendable.cpp.o
[ 27%] Building CXX object CMakeFiles/TinyOrm.dir/tom/src/tom/concerns/printsoptions.cpp.o
[ 28%] Building CXX object CMakeFiles/TinyOrm.dir/tom/src/tom/concerns/usingconnection.cpp.o
[ 29%] Building CXX object CMakeFiles/TinyOrm.dir/tom/src/tom/exceptions/tomlogicerror.cpp.o
[ 30%] Building CXX object CMakeFiles/TinyOrm.dir/tom/src/tom/exceptions/tomruntimeerror.cpp.o
[ 30%] Building CXX object CMakeFiles/TinyOrm.dir/tom/src/tom/migrationrepository.cpp.o
[ 31%] Building CXX object CMakeFiles/TinyOrm.dir/tom/src/tom/migrator.cpp.o
[ 32%] Building CXX object CMakeFiles/TinyOrm.dir/tom/src/tom/seeder.cpp.o
[ 33%] Building CXX object CMakeFiles/TinyOrm.dir/tom/src/tom/terminal.cpp.o
[ 34%] Building CXX object CMakeFiles/TinyOrm.dir/tom/src/tom/tomconstants_extern.cpp.o
[ 35%] Building CXX object CMakeFiles/TinyOrm.dir/tom/src/tom/tomutils.cpp.o
[ 36%] Linking CXX shared library libTinyOrm.so
[100%] Built target TinyOrm
I guess this deserves a pull request
Again? omg tabulate, the problem is they have that type hardcoded, they should export it through using
so other libraries can use that using
.
Again? omg tabulate, the problem is they have that type hardcoded, they should export it through
using
so other libraries can use thatusing
.
I'm closing it since you found a very nice solution.
We have closed it both at once at the same time 😂😂 I'm death