?
Solved

converting program from Rogue Wave tools.h++  to STL (UNIX platform)

Posted on 2003-03-24
5
Medium Priority
?
828 Views
Last Modified: 2012-05-04
I have begun to convert a program from using Rogue Wave tools to STL.  My first step
is to change RWCString to string. I included the STL string header file (#include <string>) in my file.  Without making any other changes I immediately got compiler errors.  

"/opt/local/rogue/rw/rwtime.h", line 396: Error: operator<=(const RWTime&, const RWTime&) already had a body defined.
"/opt/local/rogue/rw/rwtime.h", line 396: Error: t1 is not defined.
"/opt/local/rogue/rw/rwtime.h", line 396: Error: t2 is not defined.
"/opt/local/rogue/rw/rwtime.h", line 396: Error: Badly formed expression.
"/opt/local/rogue/rw/rwtime.h", line 396: Error: Badly formed expression.
"/opt/local/rogue/rw/rwtime.h", line 400: Error: operator>=(const RWTime&, const RWTime&) already had a body defined.
"/opt/local/rogue/rw/rwtime.h", line 400: Error: t1 is not defined.
"/opt/local/rogue/rw/rwtime.h", line 400: Error: t2 is not defined.
"/opt/local/rogue/rw/rwtime.h", line 400: Error: Badly formed expression.
"/opt/local/rogue/rw/rwtime.h", line 400: Error: Badly formed expression.


My question is, How do I go about tracking down this problem?  All I did was add the preprocessor command  #include <string>

0
Comment
Question by:carydb
[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
  • 3
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
oferh earned 500 total points
ID: 8197073
Its probably a problem of namespaces or class names
try to put the #include line for the stl as the last
include in your include list.
0
 

Author Comment

by:carydb
ID: 8197390
I did as you suggested and it looked like it was compiling, but it failed the same way during complilation of a different file.

0
 
LVL 1

Expert Comment

by:oferh
ID: 8197421
try the same in that file.
if it worked then it is "only" a question
of the order of include files.
0
 

Author Comment

by:carydb
ID: 8197521
I did that in each of the files (listed the stl include at the end of the include sections.)  It still fails.  The include files that I have include each other here and there. Could that be part of the problem?  The heaader files did not seem to care that #include </rw/cstring.h> is included in each of the header files.
0
 

Author Comment

by:carydb
ID: 8198063
I had to work in several files, but it finally worked.  Of coarse, there are new problems now.  Your answer did solve my problem in this question, so I will accept it as the answer.  Thanks much.
0

Featured Post

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!

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…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
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.
Suggested Courses

752 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