thanks! I was able to compile sqlite for the arm architecture. I followed
the directions here:
http://www.sqlite.org/cvstrac/wiki?p=HowToCompile&t=1070624069
but modified it so it looks like this:
unzip sqlite_source.zip
rm tclsqlite.c
for i in *.c; do arm-linux-gcc -O -c $i; done
rm shell.o
ar cr libsqlite.a *.o
ranlib libsqlite.a
arm-linux-gcc -o sqlite shell.c libsqlite.a
Thank you everyone for helping me out with this!!!
On 7/12/06, Christian Smith <[EMAIL PROTECTED]> wrote:
Keiichi McGuire uttered:
> This is a bit confusing, especially since if I compile it using gcc it
will
> compile w/o any problems. What would this "incompatibility" mean and
what
> would a solution be to make it compatible and be found by the compiler?
Chances are that the libsqlite.a you're trying to link against is a host
library, ie. x86 binary.
Compile SQLite from source, using the cross compiler.
>
> On 7/11/06, John Stanton <[EMAIL PROTECTED]> wrote:
>>
>> Now youhave a clean compile,but no sqlite library. It is looking
>> forlibsqlite.so or libsqlite.a. Seems to be finding an libsqlite.awhich
>> is incompatible with yhe object you compiled.
>>
>> Keiichi McGuire wrote:
>> > still no luck:(
>> > and yea I'm still a bit new to C. I have a few years experience in C
>> > during
>> > school, but mainly used for microcontrollers, so I've done a very
little
>> > amount of system applications.
>> >
>> > anyways, with the pointer added to the errMsg, as well as the
-lsqlite
>> > switch, i get the following:
>> >
>> > [EMAIL PROTECTED]:~/dev/c$ arm-linux-gcc test.c -o test6
>> > /tmp/ccSgrZe2.o(.text+0x30): In function `main':
>> > : undefined reference to `sqlite_open'
>> > collect2: ld returned 1 exit status
>> > [EMAIL PROTECTED]:~/dev/c$ arm-linux-gcc test.c -o test6 -lsqlite
>> >
>>
/usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
>> >
>> > s kipping incompatible
>> > /usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/libsqlite. so when
>> > searching for -lsqlite
>> >
>>
/usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
>> >
>> > s kipping incompatible
>> > /usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/libsqlite. a when
>> > searching
>> > for -lsqlite
>> >
>>
/usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
>> >
>> > c annot find -lsqlite
>> > collect2: ld returned 1 exit status
>> >
>> > this is making my brain hurt! :(
>> >
>> >
>> >
>> > On 7/11/06, John Stanton <[EMAIL PROTECTED]> wrote:
>> >
>> >>
>> >> Your program should look more like this -
>> >>
>> >> sqlite *db;
>> >> char *errmsg = NULL; /*Ptr to possible error message.*/
>> >>
>> >> int main() {
>> >> printf("Hello!\n");
>> >> db = sqlite_open("sqlitetest", 0660, &errmsg);
>> >>
>> >> /*At this point if you get an error errmsg will not be null
>> >> and will point to the error message. It will have malloc'd
>> >> memory for that message so you need to "free" it or suffer
>> >> a memory leak.*/
>> >> if (errmsg != NUL) {
>> >> ...
>> >> }
>> >> .....
>> >> }
>> >>
>> >> I guess you are new to C. It will get easier. The first ten years
are
>> >> the hardest.
>> >>
>> >> Keiichi McGuire wrote:
>> >> > Hi John,
>> >> > I still get an error when i use the -lsqlite switch. When i take
that
>> >> > out it
>> >> > says:
>> >> > incompatible types in assignment
>> >> > passing arg 3 of 'sqlite_open' from incompatible pointer type
>> >> >
>> >> > also I wanted to use v.3, but i'm working on a system where the
disk
>> >> space
>> >> > is limited to 64megs, and i actually got the v2 from an ipkg
package,
>> >> and
>> >> > there was an sqlite3 package available, but it was not compatible
>> with
>> >> php
>> >> > that is on this system.
>> >> >
>> >> > -Keiichi
>> >> >
>> >> > On 7/11/06, John Stanton <[EMAIL PROTECTED]> wrote:
>> >> >
>> >> >>
>> >> >> Keiichi McGuire wrote:
>> >> >> > Hi everyone,
>> >> >> > I'm still a bit new to sqlite and also to crosscompiling
programs.
>> >> >> > I've been having problems with being able to compile this test
c
>> >> >> program
>> >> >> > that should just connect to the database.
>> >> >> >
>> >> >> > My program looks like this:
>> >> >> >
>> >> >> > #include<stdio.h>
>> >> >> > #include"sqlite.h>
>> >> >> >
>> >> >> > int main()
>> >> >> > {
>> >> >> >
>> >> >> > printf("Hello!\n");
>> >> >> > sqlite *db;
>> >> >> > char errMsg;
>> >> >> > errMsg = NULL;
>> >> >> >
>> >> >> > db = sqlite_open("sqlitetest",0660,&errMsg);
>> >> >> >
>> >> >> > return 0;
>> >> >> > }
>> >> >> >
>> >> >> >
>> >> >> > and I get the following error:
>> >> >> >
>> >> >> > [EMAIL PROTECTED] dev]# arm-linux-gcc test.c -o test4 -L
>> >> >> > /home/kmcgui/sqlite-arm/.lib
>> >> >> >
>> >> >> > s/ -lsqlite tesc: In function `main':
>> >> >> > test.c:9: warning: assignment makes integer from pointer
without a
>> >> cast
>> >> >> > test.c:11: warning: pabssing arg 3 of qlite_open' from
>> incompatible
>> >> >> pointer
>> >> >> > type
>> >> >> >
>> >> >>
>> >>
>>
/usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3l.3.2/../../../.m-linux/biin/ld:
>> >>
>> >> >>
>> >> >> >
>> >> >> > skipping mpatible /home/kmcgui/sqlite-arm/.flibs//libsqliteso
when
>> >> >> > senarching for
>> >> >> >
>> >> >>
>> >>
>>
>>
-ls/local/armi/3.3.2/lib/gcc-e/usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
>> >>
>> >> >>
>> >> >> >
>> >> >> > skipping incompatible
>> >> >> > /usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/libsqlite.a
when
>> >> >> > searlching
>> >> >> > for -lsqle
>> >> >> >
>> >> >>
>> >>
>>
/usr/local/arm/3.3.2/lib/gcc-lib/arm-linux/3.3.2/../../../../arm-linux/bin/ld:
>> >>
>> >> >>
>> >> >> >
>> >> >> > cannot find -lsqlite
>> >> >> > collect2: ld rxeturned 1 exit s
>> >> >> >
>> >> >> > thank you in advance!!!
>> >> >> >
>> >> >> >
>> >> >> > -Keiichi
>> >> >> >
>> >> >> Try declaring errMsg as a character array rather than a
character,
>> >> >>
>> >> >> char errMsg[256];
>> >> >>
>> >> >> Arg3 3 of sqlite_open is of type char **.
>> >> >>
>> >> >> Note that you are using Sqlite V2. If you are starting a new
>> project
>> >> >> you might find using Sqlite V3 from the beginning a good idea.
>> >> >>
>> >> >
>> >>
>> >>
>> >
>>
>>
>
--
/"\
\ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
X - AGAINST MS ATTACHMENTS
/ \