[GH-ISSUE #433] cannot run on x64 Release in Visual Studio 2022 #337

Closed
opened 2026-05-05 12:10:23 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @SJavad on GitHub (Mar 10, 2024).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/433

I try every step in the installation guide
I built the project with x64 Release
the build was successful but when I ran the .exe file I got this error:
The Application was unable to start correctly (0xc0000007b). Click OK to close the application.

what can I do?

#include "xlsxwriter.h"

int main() {

    /* Create a new workbook and add a worksheet. */
    lxw_workbook* workbook = workbook_new("demo.xlsx");
    lxw_worksheet* worksheet = workbook_add_worksheet(workbook, NULL);

    /* Add a format. */
    lxw_format* format = workbook_add_format(workbook);

    /* Set the bold property for the format */
    format_set_bold(format);

    /* Change the column width for clarity. */
    worksheet_set_column(worksheet, 0, 0, 20, NULL);

    /* Write some simple text. */
    worksheet_write_string(worksheet, 0, 0, "Hello", NULL);

    /* Text with formatting. */
    worksheet_write_string(worksheet, 1, 0, "World", format);

    /* Write some numbers. */
    worksheet_write_number(worksheet, 2, 0, 123, NULL);
    worksheet_write_number(worksheet, 3, 0, 123.456, NULL);

    /* Insert an image. */
    worksheet_insert_image(worksheet, 1, 2, "logo.png");

    workbook_close(workbook);

    return 0;
}
Originally created by @SJavad on GitHub (Mar 10, 2024). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/433 I try every step in the installation guide I built the project with x64 Release the build was successful but when I ran the .exe file I got this error: `The Application was unable to start correctly (0xc0000007b). Click OK to close the application.` what can I do? ```C #include "xlsxwriter.h" int main() { /* Create a new workbook and add a worksheet. */ lxw_workbook* workbook = workbook_new("demo.xlsx"); lxw_worksheet* worksheet = workbook_add_worksheet(workbook, NULL); /* Add a format. */ lxw_format* format = workbook_add_format(workbook); /* Set the bold property for the format */ format_set_bold(format); /* Change the column width for clarity. */ worksheet_set_column(worksheet, 0, 0, 20, NULL); /* Write some simple text. */ worksheet_write_string(worksheet, 0, 0, "Hello", NULL); /* Text with formatting. */ worksheet_write_string(worksheet, 1, 0, "World", format); /* Write some numbers. */ worksheet_write_number(worksheet, 2, 0, 123, NULL); worksheet_write_number(worksheet, 3, 0, 123.456, NULL); /* Insert an image. */ worksheet_insert_image(worksheet, 1, 2, "logo.png"); workbook_close(workbook); return 0; } ```
Author
Owner

@jmcnamara commented on GitHub (Mar 10, 2024):

Some questions/comments:

  1. Which method in the getting started guide did you follow?
  2. That "Application was unable to start correctly (0xc0000007b)" error is often caused by a difference between a 32 bit app and a 64bit system or the other way round. Double check that your compilation target matches your OS.
  3. If you omit the libxlsxwriter parts of the code and turn it into a simple "hello world" program, does it run okay or do you get the same error.
  4. Do you have system permissions to run an exe file from the directory it is created in.

Please answer each of these when you reply.

<!-- gh-comment-id:1987259134 --> @jmcnamara commented on GitHub (Mar 10, 2024): Some questions/comments: 1. Which method in the getting started guide did you follow? 2. That "Application was unable to start correctly (0xc0000007b)" error is often caused by a difference between a 32 bit app and a 64bit system or the other way round. Double check that your compilation target matches your OS. 3. If you omit the libxlsxwriter parts of the code and turn it into a simple "hello world" program, does it run okay or do you get the same error. 4. Do you have system permissions to run an exe file from the directory it is created in. Please answer each of these when you reply.
Author
Owner

@jmcnamara commented on GitHub (Mar 12, 2024):

Any update on this?

<!-- gh-comment-id:1991721806 --> @jmcnamara commented on GitHub (Mar 12, 2024): Any update on this?
Author
Owner

@SJavad commented on GitHub (Mar 24, 2024):

@jmcnamara
1- I try this section Using CMake for Microsoft Visual Studio
2- Yes I do, my compile target and system is x64
3- yeah the program without libxlswriter work's fine
4- yes I Do.

<!-- gh-comment-id:2016716130 --> @SJavad commented on GitHub (Mar 24, 2024): @jmcnamara 1- I try [this](http://libxlsxwriter.github.io/getting_started.html) section **_Using CMake for Microsoft Visual Studio_** 2- Yes I do, my compile target and system is x64 3- yeah the program without libxlswriter work's fine 4- yes I Do.
Author
Owner

@jmcnamara commented on GitHub (Mar 31, 2024):

Could you try the VCPKG method instead: http://libxlsxwriter.github.io/getting_started.html#gsg_vcpkg

<!-- gh-comment-id:2028887316 --> @jmcnamara commented on GitHub (Mar 31, 2024): Could you try the VCPKG method instead: http://libxlsxwriter.github.io/getting_started.html#gsg_vcpkg
Author
Owner

@jmcnamara commented on GitHub (Apr 4, 2024):

Closing as can't replicate.

<!-- gh-comment-id:2036827868 --> @jmcnamara commented on GitHub (Apr 4, 2024): Closing as can't replicate.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#337
No description provided.