Re: [sqlite] undefined reference to `sqlite3_open'

2007-07-21 Thread MaaSTaaR

Thanks all,

it's work fine now :)

On 7/19/07, John Stanton <[EMAIL PROTECTED]> wrote:


You don't seem to have the sqlite3 link library in your compile and link
command.

MaaSTaaR wrote:
> Hello ...
>
> firstly, sorry for my bad English.
>
> i am using SQLite with C under Linux, i wrote small file which use
Glade,
> GTK and SQLite, but i have problem with SQLite.
>
> this is the command which i used to compile the file : "gcc `pkg-config
> --libs --cflags gtk+-2.0 libglade-2.0 sqlite` -o main main.c"
>
> these the problems :
> /tmp/ccxN97zv.o: In function `main':main.c:(.text+0x53): undefined
> reference
> to `sqlite3_open'
> :main.c:(.text+0x161): undefined reference to `sqlite3_close'
> collect2: ld returned 1 exit status
>
> finally this is my code :
>
> #include 
> #include 
> #include 
> #include 
>
> void start(GtkWidget *b,GtkWidget *t)
> {
>const gchar *text;
>
>text = gtk_entry_get_text(GTK_ENTRY(t));
> }
>
> int main(int argc, char *argv[])
> {
>GladeXML *ui;
>GtkWidget *w,*t,*b;
>sqlite3 *db;
>int rc;
>
>rc = sqlite3_open("./db/def.db",);
>
>gtk_init(,);
>ui = glade_xml_new("./gui/main.glade",NULL,NULL);
>
>w = glade_xml_get_widget(ui,"window1");
>
>
g_signal_connect(G_OBJECT(w),"delete-event",G_CALLBACK(gtk_main_quit),NULL);
>
>
>t = glade_xml_get_widget(ui,"word"); // This is label
>
>b = glade_xml_get_widget(ui,"start"); // This is button

>g_signal_connect(G_OBJECT(b),"clicked",G_CALLBACK(start),(gpointer)t);
>
>gtk_main();
>
>sqlite3_close(db);
> }
>
>
> what is this error and how to solve it?
>



-
To unsubscribe, send email to [EMAIL PROTECTED]

-




Re: [sqlite] undefined reference to `sqlite3_open'

2007-07-19 Thread John Stanton
You don't seem to have the sqlite3 link library in your compile and link 
command.


MaaSTaaR wrote:

Hello ...

firstly, sorry for my bad English.

i am using SQLite with C under Linux, i wrote small file which use Glade,
GTK and SQLite, but i have problem with SQLite.

this is the command which i used to compile the file : "gcc `pkg-config
--libs --cflags gtk+-2.0 libglade-2.0 sqlite` -o main main.c"

these the problems :
/tmp/ccxN97zv.o: In function `main':main.c:(.text+0x53): undefined 
reference

to `sqlite3_open'
:main.c:(.text+0x161): undefined reference to `sqlite3_close'
collect2: ld returned 1 exit status

finally this is my code :

#include 
#include 
#include 
#include 

void start(GtkWidget *b,GtkWidget *t)
{
   const gchar *text;

   text = gtk_entry_get_text(GTK_ENTRY(t));
}

int main(int argc, char *argv[])
{
   GladeXML *ui;
   GtkWidget *w,*t,*b;
   sqlite3 *db;
   int rc;

   rc = sqlite3_open("./db/def.db",);

   gtk_init(,);
   ui = glade_xml_new("./gui/main.glade",NULL,NULL);

   w = glade_xml_get_widget(ui,"window1");

g_signal_connect(G_OBJECT(w),"delete-event",G_CALLBACK(gtk_main_quit),NULL); 



   t = glade_xml_get_widget(ui,"word"); // This is label

   b = glade_xml_get_widget(ui,"start"); // This is button
   g_signal_connect(G_OBJECT(b),"clicked",G_CALLBACK(start),(gpointer)t);

   gtk_main();

   sqlite3_close(db);
}


what is this error and how to solve it?




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] undefined reference to `sqlite3_open'

2007-07-19 Thread drh
MaaSTaaR <[EMAIL PROTECTED]> wrote:
> Hello ...
> 
> firstly, sorry for my bad English.
> 
> i am using SQLite with C under Linux, i wrote small file which use Glade,
> GTK and SQLite, but i have problem with SQLite.
> 
> this is the command which i used to compile the file : "gcc `pkg-config
> --libs --cflags gtk+-2.0 libglade-2.0 sqlite` -o main main.c"
> 
> these the problems :
> /tmp/ccxN97zv.o: In function `main':main.c:(.text+0x53): undefined reference
> to `sqlite3_open'
> :main.c:(.text+0x161): undefined reference to `sqlite3_close'
> collect2: ld returned 1 exit status
> 
> 
> what is this error and how to solve it?

