cannot run on x64 Release in Visual Studio 2022
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;
}
Some questions/comments:
- Which method in the getting started guide did you follow?
- 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.
- 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.
- 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.
Any update on this?
@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.
Could you try the VCPKG method instead: http://libxlsxwriter.github.io/getting_started.html#gsg_vcpkg
Closing as can't replicate.