Open fengcai opened 5 years ago
What's the error? Any chance you can debug?
Just tried your code with MinGW on Windows and it works perfectly. No crashes or errors.
VC project zip file xlsxio.zip
project settings: error prompt
error information: The procedure entry point xlsxiowrite_add_cell_int could not be located in the dynamic library libxlsxio_read.dll
if the source code only contains read or wirte function, it's working well.
another issue for the test is I have to comment out the free(vlaue) as follows or it will crash
while ((value = xlsxioread_sheet_next_cell(sheet)) != NULL) {
printf("%s\t", value);
//free(value);
}
hi, I find it is same as #38 and I solved it by lib created manually.
but the free-cause crash is still there in read function
while ((value = xlsxioread_sheet_next_cell(sheet)) != NULL) {
printf("%s\t", value);
//free(value); // heap issue
}
callstack is
> msvcr110d.dll!_CrtIsValidHeapPointer(const void * pUserData) Line 2036 C++
msvcr110d.dll!_free_dbg_nolock(void * pUserData, int nBlockUse) Line 1322 C++
msvcr110d.dll!_free_dbg(void * pUserData, int nBlockUse) Line 1265 C++
msvcr110d.dll!free(void * pUserData) Line 49 C++
xlsx.exe!read_xlsx() Line 59 C++
I just changed CMakeLists.txt so it also generates .def files when building with MinGW. In the next release the .def files will be included, allowing you to create proper .lib files for MSVC. What version of XLSX I/O did you use when you got the free-cause crash?
The code you posted earlier doesn't have read_xlsx() on line 59. Can you attach the actual file that you were debugging?
Also, can you try with version 0.2.21, which was just released? The binary packages for Windows now also include .def files and README.md explains how to make .lib files from them for use with MSVC.
vc 2012 project: xlsxio-0.2.21-win32.zip I have tested the latest 0.2.21, crash as picture attached VC2012 Win7
The free()
seems to be the same as in #73
Can you you try again with version 0.2.29 using xlsxioread_free()
instead of free()
?
Thanks for letting me know if the issue is resolved now.
I wirte one test.exe agains libxlsxio dll, it's working well respectively on libxlsxio_read.dll and libxlsxio_write.dll but if I combine write and read in one application, error will report
environment windows 7 vc2012 lib: libxlsxio_read.dll.a/libxlsxio_write.dll.a
sample code: