Board index » cppbuilder » Converting BC++ 5.02 app to BCB 4

Converting BC++ 5.02 app to BCB 4

After converting an OWL app written in BC++ 5.02 to BCB 4 using IDETOBPR
I get a lot of "Ambiguity between ostream and std::ostream" within the
OWL headers (escpecially geometry.h). I'm also getting those errors if I
create a new OWL project and add the .cpp file that includes geometry.h.
What do I need to do to get the code compiled?

Thanks for help

Martin Golm
Reico GmbH

BTW: Yes I read the threads I found in this group, but the answers given
there didn't help.

 

Re:Converting BC++ 5.02 app to BCB 4


Quote
>After converting an OWL app written in BC++ 5.02 to BCB 4 using IDETOBPR

I suggest you to *not* use IDETOBPR.  You should create a blank
projetc in BCB4 than adding every module you need.

Quote
>I get a lot of "Ambiguity between ostream and std::ostream" within the
>OWL headers (escpecially geometry.h). I'm also getting those errors if I
>create a new OWL project and add the .cpp file that includes geometry.h.

OWL and VCL share common names but are compatible if you may separate
them sufficiently to avoid such ambiguities.

- If the ambiguity is between an OWL type and a VCL one, add OWL:: in
front of OWL class.

- in other case I encountered, I changed header order of inclusion.

Last, but more important advice.  Have a look at OWLDialog sample
coming with BCB.  You'll find there:
- a template to call VCL forn from OWL window ( I tested it with
Dilaog and even with client area of OWL child windows)
- a very useful header file, pch.h, do deal with ambiguities.

Hope that helps.

Vincent

Quote
>What do I need to do to get the code compiled?

>Thanks for help

>Martin Golm
>Reico GmbH

>BTW: Yes I read the threads I found in this group, but the answers given
>there didn't help.

Re:Converting BC++ 5.02 app to BCB 4


1) Our application consists of about 500 files in different
subdirectories. After adding the files to the BCB project the include
path lists all the subdirectories of the cpp files. Since there is a H
subdirectory containing all headers, I don't need the other
subdirectories within the include path. But I'm unable to persistently
remove the subdirectories from the include path. And although the H
subdirectory is the first in the list I can't open the header files by
pressing Ctrl+Enter. BCB wants to load the header from its cpp
subdirectory. This makes BCB quite unusable for large projects. Is there
a workaround without putting all files in one directory?

2) BC++ had a known exception problem. When an exception was thrown
destructors were called for not yet constructed objects. Is this fixed
in BCB?

3) BC++ had a problem with overloaded operator =() for virtual base
classes. The derived class had to define its own operator =() although
it shouldn't be necessary. Do I also need to do that in BCB?

class A {
private:
  int mA;
  ...
public:
  A& operator =(const A&);
  ...

Quote
};

class B : virtual public A {
private:
  int mB;
  ...
public:
  B& operator =(const B&); <- needs to be defined to copy mB
  ...

Quote
};

Thanks

Martin Golm
Reico GmbH

Re:Converting BC++ 5.02 app to BCB 4


Vincent Fran?ois schrieb:
Quote
> - in other case I encountered, I changed header order of inclusion.

Those ambiguities are between STL and non-STL classes (as std::string
vs. string or std::ostream vs. ostream). Changing order of inclusion
didn't solve anything.
Quote
> Last, but more important advice.  Have a look at OWLDialog sample
> coming with BCB.  You'll find there:
> - a template to call VCL forn from OWL window ( I tested it with
> Dilaog and even with client area of OWL child windows)

I don't use VCL. I just wanted the OWL project to be built with BCB4.
Quote
> - a very useful header file, pch.h, do deal with ambiguities.

Yes, that's it. I needed to define BI_STD_RTL (among a lot of other
things). Now it works.

Thanks

Martin Golm
Reico GmbH

Other Threads