brechtsanders / xlsxio

XLSX I/O - C library for reading and writing .xlsx files
MIT License
420 stars 113 forks source link

unresolved external symbol __imp_xlsxioread_sheet_next_cell #37

Closed ghost closed 5 years ago

ghost commented 5 years ago

When I run the example, I always come across the error "unresolved external symbol imp_xlsxioread_sheet_next_cell", "imp_xlsxioread_sheet_open". But I cannot find these symbol ?

brechtsanders commented 5 years ago

Is this using the MinGW compiler? Did you link with the library? If you link with the static library, try defining BUILD_XLSXIO_STATIC (e.g. using compiler flag -DBUILD_XLSXIO_STATIC).

ghost commented 5 years ago

Yes, I use MinGW. But I don't understand what I should do. How to use the BUILD_XLSXIO_STATIC? Could you explain more?

brechtsanders commented 5 years ago

Did you build using CMake? Have you tried linking with libxlsxio_read.dll.a instead of libxlsxio_read.a? The _imp prefix in your errors indicate you are using the shared library header, so you must then also use the shared library when linking. Alternatively you can compile your application with -DSTATIC (or -DBUILD_XLSXIO_STATIC) and link with libxlsxio_read.a and all of the dependancies. But don't mix the two or you will get the errors you got.