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. A Few problems with qt
Qt 6.11 is out! See what's new in the release blog

A Few problems with qt

Scheduled Pinned Locked Moved General and Desktop
9 Posts 4 Posters 8.2k Views 1 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.
  • E Offline
    E Offline
    etixpp
    wrote on last edited by
    #1

    Hi, i got a few problems and cant fix them

    1. If i want to start debugger i get linker error - release works...
    2. How can i create a .dll ? I find no option
    3. How can i change projekt properties like from unicode to multibyte? In Vs i just had to rightclick projekt and projekt properties ôo
    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Woud be nice to have those questions in separate threads:

      Post the error code and message, provide more info if possible.

      Yes. If you are using qmake, then you need to add TEMPLATE = lib to your .pro file (and change the source code to have a lib to build, with all the exports etc.). You can also begin a new library project from within Qt Creator, if you are using that IDE.

      Yes, there are several places where this can be done. Check out text editor settings in Qt Creator preferences, or change the filest in your text editor, Qt will respect that. Unicode is multibyte, by the way.

      Hard to add anything without more concrete questions/ data.

      (Z(:^

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qxoz
        wrote on last edited by
        #3

        Hi! Welcome to DevNet :)

        1. Information not enough for answering to your first question. Give us error output.
        2. In Qt Creator NewProject ->Other Project -> C++ Library
          -3. Unfortunately i don't know answer to this question.-
        3. Tools->Options...-> Text Editor -> Behavior -> File Encodings
        1 Reply Last reply
        0
        • E Offline
          E Offline
          etixpp
          wrote on last edited by
          #4

          hey

          @ 3 - i need this option http://s14.directupload.net/images/130326/jsouccb5.png from Unicode to Multibyte, otherwise my projekt dont work, there is actually no multibyte option in text editor settings -.-

          @ 2 yes that works fine ^-^

          @ 1 :-1: Fehler:LNK1123: Fehler bei der Konvertierung in COFF: Datei ist ungültig oder beschädigt.

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

            Just some notes on 3:

            sierdzio - in MS terms Multibyte (MBCS) means actually 2-byte without particular encoding specified (so wchar_t or short, depending on yet another setting), so unicode(or at least not all variants) is not multibyte. Yeah, I know this is a bit silly but there is a lot of history behind this naming convention so it sticked ;)

            qxoz - this setting is for source file encoding, the setting in VS is actually for conditional compilation of unicode or MBCS support.

            There is no direct equivalent in Qt Creator for this setting as this is partly MS specific option, but you can still set it in the .pro file manually, by adding defines (via DEFINES +=):
            UNICODE and _UNICODE is equivalent to "Unicode" setting in VS
            MBCS and _MBCS is equivalent to "Multibyte" setting VS
            no additional defines - equivalent to "None" in VS

            One note though is that from what I remember creator adds definition of UNICODE by default (in mkspec I think) to the compiler parameter list (and also qmake?), so you might want to remove it via QMAKE_CXXFLAGS -= DUNICODE or something like that if you don't want unicode support.

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              [quote author="Krzysztof Kawa" date="1364303275"]sierdzio - in MS terms Multibyte (MBCS) means actually 2-byte without particular encoding specified (so wchar_t or short, depending on yet another setting), so unicode(or at least not all variants) is not multibyte. Yeah, I know this is a bit silly but there is a lot of history behind this naming convention so it sticked ;)[/quote]

              Didn't know about this one, thanks. Well, no surprise, I'm not using Windows much, and I don't MSVS at all ;)

              (Z(:^

              1 Reply Last reply
              0
              • Q Offline
                Q Offline
                qxoz
                wrote on last edited by
                #7

                Krzysztof Kawa@ thanks for information.

                1 Reply Last reply
                0
                • E Offline
                  E Offline
                  etixpp
                  wrote on last edited by
                  #8

                  hej, i just added
                  DEFINES += _MBCS
                  QMAKE_CXXFLAGS -= DUNICODE

                  to .pro but still get the error

                  C:\Users\Aleksander\Desktop\c++\LoL_Helper\mainwindow.cpp:21: Fehler:C2664: 'FindWindowW': Konvertierung des Parameters 2 von 'LPCSTR' in 'LPCWSTR' nicht m”glich
                  Die Typen, auf die verwiesen wird, sind nicht verknpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.

                  which is the same in VS with Unicode but when i change to multibyte no problem...

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

                    Sorry, I just guessed where the UNICODE is defined, and actually it's in DEFINES, not QMAKE_CXXFLAGS, so it should be
                    @
                    DEFINES -= UNICODE
                    DEFINES += _MBCS
                    @

                    Btw. Unless it's some kind of large, legacy app you are porting, I would strongly suggest to stick to unicode. For sure in new apps. It's really THE standard these days. Or, at least, use the "neutral" types like LPCTSTR instead of LPCSTR and LPCWSTR to allow it to compile both ways.

                    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