Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [Solved]Syntax error for QIconvCodec on 5.3.2 build
Forum Updated to NodeBB v4.3 + New Features

[Solved]Syntax error for QIconvCodec on 5.3.2 build

Scheduled Pinned Locked Moved Installation and Deployment
22 Posts 2 Posters 7.3k 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.
  • R Offline
    R Offline
    RangerQT
    wrote on last edited by
    #1

    I'm building Qt5.3.2 64 bit from git on Windows 64 bit machine using VS2010 toolchain. I'm using this http://qt-project.org/wiki/Building_Qt_5_from_Git as a guide.

    I did a git clone on the Qt5 repository, then did git checkout 5.3.2 and ran perl init-repository -no-webkit.

    Configure works and when I run nmake I get this error.

    codecs\qtextcodec.cpp(288) : error C2061: syntax error : identifier 'QIconvCodec'
    NMAKE : fatal error U1077: '"d:\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.EXE"' : return code '0x
    2'
    Stop.

    Line 288 consists of

    #if !defined(QT_NO_ICONV)
    (void) new QIconvCodec;
    #endif

    From what I can find by searching there was an error in earlier versions of Qt 5 (Qt 5 RC1 bug #28473) where there was an issue with a definition in the header file but that is supposed to have been fixed. Other than that bugreport I haven't found much else that pertains to actually building Qt but there are some for building apps with Qt.

    I assume I do need this library it for character conversion on windows unless windows has something else that Qt will use by default.

    I thought I'd post here first before I file a bug in case I'm missing something obvious.

    Thanks.

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

      Hi and welcome to devnet,

      Could you check the configuration summary to see if it mentioned iconv support enabled ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        RangerQT
        wrote on last edited by
        #3

        Thank you. I' m glad to be here. I really like Qt and hope to get more active in it. I've spent a lot of time recently and want to build Qt, then Qt Creator from git.

        config.summary shows

        Qt Configuration:
        iconv

        Iconv support......yes

        I know under Linux this should be yes but for Windows does Qt use something besides the libconv such as built in Windows features? Should I use -noiconv (or is it no-iconv)?

        1 Reply Last reply
        0
        • R Offline
          R Offline
          RangerQT
          wrote on last edited by
          #4

          I did a build with -no-iconv and got a different error so I'm off to track it down. It will build with no iconv but what do I give up on Windows by not having it?

          c/corelib/kernel/qcore_unix_p.h(60) : fatal error C1189: #error : "qcore_unix_p.h included on a n
          -Unix system"
          NMAKE : fatal error U1077: '"d:\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.EXE"' : return code '
          2'
          Stop.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Oo, looks like you are trying to build a unix version of Qt on windows.

            What options are you giving to configure ? Where do you call it from ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • R Offline
              R Offline
              RangerQT
              wrote on last edited by
              #6
              1. I cloned qt/qt5 into my qt5 local repository, qt5 with

                git clone git@gitorious.org:qt/qt5 qt5

              2. I make sure I'm in my local repo/qt5 directory and then I did git checkout (git branch 5.3.2).

              3. Run perl init-repository -no-webkit

              4. I then run configure.bat (from the qt5 top level directory) which does a -top-level and adds my stuff. The configure.bat makes sure the qtbase directory exists and then changes to it, then runs the configure.bat in qtbase with the \pathtoqtbase\configure.bat

              -prefix D:\Qt-5.3.2-x64 -developer-build -no-icu -opensource -platform win32-msvc2010 -nomake examples -nomake tests -mp -confirm-license -plugin-sql-psql -plugin-sql-odbc -plugin-sql-MySQL

              In the configure.bat in qtbase it checks for .gitignore and if it does NOT exist it skips all the setup for c, perl, etc. and just runs configure.exe In this case .gitignore does exist so it sets up the compilers, creates the makefile and then runs configure.exe as

              configure.exe -srcdir %QTSRC% %* 
              

              where QTSRC is the qt5\qtbase directory.

              What does top-level tell config to do. I have not found it in any of the lists for Qt config options.

              I am running this on a Windows 7 Pro 64 bit machine that does have git-bash installed but I am running from the windows command prompt - actually it's the same as the Visual Studio 64 bit command prompt which sets up the environment for VS2010 64 bit.

              Thanks.

              1 Reply Last reply
              0
              • R Offline
                R Offline
                RangerQT
                wrote on last edited by
                #7

                I think I found the problem. I was a victim of my cut and paste. I had started using the configure line above when I first started trying to build Qt so I cut and pasted it but forgot to add the -no-iconv so it must have tried to build it.

                Tonight I changed that and added the no-iconv and got much further to the point where it's trying to build the PostgreSQL plugin but I left that out of the include path.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Well, nice you got further, but I'm still wondering why it thought you were building on a unix like system.

                  If you have enough time, can you try to re-configure (you can use an out of source build for that one so you don't need to clean everything again) but without giving the platform no iconv options ? The platform should be auto-detected for you

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    RangerQT
                    wrote on last edited by
                    #9

                    I wonder, too. I have time and it will be good learning. I'll do an out of source build and see what happens.

                    I assume I should leave QMAKESPEC blank and not do a -platform option?

                    1 Reply Last reply
                    0
                    • R Offline
                      R Offline
                      RangerQT
                      wrote on last edited by
                      #10

                      A question. iconv is needed on Linux but on Windows does the QT build process use a native Windows encoding system?

                      1 Reply Last reply
                      0
                      • R Offline
                        R Offline
                        RangerQT
                        wrote on last edited by
                        #11

                        I'm started fresh and am doing an out of source build. QMAKESPEC was undefined and no -platform and it detected win32-msvc2010 according to config.summary. The iconv is set as yes - I did not have that in my options and I removed the MySQL and PostgreSQL plugins.

                        I started a build with jom /j 8 so we'll see.

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          IIRC, you're right

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • R Offline
                            R Offline
                            RangerQT
                            wrote on last edited by
                            #13

                            The build with jom hung so I started again - new build directory, reconfigure, and use nmake this time. We'll see what happens.

                            1 Reply Last reply
                            0
                            • R Offline
                              R Offline
                              RangerQT
                              wrote on last edited by
                              #14

                              This time it finished. I started clean with a fresh clone of git, did NOT specify QMAKESPEC or -platform. Configure summary showed iconv was no. I did an out of source build.

                              I used both -developer-build and -prefix D:\somedir.

                              I am now running nmake install and it's copying the files.

                              All I can figure is that I must have had something wrong on my setup or system.

                              I guess in summary

                              1. Windows Qt builds do not use iconv and will figure that out.
                              2. Don't use QMAKESPEC - let it be set by the detection process
                              1 Reply Last reply
                              0
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #15

                                Strange that jom failed… Anyway, nice it worked out.

                                Did you by any chance build once with MinGW ?

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                1 Reply Last reply
                                0
                                • R Offline
                                  R Offline
                                  RangerQT
                                  wrote on last edited by
                                  #16

                                  No builds with MingGW. I have been using git source and the VS2010 toolchain all along. I can only assume it was something on my system.

                                  I'll be doing lots more builds so I'll redo some of what I did.

                                  Two questions

                                  1. I assume iconv is Linux only so Qt will use Windows codecs.

                                  2. I've built Qt so that is, if I understand correctly, the base, the kit that things I build with Qt Creator and Qt Creator itself will use (after I build Qt Creator). Is that correct?

                                  Thanks for the help.

                                  1 Reply Last reply
                                  0
                                  • SGaistS Offline
                                    SGaistS Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #17
                                    1. Not Linux only but not used for Windows

                                    2. You don't need to build Qt Creator unless you plan to either create plugins for it or work on it's code base. You can simply download the latest version otherwise.

                                    Go to the Preferences -> Build and Run -> Qt version -> Add your newly built Qt -> Save -> go to Kits -> Create a new Kit and make it use that newly added Qt Version -> Save -> enjoy !

                                    Interested in AI ? www.idiap.ch
                                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    1 Reply Last reply
                                    0
                                    • R Offline
                                      R Offline
                                      RangerQT
                                      wrote on last edited by
                                      #18

                                      I guess Mac, and some others too for iconv.

                                      That is good to know. I'll give that a try.

                                      Thanks again.

                                      1 Reply Last reply
                                      0
                                      • SGaistS Offline
                                        SGaistS Offline
                                        SGaist
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #19

                                        You're welcome !

                                        If you have everything going right now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

                                        Interested in AI ? www.idiap.ch
                                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                        1 Reply Last reply
                                        0
                                        • R Offline
                                          R Offline
                                          RangerQT
                                          wrote on last edited by
                                          #20

                                          Very good idea. How do I do that. I've checked around my profile, the post, searched, and come up dry.

                                          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