User forums > Using Code::Blocks
CodeBlock cannot find header file
vishalonne:
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 directory
c Code -
--- 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;
}
--- End code ---
How can solve this problem. Thanx in advance for any suggestion or guidance
oBFusCATed:
You have to setup include search paths.
vishalonne:
I am just 1 user og codeblock I don't know how to setup include search path. Please guide me
stahta01:
--- Quote from: vishalonne on November 11, 2012, 06:51:03 pm ---I am just 1 user og codeblock I don't know how to setup include search path. Please guide me
--- End quote ---
Read http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F
Use the "For your project" option it is better in nearly all cases.
Tim S.
vishalonne:
AS per documentation under the For your Project option 1st step is - Right click on the project then select Build options but unfortunately I am not getting this option. I'm using CodeBlock 10.05
Navigation
[0] Message Index
[#] Next page
Go to full version