• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 281
  • Last Modified:

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

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
pdadddino
Asked:
pdadddino
1 Solution
 
jkrCommented:
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
 
pdadddinoAuthor Commented:
i see in /usr/include/string.h

is there a diff between string.h and <string>
0
 
jkrCommented:
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
efnCommented:
You might try running CC for the C++ compiler instead of cc for the C compiler (if you haven't already).
0
 
itsmeandnobodyelseCommented:
>>>> 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
 
efnCommented:
What compiler are you using?  What is the command line you use to compile?
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now