QJulianCalendar: No such file or directory
-
I'm trying to use QJulianCalendar in my CMake Qt6 project. It says
fatal error: QJulianCalendar: No such file or directory
on#include <QJulianCalendar>
(it doesn't say that for e.g. QCalendar so I have the core).I have Qt 6.2.3 from Fedora repository (I just went
# dnf install qt6* *qt6 *qt6*
so I think I have everything); is it possible they built it w/o this part?If I try to use QCalendar with QCalendar::System::Julian, I also can't:
error: no type named 'Julian' in 'QCalendar::System'
My CMakeList.txt:
cmake_minimum_required(VERSION 3.14) project(LanistaCore LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(QT NAMES Qt6 COMPONENTS Core LinguistTools REQUIRED) find_package(Qt6 COMPONENTS Core LinguistTools REQUIRED) set(TS_FILES LanistaCore_en_150.ts) add_library(LanistaCore SHARED glo_lcore.h units.h ancient_units.h arena.h arena.cpp fasti.h fasti.cpp pch_lcore.h ex_lcore.h ${TS_FILES} ) target_link_libraries(LanistaCore PRIVATE Qt6::Core) target_compile_definitions(LanistaCore PRIVATE LANISTACORE_LIBRARY) qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
-
Hi, I just tried it on Ubuntu 20.04 with Qt 6.2.4 installed via the online installer, I can create a Julian calendar just fine: e.g.
#include <QCoreApplication> #include <QCalendar> #include "qdebug.h" int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); auto j = QCalendar(QCalendar::System::Julian); qDebug() << j.name(); return a.exec(); }
and it says "Julian"
If you try to create a Gregorian calendar, say like this:
auto g = QCalendar(QCalendar::System::Gregorian);
and that works, then perhaps you by mistake got the QT_BOOTSTRAPPED version of Qt, not the real 6.2.3 one (because on QT_BOOTSTRAPPED versions of Qt the Julian Calendar is not built). -
It doen't work with QCalendar::System::Gregorian either. Qt Creator autocomplete both Julian and Gregorian enums but then it says
no type named Gregorian in QCalendar::System
, does it mean I have this bootstrapped version? Is it possible there is no normal version in Fedora repo and I have to install it manually? I think I will stop using Fedora if that's the case. Should both appear in Kits? How do I check that?I can't even Google "QT_BOOTSTRAPPED", how can one finds out what's it all about and what else I'm missing having this version? I remember having problems with no QSerialPort in Qt6 but I assumed it's just not ready.
-
@Szymon-Sabat said in QJulianCalendar: No such file or directory:
but then it says no type named Gregorian in QCalendar::System
But does it build? QtCreator sometimes shows wrong errors.
-
@hskoglund I HATE to be this guy... but it all works now. I've switched to your project, it worked, then I've switched back and it also works in my project now...
-
@Szymon-Sabat No problem. glad to hear it works now :-)
-
@Szymon-Sabat said in QJulianCalendar: No such file or directory:
but it all works now. I've switched to your project, it worked, then I've switched back and it also works in my project now...
Coding fairies :)