简体   繁体   中英

Finding SQLite version linked to a binary in Linux

I have a software package which is using sqlite library. For this purpose, I link the sqlite.a with the final object file to create the final package/binary.

Is there way through which once a binary is created, it can be confirmed which version of SQLite has been linked with that binary? I ask this because I have multiple version of SQLite on my build environment (3.6.20, 3.7.7.1). I have observed an issue in one of the executing binary and I don't know which version of library I had used to make that binary.

This is a linux (CentOS5) environment I am working on.

Thanks in advance for any help.

You can tell the binary itself to log or declare what version of SQLite it's using. The binary knows this at compile time from the SQLite defines. Since the linking is static, the version built against is the same as the version used.

You might be able to find the version that the library was compiled against by doing something like strings./foo | grep "3\.[67]\.". strings./foo | grep "3\.[67]\.". Unfortunately, if you didn't use any of the functions from sqlite that would output this string in your code (like sqlite3_libversion() ), they might not have been copied over by the linker and might not be present.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM