?
Solved

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

Posted on 2006-10-24
6
Medium Priority
?
260 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 2000 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

801 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