When we work on Turbo C, we get all the functions and header files by default which we can include normally by #inlcude eg: stdlib.h, math.h
But when writing a simple program using such header files I am getting error because I'm unable to include these files. Aren't these header files available by default for us to use? If yes then how to use such header files? When I used a function sqrt in "math.h" I was getting error as math.h was not getting included so I had to include it in the following command:
cc -c aaa.c -I/usr/local/ssl/include
gcc -o aaa aaa.c -I/usr/local/ssl/include -L/usr/local/ssl/lib -lcrypto -lm
./aaa
In this command the 2nd one is having -lm at the end to include math.h
again similarly I used a function itoa() which is in stdlib.h which I am executing on a UNIX Solaris server, but it is not getting included and I am gettig error. Now I don't know how to add this header file.
your compiler should provide command line settings where you can specify include directories, library directories etc. it is best if you take a look at your compiler documentation.
E.g. visual studio has a command switch -I to specify include folders
alt. in some cases it can be specified as an environment variable e.g. set INCLUDE=...
it all depends on what compiler you use.