Solved

am trying to compile C++ in solaris without any code changes and getting an error

Posted on 2006-10-24
6
244 Views
Last Modified: 2008-02-01
i work with solaris 8 and am trying to compile an app without any code changes and am getting errors:
"/sbcimp/run/pkgs/PHI/v9.0.2/Library/include/date.h", line 5: Error: Could not open include file <string>.
"/sbcimp/run/pkgs/PHI/v9.0.2/Library/include/date.h", line 6: Error: Could not open include file <iostream>.
"/sbcimp/run/pkgs/PHI/v9.0.2/Library/include/date.h", line 7: Error: Could not open include file <sstream>.

i can see this date.h file and inside here is where the probs begin:
#include <string>
#include <iostream>
#include <sstream>

is there a standard lib for these? is there a difference between string and string.h etc?

Please help
0
Comment
Question by:pdadddino
6 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 17798505
Seems that the INCLUDE environment variable does not contain the correct path to the directories where your STL header files reside or your makefile has a faulty setting regarding that. Locate them on your disk (usually you will find them in '/usr/include' and correct that issue.
0
 

Author Comment

by:pdadddino
ID: 17798559
i see in /usr/include/string.h

is there a diff between string.h and <string>
0
 
LVL 86

Expert Comment

by:jkr
ID: 17798596
Yes. 'string.h' is a C header file 'string' is the C++ header file for the STL (the one you need to use). If you cannot find it at all, chances are that STL is not installed on your machine.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 15

Expert Comment

by:efn
ID: 17800714
You might try running CC for the C++ compiler instead of cc for the C compiler (if you haven't already).
0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 17801323
>>>> Locate them on your disk

STL is C++ standard from 1998. Any C++ compiler after 1998 will install <string> header. As jkr told, you need to add the directory where it resides to the INCLUDE environment variable or add it to the make call by using the -I option.

Regards, Alex
 
0
 
LVL 15

Expert Comment

by:efn
ID: 17801402
What compiler are you using?  What is the command line you use to compile?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now