-------------------------------------------------------
/ccrblidm.o:in function ' main ':
CREATETABLE.C: (. text+0x66): Undefined reference to ' sqlite_close '
CREATETABLE.C: (. text+0x131): Undefined reference to ' sqlite_close '
It should be sqlite3_close.
--------------------------------------------------------
sql = "CREATE TABLE Company" \
"ID INT PRIMARY KEY not NULL," \
"NAME TEXT not NULL," \
"Age INT is not NULL," \
"ADDRESS CHAR (50)," \
"SALARY REAL");
There's a missing one behind this.
______________________________________________________________
fprintf (stdout, "Open database ok! ok!");
fprintf (stdout, "Table create OK \ n");
[Email protected]:~/sqlite_c#./createtable
Open Database ok! Ok! Table Create OK
fprintf (stdout, "Open database ok! ok!"); In the case of not adding \ n
fprintf (stderr, "SQL ERROR:%s \ n", Sqlite3_errmsg (DB1));
fprintf (stderr, "SQL ERROR:%s \ n", zerrmsg);
[Email protected]:~/sqlite_c#./createtable
SQL Error:table Company already exists
SQL Error:table Company already exists
Open Database ok! Ok!
Description: "Open database ok! Ok! "Output from the buffer to stdout at the end of the process
_______________________________________________________________________________
Make it good, you can compile it, it comes out of nowhere.
[Email protected]:~/sqlite_c#
[Email protected]:~/sqlite_c#
[Email protected]:~/sqlite_c# gcc-o gettable gettable.c-l SQLite
/usr/bin/ld:cannot Find-lsqlite
Collect2:error:ld returned 1 exit status
Why is it all of a sudden??
::: Turns out to be so, to forget to write this 3-lsqlite3
SQLITE-C Programming-error-