I started learning CodeBlock from yesterday and I want to use MinGW compiler with it. How can I use MinGW with CodeBlock. I asked this question because. I am testing a database connection program in C. I include these files this way in CodeBlock
Setting->Linker Setting-Add
C:\SQLAPI\lib\libsqlapiddll.a
C:\MinGW\lib\libuser32.a
C:\MinGW\lib\libversion.a
C:\MinGW\lib\liboleaut32.a
C:\MinGW\lib\libole32.a
And this is the code but it is giving error -
C:\MinGW\lib\cppmsql.c 2 fatal error: SQLAPI.h: No such file or directoryc Code -
#include <stdio.h> // for printf
#include <SQLAPI.h> // main SQLAPI++ header
int main(int argc, char* argv[])
{
SAConnection con; // create connection object
try
{
con.Connect(
"localhost:3306@bill", // database name
"root", // user name
""); // password
//optional client name not provided
printf("We are connected!\n");
con.Disconnect();
printf("We are disconnected!\n");
}
catch(SAException &x)
{
try
{
con.Rollback();
}
catch(SAException &)
{
}
printf("%s\n", (const char*)x.ErrText());
}
return 0;
}
How can solve this problem. Thanx in advance for any suggestion or guidance