Solved

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

Posted on 2006-10-24
6
247 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 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
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…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

726 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