I wrote codes for some file that were ".h" files.And now I want to use them in other programs..how do I have to declare to use them?please help me..thanks very much....
I wrote codes for some file that were ".h" files.And now I want to use them in other programs..how do I have to declare to use them?please help me..thanks very much....
Code:#include "myLibrary.h" // or if they're in a sub directory... #include "directory/myLib.h"
Sent from my iPadŽ
Use the -I command line option (pretty universal as far as command line flags go)
If you have
#include <myheader.h>
Then
g++ -I/path/to/headers prog.cpp
would look to see if /path/to/headers/myheader.h existed, and if it does it would be included.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Example I have a "temp.h" file in directory "C:\School\programs\temp.h" and program that I want to use this file is in "D:\example\usetemp.cpp".How do I have to declare to use "temp.h"?....
I already said how.
If you want detailed instructions for your specific compiler / IDE, you're going to have to say which one it is.
Start in project - > settings -> compiler sort of place and then look for include paths.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.