SQLITE-C Programming-error-

Source: Internet
Author: User
Tags sql error sqlite

-------------------------------------------------------

/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-

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.