brechtsanders / xlsxio

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

cannot open shared object file #106

Closed riztan closed 2 years ago

riztan commented 2 years ago

Hi, after compiling some of the examples and trying to run the binary, I get this error:

"error while loading shared libraries: libxlsxio_read.so: cannot open shared object file: No such file or directory"

The library is in "/usr/local/lib/" and should be within reach of the binary.

I can't get it to work, could you tell me how to compile the example?

I am compiling on Ubuntu Mate 16.04.

Thanks

riztan commented 2 years ago

I created a symbolic link in /usr/lib and it worked.

Sorry for the inconvenience.

brechtsanders commented 2 years ago

A symbolic link like that sounds like a dirty solution. It's better to use -L linker flags and -I compiler flags to point to any libraries your program needs.

Or even better: install XLSX I/O to the location where want it to be installed (using make PREFIX=/usr/lib or cmake flag -DCMAKE_INSTALL_PREFIX:PATH=/usr/lib).