libxlsxwriter icon indicating copy to clipboard operation
libxlsxwriter copied to clipboard

cannot run on x64 Release in Visual Studio 2022

Open SJavad opened this issue 2 years ago • 2 comments

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;
}

SJavad avatar Mar 10 '24 12:03 SJavad

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.

jmcnamara avatar Mar 10 '24 14:03 jmcnamara

Any update on this?

jmcnamara avatar Mar 12 '24 14:03 jmcnamara

@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.

SJavad avatar Mar 24 '24 07:03 SJavad

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

jmcnamara avatar Mar 31 '24 19:03 jmcnamara

Closing as can't replicate.

jmcnamara avatar Apr 04 '24 10:04 jmcnamara