Newbie Question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Newbie Question

JohnD-2
Hello,

I'm new to Sqlite and am trying to create a simple C/C++ program.  I've
downloaded both the binary and the CVS source but can't seem to locate
the sqlite3.h header file.

Is there any document that details what I need to do in order to set up
an environment to be able to write and compile my own C/C++ programs on
either Windows or Linux?

Thanks,
John

Reply | Threaded
Open this post in threaded view
|

Re: Newbie Question

Robert L Cochran
I think sqlite3.h is generated for you automatically as part of the
build process from source code and it will be later installed for you in
the include directory. You must actually compile sqlite from the source
code.

For Linux, why not just download sqlite-3.2.7.tar.gz (the linux source
code), untar it, and build from that?

wget http://www.sqlite.org/sqlite-3.2.7.tar.gz
tar -xvzf sqlite-3.2.7.tar.gz
cd sqlite-3.2.7
mkdir bld
cd !$
../configure --enable-utf8 --includedir=/usr/include
[fix any errors...you might need to install the readline development
package, etc...if you get an error, fix it, then rerun ./configure...]
make
[fix any errors if make doesn't finish successfully. Warnings about
signedness differences under gcc4 are okay.]
su
make install
exit
su -
ldconfig
exit

At this point you should be ready to build your own C/C++ programs that
include sqlite3. You'll see the sqlite files in /usr/local/include if
you compiled with the default installation path options.

Bob Cochran
Greenbelt, Maryland, USA


JohnD wrote:

> Hello,
>
> I'm new to Sqlite and am trying to create a simple C/C++ program.  
> I've downloaded both the binary and the CVS source but can't seem to
> locate the sqlite3.h header file.
>
> Is there any document that details what I need to do in order to set
> up an environment to be able to write and compile my own C/C++
> programs on either Windows or Linux?
>
> Thanks,
> John
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Newbie Question

Robert L Cochran
Compiling the CVS checkout is really the same -- just cd into the
'sqlite' directory and follow the instructions below from the 'mkdir'
onwards.

Bob


Robert L Cochran wrote:

> I think sqlite3.h is generated for you automatically as part of the
> build process from source code and it will be later installed for you
> in the include directory. You must actually compile sqlite from the
> source code.
>
> For Linux, why not just download sqlite-3.2.7.tar.gz (the linux source
> code), untar it, and build from that?
>
> wget http://www.sqlite.org/sqlite-3.2.7.tar.gz
> tar -xvzf sqlite-3.2.7.tar.gz
> cd sqlite-3.2.7
> mkdir bld
> cd !$
> ../configure --enable-utf8 --includedir=/usr/include
> [fix any errors...you might need to install the readline development
> package, etc...if you get an error, fix it, then rerun ./configure...]
> make
> [fix any errors if make doesn't finish successfully. Warnings about
> signedness differences under gcc4 are okay.]
> su
> make install
> exit
> su -
> ldconfig
> exit
>
> At this point you should be ready to build your own C/C++ programs
> that include sqlite3. You'll see the sqlite files in
> /usr/local/include if you compiled with the default installation path
> options.
>
> Bob Cochran
> Greenbelt, Maryland, USA
>
>
> JohnD wrote:
>
>> Hello,
>>
>> I'm new to Sqlite and am trying to create a simple C/C++ program.  
>> I've downloaded both the binary and the CVS source but can't seem to
>> locate the sqlite3.h header file.
>>
>> Is there any document that details what I need to do in order to set
>> up an environment to be able to write and compile my own C/C++
>> programs on either Windows or Linux?
>>
>> Thanks,
>> John
>>
>>
>>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Newbie Question

JohnD-2
In reply to this post by Robert L Cochran
Bob,

Thanks for the information.  Are the required dependencies for Sqlite
listed anywhere?  I'm unable to compile on Linux and it appears as
though I'm missing a dependency or two.  Any idea where I can check those?

Thanks,
John

Robert L Cochran wrote:

> I think sqlite3.h is generated for you automatically as part of the
> build process from source code and it will be later installed for you
> in the include directory. You must actually compile sqlite from the
> source code.
>
> For Linux, why not just download sqlite-3.2.7.tar.gz (the linux source
> code), untar it, and build from that?
>
> wget http://www.sqlite.org/sqlite-3.2.7.tar.gz
> tar -xvzf sqlite-3.2.7.tar.gz
> cd sqlite-3.2.7
> mkdir bld
> cd !$
> ../configure --enable-utf8 --includedir=/usr/include
> [fix any errors...you might need to install the readline development
> package, etc...if you get an error, fix it, then rerun ./configure...]
> make
> [fix any errors if make doesn't finish successfully. Warnings about
> signedness differences under gcc4 are okay.]
> su
> make install
> exit
> su -
> ldconfig
> exit
>
> At this point you should be ready to build your own C/C++ programs
> that include sqlite3. You'll see the sqlite files in
> /usr/local/include if you compiled with the default installation path
> options.
>
> Bob Cochran
> Greenbelt, Maryland, USA
>
>
> JohnD wrote:
>
>> Hello,
>>
>> I'm new to Sqlite and am trying to create a simple C/C++ program.  
>> I've downloaded both the binary and the CVS source but can't seem to
>> locate the sqlite3.h header file.
>>
>> Is there any document that details what I need to do in order to set
>> up an environment to be able to write and compile my own C/C++
>> programs on either Windows or Linux?
>>

