- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- How to add path of header file
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2006 09:55 PM
тАО06-07-2006 09:55 PM
How to add path of header file
i'm doing my first steps in C/C++ programmig.
I'd like to include in my program iostream.h but when i try to compile it cpp get me an error telling it wasn't able to find iostream.
I know the file is in /usr/local/include/c++/3.4.3/backward/iostream.h
How can I tell my compiler to look for iostream in this directory? It seems it look for it only in /usr/include
I tried a thing like:
cc -I/usr/local/include/c++/3.4.3/backward/iostream.h myfile but without success.
Is there any environment variable to set?
Thank You
Mauro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2006 09:58 PM
тАО06-07-2006 09:58 PM
Re: How to add path of header file
You need to specify iostream.h in your source code like,
# include
....
while compiling your code, you have to specify
# cc -I/usr/local/include/c++/3.4.3/backward
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2006 10:02 PM
тАО06-07-2006 10:02 PM
Re: How to add path of header file
http://www.cs.cf.ac.uk/Dave/C/node3.html#SECTION00300000000000000000
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2006 10:12 PM
тАО06-07-2006 10:12 PM
Re: How to add path of header file
I misunderstood error message:
Firs of all with include directive I have to specify header file with .h otherwise cpp give me an error like:
cpp: "prova1.c", line 3: error 4036: Can't open include file 'iostream'
then the error isn't in my .c file but it seems to be in iostream.h file because I get:
# cc prova1.c -I/usr/local/include/c++/3.4.3/backward
cpp: "/usr/local/include/c++/3.4.3/backward/iostream.h", line 32: error 4036: Can't open include file 'iostream'.
Does Iostream include itself?
I've no problem with stdio and other header files in /usr/include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2006 10:18 PM
тАО06-07-2006 10:18 PM
Re: How to add path of header file
I will check line 32 and see that is in there. cpp: "/usr/local/include/c++/3.4.3/backward/iostream.h", line 32: error 4036: Can't open include file 'iostream'.
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2006 10:25 PM
тАО06-07-2006 10:25 PM
Re: How to add path of header file
# sed -n '32p' /usr/local/include/c++/3.4.3/backward/iostream.h
#include
It includes itself...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2006 10:34 PM
тАО06-07-2006 10:34 PM
Re: How to add path of header file
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2006 11:31 PM
тАО06-07-2006 11:31 PM
Re: How to add path of header file
#include
//#include
int main ()
{
printf("Ciao Bella!\n");
return 0;
}
# cc prova1.c
/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (prova1.o) was detected. The linked output may not run on a PA 1.x system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2006 11:36 PM
тАО06-07-2006 11:36 PM
Re: How to add path of header file
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2006 11:38 PM
тАО06-07-2006 11:38 PM
Re: How to add path of header file
It continues to be strange the iostream problem :-)