Actually I'm doing a portable program which can be executed in any windows platform without any installation. Do you have any suggestions for portable database which can be connected to c++?? Currently I'm working on sqlite. But its kind of complicated.
That you forgot to link to the required library. It means that the code compiles fine (there are no syntax error in the code) but when the linker tries to assemble everything together, it can't find some specific functions, because you didn't specify the library from which they are coming from.
Look again at this article[^]. The "Working With SQLite" section gives you instructions for how to build an import library (.LIB file) for the SQLite 3 DLL. To use it, add a line like this to your main C++ file:
#pragma comment(lib, "sqlite.lib")
This will cause the linker to look in SQLite.lib for the SQLite functions.
Use a MAKE file to direct the linker to search for functions in that particular
library(.lib) is a more portable way I think, since this directive would be unknown with some compilers other than Microsoft's.
This page[^] gives an example of how to connect to a SQLite database with the C/C++ bindings.
This page[^] gives you more information about what's available in the C/C++ bindings for SQLite.
This page[^] has a downloadable e-book that shows you how to use SQLite with Visual C++ (see chapter 3 for instructions about how to build your program) This is a pay-for e-book - didn't notice that before- DOH![/edit].
And then there's this CodeProject article[^] (you know, CodeProject, the site you're asking this question on) that has a C++ wrapper for SQLite.
Google is your friend...
The CodeProject article tells you all you need to get started with SQLite. I see you've commented on the article already - if you can't make progress even after reading that article, I think you need to learn some basics about how to build C++ programs with third-party libraries...[/edit]
1>------ Build started: Project: sparta1, Configuration: Debug Win32 ------
1>c:\users\vani\documents\visual studio 2005\projects\sparta1\sparta1\sparta1.cpp(29) : error C2664: 'SAConnection::Connect' : cannot convert parameter 4 from 'const char ' to 'SAClient_t'
1> There is no context in which this conversion is possible
1>Build log was saved at "file://c:\Users\Vani\Documents\Visual Studio 2005\Projects\sparta1\sparta1\Debug\BuildLog.htm"
1>sparta1 - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Ohhh...Finally got it now...the linker errors have been resolved one shot. I have another question,
what does 'try' block starting on line '34' has no catch handlers means??not so familiar with this statement...
what does 'try' block starting on line '34' has no catch handlers means
a) Which line 34? I haven't seen a try block anywhere.
b) A try block with no catch handlers means someone's forgotten to put catch handlers in...In fact, g++4.0.1 (the only C++ compiler I've got to hand) won't compile a try block with no handlers (what C++ compiler are you using? VC6?)