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

How-to: Build libxlsxwriter inside Qt-Creator for Windows #270

Closed
petricf opened this issue Jan 21, 2020 · 1 comment
Closed

How-to: Build libxlsxwriter inside Qt-Creator for Windows #270

petricf opened this issue Jan 21, 2020 · 1 comment
Assignees
Labels

Comments

@petricf
Copy link

petricf commented Jan 21, 2020

This guide is dated January 21st, 2020.

Assumptions:

  • Qt is/will be installed to C:\Qt
  • Project directory (location of unpacked zlib and libxlsxwriter) is C:\Projects
  • Install destination of compiled zlib will be C:\Qt\Tools\zlib(32/64)
  • Install destination of compiled libxlsxwriter will be C:\Qt\Tools\xlsxwriter(32/64)

Prerequisites:

  • Installed Qt + Qt-Creator, selected packages:Qt-Installation
  • Downloaded source of zlib (currently zlib1211.zip)
  • Downloaded source of libxlsxwriter

Procedure:

  • Unpack the sources (zlib and libxlsxwriter) to C:\Projects.

  • Start Qt-Creator

  • Create a session for zlib (Menu: File -> Sessions -> Manage ...) and open it

  • Open C:\Projects\zlib-1-2-11\CMakeLists.txt (Menu: File -> Open File or Project). This dialog will appear:zlib-configure1

  • Select both compilers (MinGW 32-bit and 64-bit) and press "Configure Project"

  • At the left navigation bar select "Projects"

  • Change "Edit build configuration to "Release" and adjust the install paths of the 32-bit settings to C:\Qt\Tools\zlib32... :zlib-configure2 Don't forget to press "Apply Configuration Changes".

  • Configure Run settings and add deployment step for 32-bit:zlib-configure3

  • This will be added:zlib-configure4

  • Enable AMD64 switch and adjust install paths of the 64-bit settings to C:\Qt\Tools\zlib64... :zlib-configure5 Verify that the variabled INSTALL_xxx are also adjusted. Select "Apply Configuration Changes" when done.

  • Add the deployment step to the run configuration:zlib-configure6

  • At the left navigation bar select "the run configuration for 64-bit (should be already selected):zlib-run1

  • Run the project (green arrow/triangle at the left navigation bar). This should deploy the 64-bit zlib to C:\Qt\Tools\zlib64.

  • At the left navigation bar select "the run configuration for 32-bit:zlib-run2

  • Run the project (green arrow/triangle at the left navigation bar). This should deploy the 64-bit zlib to C:\Qt\Tools\zlib64.

  • zlib build and deployment is finished now.

  • Create a session for libxlsxwriter (Menu: File -> Sessions -> Manage ...) and open it

  • Open C:\Projects\libxlsxwriter-RELEASE_0.9.3\CMakeLists.txt (Menu: File -> Open File or Project):libxlsxwriter-configure1 Select both compilers (MinGW 32-bit and 64-bit) and press "Configure Project"

  • At the left navigation bar select "Projects" and select "Desktop Qt ... MinGW 32-bit -> Build"

  • Change "Edit build configuration to "Release". Add Directory to zlib root (32-bit version):libxlsxwriter-configure2 Select "Apply Configuration Changes"

  • Adjust options and deployment destination for the 32-bit version of the library: libxlsxwriter-configure3
    libxlsxwriter-configure5
    Select "Apply Configuration Changes"

  • If the path referred in Issue Add option USE_DOUBLE_FUNCTION to CMakeLists #269 is applied the option USE_DOUBLE_FUNCTION is also listed. If you are on a none US locale this should be enabled also.

  • Configure Run settings and add deployment step for 32-bit like done for zlib above

  • At the left navigation bar select "Projects" and select "Desktop Qt ... MinGW 64-bit -> Build"

  • Change "Edit build configuration to "Release". Add Directory to zlib root (64-bit version): libxlsxwriter-configure4 Select "Apply Configuration Changes"

  • Adjust options and deployment destination for the 64-bit version of the library: libxlsxwriter-configure5 Select "Apply Configuration Changes"

  • If the path referred in Issue Add option USE_DOUBLE_FUNCTION to CMakeLists #269 is applied the option USE_DOUBLE_FUNCTION is also listed. If you are on a none US locale this should be enabled also.

  • Configure Run settings and add deployment step for 64-bit like done for zlib above

  • select the 32-bit run configuration like done for zlib above.

  • Run the project (green arrow/triangle at the left navigation bar). This should deploy the 32-bit libxlsxwriter to C:\Qt\Tools\xlsxwriter32. A dialog pops up asking for run parameters. cancel it.

  • select the 64-bit run configuration like done for zlib above.

  • Run the project (green arrow/triangle at the left navigation bar). This should deploy the 64-bit libxlsxwriter to C:\Qt\Tools\xlsxwriter64. A dialog pops up asking for run parameters. cancel it.

libxlsxwriter build and deployment is finished now.

zlib is now deployed to C:\Qt\Tools\zlib32 and C:\Qt\Tools\zlib64
libxlsxwriter is now deployed to C:\Qt\Tools\xlsxwriter32 and C:\Qt\Tools\xlsxwriter64

Use ...32 for 32-bit applications and ...64 for 64-bit applications.

@jmcnamara jmcnamara self-assigned this Jan 21, 2020
@jmcnamara jmcnamara added the docs label Jan 21, 2020
@jmcnamara jmcnamara changed the title Build libxlsxwriter inside Qt-Creator for Windows (MinGW 32 and 64 Bit) How-to: Build libxlsxwriter inside Qt-Creator for Windows Jan 21, 2020
@jmcnamara
Copy link
Owner

I've added a link to your QT guide from the libxlsxwriter docs: https://libxlsxwriter.github.io/getting_started.html#gsg_qt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants