Is there a way to just include the library in the c file or a c header file so I don't have to type -lncurses every time I compile my file.
Is there a way to just include the library in the c file or a c header file so I don't have to type -lncurses every time I compile my file.
Read your Compiler/Linker documentation and find out the answer.
Tim S.
"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson
The only way to do automatic linking is to write a makefile and use that instead.
But if you're too lazy to type "-lncurses" you're probably too lazy to do that (you do know that pressing the up arrow on your console most likely will go back to the last command so you don't have to type it again, right?).