Skip to main content

Integration of SQLite3 and Netbeans C/C++ IDE

Few days back, I wanted to use SQLite database for one of my project. I spend couple of hours to find a way to integrate with Netbeans. Maybe many of us will be clever enough to just follow the information given on SQLite website to accomplish this task, but people like me can follow this blog post :)
I am using Netbeans C/C++ IDE ver. 7.1.2 and SQLite ver. 3.7.13 and Windows 7 OS.

Download links for:
I hope, all above files are being downloaded in one folder for future use or give away to others :P

Installation Procedure:
Installation of Cygwin, Netbeans, and SQLite Database browser is straight forward, hopefully for everyone. But in order to install SQLite source code that we downloaded before, need procedure given below.

Compile SQLite using Cygwin:
Open Cygwin Terminal, then;
  1. Locate Z:\Cygwin\home\your_name. 'Z' is the drive name where Cygwin is installed, and 'your_name' is YOUR NAME :P.
  2. Copy source code file 'sqlite-autoconf-3071300.tar.gz' to directory mentioned in point 1.
  3. Start Cygwin.
  4. Enter into Z:\Cygwin\home\your_name. By default, Cygwin terminal is in home\your_name directory. You can check using 'pwd' command, if response is negative then use 'cd' to change directory.
  5. tar -xzvf sqlite-autoconf-3071300.tar.gz (To unzip)
  6. Enter sqlite-autoconf-3071300, e.g. cd sqlite-autoconf-3071300. Then
  7. ./configure
  8. make
  9. make install
Great, we compiled the SQLite, but what we are interested in are two library files which are located in C:\cygwin\usr\local\lib, and SQLite3 Header file located in C:\cygwin\usr\local\include. These header and library files will be used in linking Netbeans project with SQLite database;
  • sqlite3.h
  • libsqlite3.a
  • libsqlite3.dll.a
Include Header and Library files in Netbeans:
  • Include header file; #include <sqlite3.h>
  • Go to project settings of your Netbeans project. Then 'build->linker->libraries', and give reference to above two libraries.
And we are done here, now we can write queries and access database using C/C++ code.

Popular posts from this blog

SESC Simulator: First Time Installation

Note: I am using LINUX with following specifications, g++ (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1.

SESC: Cycle Accurate Architectural Simulator is the official website for SESC Simulator which contains; documentation, SescUtils Package informaiton.

Downloading SESC:
To download pre-compiled binaries of SESC Simulator, use the following instructions in LINUX Shell.
> sudo cvs login (When password is requested, just press enter) > cvs -z3 co -P sesc (By default, ‘sesc’ folder will be checked out in home folder)Requirements:
Be sure that flex and bison is already installed > sudo apt-get install zlib1g-dev Building SESC:
Make new directory ‘build’ in ‘sesc’ folder;
Simulator can be configured as many set of operations, so recommendation is to create different ‘build’ directory for each configuration.
> mkdir build
> cd build

Configuring SESC:
SESC provides dif…

SESC: Splash2 Benchmark Kernels & Applications Package

SPLASH -- "Stanford Parallel Applications for Shared Memory"
Splash benchmark suite, developed by group of people working in Stanford University, contains kernels and applications  for multiprocessor systems performance check.
Kernels: Complex 1D FFT Blocked LU Decomposition Blocked Sparse Cholesky Factorization Integer Radix Sort
Applications: Barnes-Hut Adaptive Fast Multipole Ocean Simulation Hierarchical Radiosity Ray Tracer Volume Renderer Water Simulation with Spatial Data Structure Water Simulation without Spatial Data Structure
Download Splash2 Package: > cd ~/benchmarks > mkdir splash2 > cd splash2 > wget > tar -xzf splash2.tar.gz
For sure after downloading Splash2 benchmark files, you need to compile it too in order to use for your work and for further development purposes. If you need Pre-compiled Binaries of Splash2 benchmark, you can write me Email or from my GoogleDrive. You can check this pag…