Hi
 
I have cross-compiled the sqlite library for use on Linux running on MIPS by
basically doing the following (which I gleaned from the documentation and
other posts on this mailing list):
 
1) Running 'configure' for the host.
2) Running 'make target_source' to create the sub-directory 'tsrc'.
3) Removing 'shell.c', 'tclsqlite.c', 'icu.c' and 'fts*'.
4) Compiling using the following makefile:
 
AR=/opt/hardhat/devkit/mips/fp_le/bin/mips_fp_le-ar
GCC=/opt/hardhat/devkit/mips/fp_le/bin/mips_fp_le-gcc
STRIP=/opt/hardhat/devkit/mips/fp_le/bin/mips_fp_le-strip

all:
 for i in *.c; do $(GCC) -c $$i; done
 
 $(AR) r libsqlite3.a *.o
 
 $(STRIP) libsqlite3.a --strip-all 
 
 $(GCC) -o libsqlite3.so -shared -static *.c
 $(STRIP) libsqlite3.so --strip-all 
 

# end of file
 
This appears to run fine and creates a static and shared library. However
the problem I have is that if I run the makefile for my own application I
get 'undefined reference' errors if I link to the static library e.g
'undefined reference to sqlite3_open'. If I link to the shared library then
my makefile runs without errors and my application uses sqlite as intended.
I am new to Linux so forgive me if there's something obvious I am missing. I
know that the 'for' loop in the makefile above has an extra '$' compared to
the examples I have seen but this seemed to be the only way to get it to
reference the source files correctly.
 
Can anyone offer any suggestions as I would like to use the static library?
 
Thanks
 
Chris 
    

Reply via email to