Bala
Bala

Reputation: 29

How do I build sqlite with static library also be compiled with -fPIC?

I have compiled using below parameters

#./configure --prefix=/usr/local CFLAGS=-fPIC --enable-static --enable-shared   \
            CFLAGS="-g -O2 -DSQLITE_ENABLE_FTS3=1 \
            -DSQLITE_ENABLE_COLUMN_METADATA=1     \
            -DSQLITE_ENABLE_UNLOCK_NOTIFY=1       \
            -DSQLITE_SECURE_DELETE=1              \
            -DSQLITE_ENABLE_DBSTAT_VTAB=1"
# make -j 8
# make install

After using sqlite I get below error message:

/usr/bin/g++ -o utools/utools.so -Wl,-Bsymbolic -g -O2 -shared -Wl,-z,defs utools/utools.plugin.o utools/lib/libutools.a core/lib/libunv.a fv/lib/libfv.a sb/lib/libsb.a -lz -ldl
/usr/bin/ld: /usr/local/sqlite/lib/libsqlite3.a(sqlite3.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/sqlite/lib/libsqlite3.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
scons: *** [stdarm/stdarm.so] Error 1
scons: building terminated because of errors.

Upvotes: 1

Views: 4006

Answers (1)

Swain
Swain

Reputation: 31

inside /usr/local/lib/ directory, deleting following files worked for me

  • libsqlite3.a
  • libsqlite3.la
  • libsqlite3.o.0.bak
  • libsqlite3.so

I think these files are from the older versions of libsqlite3, because when you type and check dpkg -L libsqlite3-dev, none goes to /usr/local/lib/

I took the reference from sqlite3 breakage

Upvotes: 3

Related Questions