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. Compiling Existing QT application with VS2015X86 QT 5.6 having errors
Qt 6.11 is out! See what's new in the release blog

Compiling Existing QT application with VS2015X86 QT 5.6 having errors

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 2.0k Views 2 Watching
  • 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
    Narasimman
    wrote on last edited by
    #1

    I have already QT application. Whenever QT has been release we download those latest binaries and start compiling our application. Still now we have compiled from Qt 5.1.1 to till date. But Qt 5.6 not providided binaries for VS2012 . So We tried on VS2015 with QT 5.6. But not all are compiling.

    Below is the errors

    warning C4477: 'swscanf' : format string '%c' requires an argument of type 'wchar_t *', but variadic argument 1 has type 'char *'
    note: consider using '%hc' in the format string
    note: consider using '%Tc' in the format string
    note: consider defining _CRT_STDIO_ISO_WIDE_SPECIFIERS if C99 standard semantics is required
    warning C4477: 'swscanf' : format string '%c' requires an argument of type 'wchar_t *', but variadic argument 1 has type 'unsigned char *'
    note: consider using '%hc' in the format string
    note: consider using '%Tc' in the format string
    note: consider defining _CRT_STDIO_ISO_WIDE_SPECIFIERS if C99 standard semantics is required
    error C2440: '=': cannot convert from 'const wchar_t [19]' to 'WCHAR *'
    ..\wm\src\Registry.cpp(225): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)

    Seems something has broken in VS2015 . Any suggestion on this?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      It seems they added extra checking to VS 2015 RTM
      http://blogs.msdn.com/b/vcblog/archive/2015/06/22/format-specifiers-checking.aspx

      1 Reply Last reply
      0
      • N Offline
        N Offline
        Narasimman
        wrote on last edited by
        #3

        This I saw, but How to easily to change the existing application, need a good approach. otherwise i need to switch code between compilers.

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by Chris Kawa
          #4

          @Narasimman said:

          Seems something has broken in VS2015 .

          It's actually the other way around. They started to give you warnings when your code is broken. Previously the code worked (or seem to) in silently undefined way.

          Any suggestion on this?

          I guess since you're going to touch that code anyway you could take the opportunity and use these warnings to fix it.
          The first warning you posted means you're passing a narrow character string to a function expecting a wide character string, so a simple fix: swscanf("foo", ... -> swscanf(L"foo", .... If the param comes from somewhere you need to convert it first.

          Can you post a sample code that triggers the warnings?

          1 Reply Last reply
          0

          • Login

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