My guess:  Say "sqlite3" instead of "sqlite" in your pkg-config.

"sqlite" usually refers to the older SQLite version 2 library
whereas you are using the newer SQLite version 3 APIs.  The
usual naming convention for SQLite version 3 is "sqlite3".  But
I know nothing about pkg-config so this is only a guess.

--
D. Richard Hipp <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] undefined reference to `sqlite3_open'

2007-07-19 Thread Dan Kennedy
On Thu, 2007-07-19 at 12:52 +0300, MaaSTaaR wrote:
> Hello ...
> 
> firstly, sorry for my bad English.
> 
> i am using SQLite with C under Linux, i wrote small file which use Glade,
> GTK and SQLite, but i have problem with SQLite.
> 
> this is the command which i used to compile the file : "gcc `pkg-config
> --libs --cflags gtk+-2.0 libglade-2.0 sqlite` -o main main.c"


"sqlite" is version 2. Specify "sqlite3" instead. 

  [EMAIL PROTECTED]:~> pkg-config --libs sqlite
  -lsqlite  
  [EMAIL PROTECTED]:~> pkg-config --libs sqlite3
  -lsqlite3  

Dan.


> 
> these the problems :
> /tmp/ccxN97zv.o: In function `main':main.c:(.text+0x53): undefined reference
> to `sqlite3_open'
> :main.c:(.text+0x161): undefined reference to `sqlite3_close'
> collect2: ld returned 1 exit status
> 
> finally this is my code :
> 
> #include 
> #include 
> #include 
> #include 
> 
> void start(GtkWidget *b,GtkWidget *t)
> {
> const gchar *text;
> 
> text = gtk_entry_get_text(GTK_ENTRY(t));
> }
> 
> int main(int argc, char *argv[])
> {
> GladeXML *ui;
> GtkWidget *w,*t,*b;
> sqlite3 *db;
> int rc;
> 
> rc = sqlite3_open("./db/def.db",);
> 
> gtk_init(,);
> ui = glade_xml_new("./gui/main.glade",NULL,NULL);
> 
> w = glade_xml_get_widget(ui,"window1");
> 
> g_signal_connect(G_OBJECT(w),"delete-event",G_CALLBACK(gtk_main_quit),NULL);
> 
> t = glade_xml_get_widget(ui,"word"); // This is label
> 
> b = glade_xml_get_widget(ui,"start"); // This is button
> g_signal_connect(G_OBJECT(b),"clicked",G_CALLBACK(start),(gpointer)t);
> 
> gtk_main();
> 
> sqlite3_close(db);
> }
> 
> 
> what is this error and how to solve it?


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] undefined reference to `sqlite3_open'

2007-07-19 Thread MaaSTaaR

Hello ...

firstly, sorry for my bad English.

i am using SQLite with C under Linux, i wrote small file which use Glade,
GTK and SQLite, but i have problem with SQLite.

this is the command which i used to compile the file : "gcc `pkg-config
--libs --cflags gtk+-2.0 libglade-2.0 sqlite` -o main main.c"

these the problems :
/tmp/ccxN97zv.o: In function `main':main.c:(.text+0x53): undefined reference
to `sqlite3_open'
:main.c:(.text+0x161): undefined reference to `sqlite3_close'
collect2: ld returned 1 exit status

finally this is my code :

#include 
#include 
#include 
#include 

void start(GtkWidget *b,GtkWidget *t)
{
   const gchar *text;

   text = gtk_entry_get_text(GTK_ENTRY(t));
}

int main(int argc, char *argv[])
{
   GladeXML *ui;
   GtkWidget *w,*t,*b;
   sqlite3 *db;
   int rc;

   rc = sqlite3_open("./db/def.db",);

   gtk_init(,);
   ui = glade_xml_new("./gui/main.glade",NULL,NULL);

   w = glade_xml_get_widget(ui,"window1");

g_signal_connect(G_OBJECT(w),"delete-event",G_CALLBACK(gtk_main_quit),NULL);

   t = glade_xml_get_widget(ui,"word"); // This is label

   b = glade_xml_get_widget(ui,"start"); // This is button
   g_signal_connect(G_OBJECT(b),"clicked",G_CALLBACK(start),(gpointer)t);

   gtk_main();

   sqlite3_close(db);
}


what is this error and how to solve it?