Solved

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

Posted on 2006-10-24
6
243 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
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 learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

759 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

23 Experts available now in Live!

Get 1:1 Help Now