?
Solved

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

Posted on 2003-03-24
5
Medium Priority
?
846 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
  • 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

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

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

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…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

621 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