From 334410c4154cf38dbebdb37d906a84484e032cb0 Mon Sep 17 00:00:00 2001 From: Shun Wang Date: Fri, 6 Sep 2024 09:48:29 +0000 Subject: [PATCH] fix build on Linux --- Desktop/CMakeLists.txt | 2 +- Desktop/data/importers/excel/excel.cpp | 3 ++- Desktop/data/importers/excelimporter.cpp | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Desktop/CMakeLists.txt b/Desktop/CMakeLists.txt index 17506d7e3c..68cf5b66ac 100644 --- a/Desktop/CMakeLists.txt +++ b/Desktop/CMakeLists.txt @@ -150,7 +150,7 @@ target_link_libraries( OpenSSL::Crypto # FreeXL ${LIBFREEXL_LIBRARIES} - freexl::freexl + $<$>:freexl::freexl> # ReadStat ----------------------------------- ${LIBREADSTAT_LIBRARIES} # MinGW's ReadStat diff --git a/Desktop/data/importers/excel/excel.cpp b/Desktop/data/importers/excel/excel.cpp index c8e82c5b24..3042b0aee4 100644 --- a/Desktop/data/importers/excel/excel.cpp +++ b/Desktop/data/importers/excel/excel.cpp @@ -31,7 +31,8 @@ Excel::Excel(const string &locator) void Excel::open() { - _fileSize = QFileInfo::size(_path); + QFileInfo fi(tq(_path)); + _fileSize = fi.size(); if (_fileSize < 0) throw runtime_error("Could not access file"); diff --git a/Desktop/data/importers/excelimporter.cpp b/Desktop/data/importers/excelimporter.cpp index db3376d5b2..3e5dad5250 100644 --- a/Desktop/data/importers/excelimporter.cpp +++ b/Desktop/data/importers/excelimporter.cpp @@ -18,6 +18,7 @@ #include "excelimporter.h" #include "data/importers/excel/excel.h" #include "data/importers/excel/excelimportcolumn.h" +#include #include #include #include @@ -37,7 +38,7 @@ ImportDataSet* ExcelImporter::loadFile(const std::string &locator, std::function uint32_t row; uint16_t col; - vector importColumns; + std::vector importColumns; Excel excel(locator); excel.open(); @@ -73,7 +74,7 @@ ImportDataSet* ExcelImporter::loadFile(const std::string &locator, std::function for (int i = 0; i < colNames.size(); ++i) { - string colName = colNames[i]; + std::string colName = colNames[i]; if (colName.empty()) colName = "V" + std::to_string(i + 1); else if(ColumnUtils::isIntValue(colName))