Reply | Threaded
Open this post in threaded view
|

Re: Newbie Question

Robert L Cochran
Post the error messages and someone will help you. I'll also check for
messages after work tonight. There are others on this forum who are far
more knowledgable than I.


Bob

JohnD wrote:

> Bob,
>
> Thanks for the information.  Are the required dependencies for Sqlite
> listed anywhere?  I'm unable to compile on Linux and it appears as
> though I'm missing a dependency or two.  Any idea where I can check
> those?
>
> Thanks,
> John
>
> Robert L Cochran wrote:
>
>> I think sqlite3.h is generated for you automatically as part of the
>> build process from source code and it will be later installed for you
>> in the include directory. You must actually compile sqlite from the
>> source code.
>>
>> For Linux, why not just download sqlite-3.2.7.tar.gz (the linux
>> source code), untar it, and build from that?
>>
>> wget http://www.sqlite.org/sqlite-3.2.7.tar.gz
>> tar -xvzf sqlite-3.2.7.tar.gz
>> cd sqlite-3.2.7
>> mkdir bld
>> cd !$
>> ../configure --enable-utf8 --includedir=/usr/include
>> [fix any errors...you might need to install the readline development
>> package, etc...if you get an error, fix it, then rerun ./configure...]
>> make
>> [fix any errors if make doesn't finish successfully. Warnings about
>> signedness differences under gcc4 are okay.]
>> su
>> make install
>> exit
>> su -
>> ldconfig
>> exit
>>
>> At this point you should be ready to build your own C/C++ programs
>> that include sqlite3. You'll see the sqlite files in
>> /usr/local/include if you compiled with the default installation path
>> options.
>>
>> Bob Cochran
>> Greenbelt, Maryland, USA
>>
>>
>> JohnD wrote:
>>
>>> Hello,
>>>
>>> I'm new to Sqlite and am trying to create a simple C/C++ program.  
>>> I've downloaded both the binary and the CVS source but can't seem to
>>> locate the sqlite3.h header file.
>>>
>>> Is there any document that details what I need to do in order to set
>>> up an environment to be able to write and compile my own C/C++
>>> programs on either Windows or Linux?
>>>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Newbie Question

JohnD-2
Bob,

I was able to compile on Linux after removing tclsqlite.c from the
build.  It appears as though that was causing my errors.  Once I removed
that, by changing

HAVE_TCL = 1
to
HAVE_TCL =

It compiled without errors.  I found this in another thread which
indicated, to me at least, that it  wouldn't be needed unless I wanted
to use the TCL shell, which I don't.

Thanks,
John

Robert L Cochran wrote:

> Post the error messages and someone will help you. I'll also check for
> messages after work tonight. There are others on this forum who are
> far more knowledgable than I.


Reply | Threaded
Open this post in threaded view
|

Re: Newbie Question

Robert L Cochran
John,

The configure script is looking for the location of a file named
tclConfig.sh. On Fedora Core 4, that file is provided when you install
the tcl-devel package.

Here is the ../configure incantation (taken from ../configure --help):

--with-tcl=DIR          directory containing tcl configuration
(tclConfig.sh)

alternatively, you could compile with this:

--disable-tcl

You may want to recompile with the --disable-tcl option.

If you decide to install the tcl-devel package, you can also recompile
SQLite and point it at the directory that has tclConfig.sh.

Bob

JohnD wrote:

> Bob,
>
> I was able to compile on Linux after removing tclsqlite.c from the
> build.  It appears as though that was causing my errors.  Once I
> removed that, by changing
>
> HAVE_TCL = 1
> to
> HAVE_TCL =
>
> It compiled without errors.  I found this in another thread which
> indicated, to me at least, that it  wouldn't be needed unless I wanted
> to use the TCL shell, which I don't.
>
> Thanks,
> John
>
> Robert L Cochran wrote:
>
>> Post the error messages and someone will help you. I'll also check
>> for messages after work tonight. There are others on this forum who
>> are far more knowledgable than I.
>
>
>
>
>