Now youhave a clean compile,but no sqlite library. It is looking forlibsqlite.so or libsqlite.a. Seems to be finding an libsqlite.a which 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.
>>
>




Reply via email to