Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QJulianCalendar: No such file or directory
QtWS25 Last Chance

QJulianCalendar: No such file or directory

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 4 Posters 672 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Szymon Sabat
    wrote on last edited by Szymon Sabat
    #1

    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})
    
    1 Reply Last reply
    0
    • hskoglundH Online
      hskoglundH Online
      hskoglund
      wrote on last edited by
      #2

      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).

      1 Reply Last reply
      2
      • S Offline
        S Offline
        Szymon Sabat
        wrote on last edited by Szymon Sabat
        #3

        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.

        jsulmJ 1 Reply Last reply
        0
        • S Szymon Sabat

          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.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @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.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          S 1 Reply Last reply
          1
          • jsulmJ jsulm

            @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.

            S Offline
            S Offline
            Szymon Sabat
            wrote on last edited by Szymon Sabat
            #5

            @jsulm no, it doesn't build. :(

            1 Reply Last reply
            0
            • hskoglundH Online
              hskoglundH Online
              hskoglund
              wrote on last edited by
              #6

              If you try my example above, what error(s) do you get from the compiler?

              S 1 Reply Last reply
              0
              • hskoglundH hskoglund

                If you try my example above, what error(s) do you get from the compiler?

                S Offline
                S Offline
                Szymon Sabat
                wrote on last edited by
                #7

                @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...

                hskoglundH JonBJ 2 Replies Last reply
                0
                • S Szymon Sabat

                  @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...

                  hskoglundH Online
                  hskoglundH Online
                  hskoglund
                  wrote on last edited by
                  #8

                  @Szymon-Sabat No problem. glad to hear it works now :-)

                  1 Reply Last reply
                  1
                  • S Szymon Sabat

                    @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...

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by
                    #9

                    @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 :)

                    1 Reply Last reply
                    1

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved