Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build QtXlsxWriter by mingw 4.8.2 (32bit) #60

Closed
Matumba opened this issue Nov 1, 2014 · 26 comments
Closed

Cannot build QtXlsxWriter by mingw 4.8.2 (32bit) #60

Matumba opened this issue Nov 1, 2014 · 26 comments

Comments

@Matumba
Copy link

Matumba commented Nov 1, 2014

Hi!
I had installed Qt 5.3.2, mingw 4.8.2,ActivePerl 5.16.3 on my windows 7(32 bit).
After I unzipped 'QtXlsxWriter-master' to custom folder I opened cmd with admin privileges and moved (cd) to 'C:\Qt\QtXlsxWriter'
I completed 3 commands:
qmake
mingw32-make -j3
mingw32-make install
After all of this I can include only QtXlsxDepends (like there #44)
image
What did I do wrongly?

@Matumba
Copy link
Author

Matumba commented Nov 1, 2014

QtXlsxDepends:
image

@dbzhang800
Copy link
Owner

Hi, has your perl been added to your system path?

You can run following command to see whether it works or not.

perl -v

@Matumba
Copy link
Author

Matumba commented Nov 2, 2014

Hi, 5.16.3
image

@dbzhang800
Copy link
Owner

Hi, when you run qmake, Qt's perl script syncqt.pl will be called automatically. Can you found following message?

Project MESSAGE: perl -w C:\Qt\Qt5.3.2\5.3\msvc2010_opengl\bin\syncqt.pl -module
 QtXlsx -version 0.3.0 -outdir F:/Qt-Projects/build-qtxlsx-MSVC2010_Qt5_x86-Debu
g F:/Qt-Projects/QtXlsxWriter

@Matumba
Copy link
Author

Matumba commented Nov 3, 2014

Hi, after I had run qmake I had this on my console:
image

@dbzhang800
Copy link
Owner

Hi, maybe this is a bug of Qt's build system. You can give a try to the "shadow build" to see what will happen.

  • Download source code, then unzip it to a custom directory, such as C:\Qt\QtXlsxWriter
  • Create an new empty directory for build, such as C:\Qt\QtXlsxWriter-build
  • In the build directory, run following command
qmake ..\QtXlsxWriter
make
make install

@Matumba
Copy link
Author

Matumba commented Nov 3, 2014

cd C:\Qt\QtXlsxWriter-build
qmake ..\QtXlsxWriter
mingw32-make -j3
mingw32-make install
again only QtXlsxDepends
image

@dbzhang800
Copy link
Owner

Hi, I have no idea what's wrong with Qt's qmake build ;-( .

Maybe you can give a try to giving a -r option to the qmake.

qmake -r
make
make install

If it's still doesn't work, run following command to find the debug information.

qmake -d 2> build_xlsx.log

@Matumba Matumba closed this as completed Nov 4, 2014
@Matumba Matumba reopened this Nov 4, 2014
@Matumba
Copy link
Author

Matumba commented Nov 4, 2014

Hi, What should I do with that log's file (except reading ofc.)?

@dbzhang800
Copy link
Owner

The log file contains the qmake runtime information. For example, from which we can see whether the perl script syncqt.pl works or not.

However, the log file is not easy to understandard. as many xxxx.prf and xxxx.pri files get loaded when we run qmake.

@Matumba
Copy link
Author

Matumba commented Nov 5, 2014

image
in the logs, I noticed that there is't any information about using perl scripts.

@dbzhang800
Copy link
Owner

Sorry, I have no idea what's wrong with your build system.

The log file affected by many factors, such as in-source/showdow build, with/without -r , number of -d, etc.

Hope others can reproduce this issue in their computer.

@tosty33
Copy link

tosty33 commented Nov 11, 2014

Got that same issue too, I can include only QtXlsxDepends, nothing else :/

@dbzhang800
Copy link
Owner

Hi Crypton33, can you provided more information for this?

In order to find which cause this issue, I simply download the Qt5.3.2 from http://download.qt-project.org/official_releases/qt/5.3/5.3.2/qt-opensource-windows-x86-mingw482_opengl-5.3.2.exe

After install the Qt5.3.2, I try to build Qt Xlsx with it.

But I could not reproduce this issue, It works very well under my Window 8.1 (X64) system. So I don't know what's wrong with your build system.

@SidMeier
Copy link

Got same issue on Win7(x64).
I do as you say:

I simply download the Qt5.3.2 from http://download.qt-project.org/official_releases/qt/5.3/5.3.2/qt-opensource-windows-x86-mingw482_opengl-5.3.2.exe

After install the Qt5.3.2, I try to build Qt Xlsx with it.

I add make install build step in project menu in Qt Creator and then just build project - but got no headers except QtXlsxDepends.

P.S. No problems with same on Ubuntu...

@SidMeier
Copy link

I can't explain, but this version works https://drive.google.com/file/d/0B1bEKZzKkrRnaWdXMGRFU3h0dkk/view?usp=sharing

This version i was download several days ago from github and successfully install it on my Ubuntu. But today i was try to install master version again - and it can't build headers except QtXlsxDepends both on Ubuntu and Win7... But version from top of this message works... both on Ubuntu and Win7...

@luckyhacky
Copy link

Same error in WIN7 - used QT5.3.2
I think there is a problem in the generated Makefiles.
excerpt from Makefile.Debug

install_targ_headers: all FORCE @test -d C:$(INSTALL_ROOT)/Qt/Qt5.3.2/5.3/mingw482_32/include/QtXlsx || mkdir -p C:$(INSTALL_ROOT)/Qt/Qt5.3.2/5.3/mingw482_32/include/QtXlsx -$(INSTALL_FILE) C:/Qt/qxls/QtXlsxWriter-master/include/QtXlsx/QtXlsxDepends C:$(INSTALL_ROOT)/Qt/Qt5.3.2/5.3/mingw482_32/include/QtXlsx/

Ubuntu is working well.

@dbzhang800
Copy link
Owner

Hi luckyhacky,

The install_targ_headers target of the src/xlsx/Makefile.Debug in my computer looks like this

install_targ_headers: all FORCE
    @if not exist D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx mkdir D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx & if not exist D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx exit 1
    -$(INSTALL_FILE) F:\Qt-Projects\QtXlsxWriter\src\xlsx\xlsxabstractooxmlfile.h D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx
    -$(INSTALL_FILE) F:\Qt-Projects\QtXlsxWriter\src\xlsx\xlsxabstractsheet.h D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx
    -$(INSTALL_FILE) F:\Qt-Projects\QtXlsxWriter\src\xlsx\xlsxcell.h D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx
    -$(INSTALL_FILE) F:\Qt-Projects\QtXlsxWriter\src\xlsx\xlsxcellformula.h D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx
    -$(INSTALL_FILE) F:\Qt-Projects\QtXlsxWriter\src\xlsx\xlsxcellrange.h D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx
    -$(INSTALL_FILE) F:\Qt-Projects\QtXlsxWriter\src\xlsx\xlsxcellreference.h D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx
    -$(INSTALL_FILE) F:\Qt-Projects\QtXlsxWriter\src\xlsx\xlsxchart.h D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx
    -$(INSTALL_FILE) F:\Qt-Projects\QtXlsxWriter\src\xlsx\xlsxchartsheet.h D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx
    -$(INSTALL_FILE) F:\Qt-Projects\QtXlsxWriter\src\xlsx\xlsxconditionalformatting.h D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx
    -$(INSTALL_FILE) F:\Qt-Projects\QtXlsxWriter\src\xlsx\xlsxdatavalidation.h D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx
    -$(INSTALL_FILE) F:\Qt-Projects\QtXlsxWriter\src\xlsx\xlsxdocument.h D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx
    -$(INSTALL_FILE) F:\Qt-Projects\QtXlsxWriter\src\xlsx\xlsxformat.h D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx
    -$(INSTALL_FILE) F:\Qt-Projects\QtXlsxWriter\src\xlsx\xlsxglobal.h D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx
    -$(INSTALL_FILE) F:\Qt-Projects\QtXlsxWriter\src\xlsx\xlsxrichstring.h D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx
    -$(INSTALL_FILE) F:\Qt-Projects\QtXlsxWriter\src\xlsx\xlsxworkbook.h D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx
    -$(INSTALL_FILE) F:\Qt-Projects\QtXlsxWriter\src\xlsx\xlsxworksheet.h D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx
    -$(INSTALL_FILE) F:\Qt-Projects\build-qtxlsx-Desktop_Qt_5_3_MinGW_32bit-Debug\include\QtXlsx\qtxlsxversion.h D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx
    -$(INSTALL_FILE) F:\Qt-Projects\build-qtxlsx-Desktop_Qt_5_3_MinGW_32bit-Debug\include\QtXlsx\QtXlsx D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx
    -$(INSTALL_FILE) F:\Qt-Projects\build-qtxlsx-Desktop_Qt_5_3_MinGW_32bit-Debug\include\QtXlsx\QtXlsxDepends D:$(INSTALL_ROOT)\qt\Qt5.3.2\5.3\mingw482_32\include\QtXlsx

@dbzhang800
Copy link
Owner

FYI,

Source directory in my computer is F:\Qt-Projects\QtXlsxWriter

The build directory for qt5-mingw is F:\Qt-Projects\build-qtxlsx-Desktop_Qt_5_3_MinGW_32bit-Debug

After run the following qmake command in the build directory

qmake -r  -d ..\QtXlsxWriter 2> a.log

I can find following message in the log file.

DEBUG 1: D:/qt/Qt5.3.2/5.3/mingw482_32/mkspecs/features/qt_installs.prf:35: targ_headers.files := xlsxabstractooxmlfile.h xlsxabstractsheet.h xlsxcell.h xlsxcellformula.h xlsxcellrange.h xlsxcellreference.h xlsxchart.h xlsxchartsheet.h xlsxconditionalformatting.h xlsxdatavalidation.h xlsxdocument.h xlsxformat.h xlsxglobal.h xlsxrichstring.h xlsxworkbook.h xlsxworksheet.h ../../../build-qtxlsx-Desktop_Qt_5_3_MinGW_32bit-Debug/include/QtXlsx/qtxlsxversion.h ../../../build-qtxlsx-Desktop_Qt_5_3_MinGW_32bit-Debug/include/QtXlsx/QtXlsx F:/Qt-Projects/build-qtxlsx-Desktop_Qt_5_3_MinGW_32bit-Debug/include/QtXlsx/QtXlsxDepends
DEBUG 1: D:/qt/Qt5.3.2/5.3/mingw482_32/mkspecs/features/qt_installs.prf:36: targ_headers.path := D:/qt/Qt5.3.2/5.3/mingw482_32/include/QtXlsx
DEBUG 1: D:/qt/Qt5.3.2/5.3/mingw482_32/mkspecs/features/qt_installs.prf:37: INSTALLS := dlltarget target class_headers targ_headers

@dbzhang800
Copy link
Owner

Once I open the feature file qt_installs.prf, I found following code

#headers
qt_install_headers {
    targ_headers.files = $$SYNCQT.HEADER_FILES
    targ_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME
    INSTALLS += targ_headers

Which told me that the file name get from a qmake variable call SYNCQT.HEADER_FILES.

We can find the SYNCQT.HEADER_FILES in the generated file F:\Qt-Projects\build-qtxlsx-Desktop_Qt_5_3_MinGW_32bit-Debug\include\QtXlsx\headers.pri :

SYNCQT.HEADER_FILES = xlsxabstractooxmlfile.h xlsxabstractsheet.h xlsxcell.h xlsxcellformula.h xlsxcellrange.h xlsxcellreference.h xlsxchart.h xlsxchartsheet.h xlsxconditionalformatting.h xlsxdatavalidation.h xlsxdocument.h xlsxformat.h xlsxglobal.h xlsxrichstring.h xlsxworkbook.h xlsxworksheet.h ../../../build-qtxlsx-Desktop_Qt_5_3_MinGW_32bit-Debug/include/QtXlsx/qtxlsxversion.h ../../../build-qtxlsx-Desktop_Qt_5_3_MinGW_32bit-Debug/include/QtXlsx/QtXlsx 

And this file is generated by a perl script call syntqt.pl


So, IMO, the issue should be caused by the perl script not properly running.

@zechen11
Copy link

I got the same issue too. It seems that the qmake doesn't call syncqt.pl automatically. So I run syncqt.pl by myself. It will work like this:

perl -w C:\Qt\Qt5.3.2\5.3\mingw482_32\bin\syncqt.pl -module QtXlsx -version 0.3.0

qmake

mingw32-make

mingw32-make install

But "shadow build" like below will not work:

  1. Download source code, then unzip it to a custom directory, such as C:\Qt\QtXlsxWriter
  2. Create an new empty directory for build, such as C:\Qt\QtXlsxWriter-build
  3. In the build directory C:\Qt\QtXlsxWriter-build, run following command:

perl -w C:\Qt\Qt5.3.2\5.3\mingw482_32\bin\syncqt.pl -module QtXlsx -version 0.3.0 -outdir C:\Qt\QtXlsxWriter-build C:\Qt\QtXlsxWriter

qmake C:\Qt\QtXlsxWriter\qtxlsx.pro

mingw32-make

mingw32-make install

Why?

@dbzhang800
Copy link
Owner

Hi all,

I figure out why the syncqt.pl doesn't work for you.
A fake .git directory or file is need by the syncqt.pl script to run. You will get the .git directory when you clone from git, but it doesn't exist in the.zip or .tar.gz source package.

As a woraround one can create an empty .git directory in source tree.

More information can be found in
https://bugreports.qt-project.org/browse/QTBUG-32397

@dbzhang800 dbzhang800 added the bug label Nov 26, 2014
dbzhang800 added a commit that referenced this issue Nov 26, 2014
syncqt.pl won't be called by qmake if .git directory or file doesn't
exist.
We manual set git_build flag here.

Otherwise, syncqt.pl should be called before we release .zip/.tar.gz
package.
@Matumba
Copy link
Author

Matumba commented Dec 1, 2014

Hi, thanks you for your advice to clone your repository from git. Now it's work.

@Matumba Matumba closed this as completed Dec 1, 2014
@Matumba
Copy link
Author

Matumba commented Dec 1, 2014

Sorry, but can you tell my how I can add doc (I did mingw32-make html_docs) to QtCreator?
image

@Matumba Matumba reopened this Dec 1, 2014
@dbzhang800
Copy link
Owner

Hi, make docs instead of make html_docs should be used if you want to generate documentation for QtCreator or Qt Assistant.

@Matumba
Copy link
Author

Matumba commented Dec 1, 2014

Thanks

@Matumba Matumba closed this as completed Dec 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants