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. Can't we build Qt with /Zc:wchar_t- flag anymore?
QtWS25 Last Chance

Can't we build Qt with /Zc:wchar_t- flag anymore?

Scheduled Pinned Locked Moved Unsolved General and Desktop
build6.8
2 Posts 2 Posters 100 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.
  • N Offline
    N Offline
    naveen13
    wrote on 5 Mar 2025, 15:46 last edited by
    #1

    Earlier I was using Qt4.5 in my application and both were built with /Zc:wchar_t- flag. Now when i was trying to move it to Qt6.8, I was facing the following error:

    qchar.h(79): error C2535: 'QChar::QChar(ushort) noexcept': member function already defined or declared
    

    I found that now the Qt's default flag is with wchar_t as native type, so while configuring i was trying to pass /Zc:wchar_t-. But every time while building QT this flag is getting overridden. Ex:

    [1386/1881] Building CXX object 
    qtbase\src\platformsupport\fbconvenience\CMakeFiles\FbSupportPrivate.dir\qfbwindow.cpp.obj
    cl : Command line warning D9025 : overriding '/Zc:wchar_t-' with '/Zc:wchar_t'
    

    I tried creating a visual studio solution for qtbase and tried building it after changing the setting "Treat wchar_t as built in type" to false, then i am getting the same error from qchar.h
    Can't we build QT with /Zc:wchar_t- flag anymore?
    Is there any workaround without altering the Qt source file?

    C 1 Reply Last reply 5 Mar 2025, 16:01
    0
    • N naveen13
      5 Mar 2025, 15:46

      Earlier I was using Qt4.5 in my application and both were built with /Zc:wchar_t- flag. Now when i was trying to move it to Qt6.8, I was facing the following error:

      qchar.h(79): error C2535: 'QChar::QChar(ushort) noexcept': member function already defined or declared
      

      I found that now the Qt's default flag is with wchar_t as native type, so while configuring i was trying to pass /Zc:wchar_t-. But every time while building QT this flag is getting overridden. Ex:

      [1386/1881] Building CXX object 
      qtbase\src\platformsupport\fbconvenience\CMakeFiles\FbSupportPrivate.dir\qfbwindow.cpp.obj
      cl : Command line warning D9025 : overriding '/Zc:wchar_t-' with '/Zc:wchar_t'
      

      I tried creating a visual studio solution for qtbase and tried building it after changing the setting "Treat wchar_t as built in type" to false, then i am getting the same error from qchar.h
      Can't we build QT with /Zc:wchar_t- flag anymore?
      Is there any workaround without altering the Qt source file?

      C Online
      C Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 5 Mar 2025, 16:01 last edited by
      #2

      @naveen13 said in Can't we build Qt with /Zc:wchar_t- flag anymore?:

      Is there any workaround without altering the Qt source file

      No. You might provide a patch and see if it gets accepted though.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0

      2/2

      5 Mar 2025, 16:01

      • Login

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