🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.migration
7 messages
7 total messages Started by Bob Lawson Fri, 19 Oct 2007 15:59
Migrating from Builder 6 to Builder 2007
#205
Author: Bob Lawson
Date: Fri, 19 Oct 2007 15:59
12 lines
1324 bytes
I have an application that I am trying to move from Builder 6 to Builder 
2007.  I think my problem is related to AnsiString since it is used through 
out the application.

I keep having errors with
    using std::string;  in cstring
and calls to To_String.

Am I missing a switch on the compiler that will work in compatability mode 
to support AnsiString?

Thanks 
Re: Migrating from Builder 6 to Builder 2007
#206
Author: Remy Lebeau (TeamB)
Date: Fri, 19 Oct 2007 16:43
12 lines
1249 bytes
"Bob Lawson" <bob.lawson@alcoa.com> wrote in message 
news:4718d44e@newsgroups.borland.com...

> I keep having errors with
>    using std::string;  in cstring
> and calls to To_String.

Please be more specific.  What EXACTLY are you having a problem with?


Gambit 
Re: Migrating from Builder 6 to Builder 2007
#207
Author: Bob Lawson
Date: Mon, 22 Oct 2007 15:10
104 lines
5163 bytes
I have taken an application that we have developed for years, lastly under 
Borland Builder 6 and moved it to a new PC with CodeGear C++ Builder 2007. 
I open the project and it converts to a new project file.

Some modules build fine while one generates 51 errors.  The thing is the 
errors are showing up in system include files.

The first set of errors are:
[BCC32 Error] cstring(29): E2316 'string' is not a member of 'std'
    ( The line in cstring is:     using std::string;   )
[BCC32 Error] cstring(29): E2272 Identifier expected
[BCC32 Error] xstring(8): E2041 Incorrect use of default
[BCC32 Error] xstring(8): E2428 Templates must be classes or functions
[BCC32 Error] xstring(8): E2141 Declaration syntax error
[BCC32 Error] xstring(22): E2303 Type name expected
[BCC32 Error] xstring(22): E2275 { expected
[BCC32 Error] xstring(22): E2272 Identifier expected
[BCC32 Error] xstring(23): E2272 Identifier expected
[BCC32 Error] xstring(23): E2275 { expected
[BCC32 Error] xstring(27): E2139 Declaration missing ;
[BCC32 Error] xstring(29): E2139 Declaration missing ;
[BCC32 Error] xstring(214): E2139 Declaration missing ;
[BCC32 Error] xstring(326): E2303 Type name expected

If we take the first one the full parser context is(comments in brackets 
below):
    Annotation.cpp(3): #include Annotation.h
        ( There are no other includes or defines before this one.)
    Annotation.h(12): #include ..\General\vector_p.h
        (There are only system includes before this one.
            #ifndef AnnotationH
            #define AnnotationH

            #include <stddef.h>
            #include <Classes.hpp>
            #include <Graphics.hpp>
            #include <Types.hpp>
            #include <Dialogs.hpp>
            #include <ExtCtrls.hpp>
            #include <Math.hpp>
            /* #include "General.h" */
            #include "vector_p.h"  )
    vector_p.h(2): #include c:\program files\codegear\rad 
studio\5.0\include\vector.h
            ( there are no other includes or defines before this one.
            #pragma option push -w-pck

            #include <vector>
            #pragma option pop )
    vector.h(18): #include c:\program files\codegear\rad 
studio\5.0\include\dinkumware\vector
        ( The rest are all system include files. )
    vector(5): #include c:\program files\codegear\rad 
studio\5.0\include\dinkumware\memory
    memory(5): #include c:\program files\codegear\rad 
studio\5.0\include\dinkumware\xmemory
    xmemory(6): #include c:\program files\codegear\rad 
studio\5.0\include\dinkumware\xutility
    xutility(5): #include c:\program files\codegear\rad 
studio\5.0\include\dinkumware\utility
    utility(5): #include c:\program files\codegear\rad 
studio\5.0\include\dinkumware\iosfwd
    iosfwd(6): #include c:\program files\codegear\rad 
studio\5.0\include\cstring
    cstring(27): #include c:\program files\codegear\rad 
studio\5.0\include\dinkumware/string
    string(5): #include c:\program files\codegear\rad 
studio\5.0\include\dinkumware\istream
    istream(5): #include c:\program files\codegear\rad 
studio\5.0\include\dinkumware\ostream
    ostream(5): #include c:\program files\codegear\rad 
studio\5.0\include\dinkumware\ios
    ios(5): #include c:\program files\codegear\rad 
studio\5.0\include\dinkumware\xlocnum
    xlocnum(8): #include c:\program files\codegear\rad 
studio\5.0\include\dinkumware\streambuf
    streambuf(5): #include c:\program files\codegear\rad 
studio\5.0\include\dinkumware\xiosbase
    xiosbase(4): #include c:\program files\codegear\rad 
studio\5.0\include\dinkumware\xlocale
    xlocale(5): #include c:\program files\codegear\rad 
studio\5.0\include\cstring
        ( The error is in this file. )

I'm  not sure where to go with this one.

Bob


"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:4718e0b0@newsgroups.borland.com...
>
> "Bob Lawson" <bob.lawson@alcoa.com> wrote in message 
> news:4718d44e@newsgroups.borland.com...
>
>> I keep having errors with
>>    using std::string;  in cstring
>> and calls to To_String.
>
> Please be more specific.  What EXACTLY are you having a problem with?
>
>
> Gambit
> 
Re: Migrating from Builder 6 to Builder 2007
#208
Author: Remy Lebeau (TeamB)
Date: Mon, 22 Oct 2007 16:24
22 lines
1772 bytes
"Bob Lawson" <bob.lawson@alcoa.com> wrote in message 
news:471cbd67$1@newsgroups.borland.com...

> I open the project and it converts to a new project file.

That is rarely ever recommended.  There is always problems with conversion. 
You should always create a fresh project in the new IDE and add your 
existing source files to it instead.

> The thing is the errors are showing up in system include files.

Please show the actual code that is failing.

> [BCC32 Error] cstring(29): E2316 'string' is not a member of 'std'
>    ( The line in cstring is:     using std::string;   )

The STL's <string> header (not the RTL's <string.h> header) was likely not 
included before reaching that point.


Gambit 
Re: Migrating from Builder 6 to Builder 2007
#209
Author: Bob Lawson
Date: Tue, 23 Oct 2007 13:42
54 lines
2565 bytes
Ok... now I'm really confused.  Out of despiration I started a new DLL 
project.
When I do this it creates me a file1.cpp.

So now a I have a new project, new directory, new file.  I build the file 
and it builds without error.
The top of the file looks like:

//---------------------------------------------------------------------------

#include <vcl.h>
#include <windows.h>
#pragma hdrstop
//---------------------------------------------------------------------------
//   Important note about DLL memory management when your DLL uses the

Now all I do is add the include for strings.

//---------------------------------------------------------------------------

#include <vcl.h>
#include <windows.h>
#include <string>
#pragma hdrstop
//---------------------------------------------------------------------------
//   Important note about DLL memory management when your DLL uses the

and now I'm back to my 51 errors!

So this has to rule out anything I have in my old code, old includes etc! 
So what is with the #include <string>!

This is a new computer, new installation of the compiler.  I should have 
tried this simple test two days ago but figured it was in my code.

Any thoughts?

Bob

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:4718e0b0@newsgroups.borland.com...
>
> "Bob Lawson" <bob.lawson@alcoa.com> wrote in message 
> news:4718d44e@newsgroups.borland.com...
>
>> I keep having errors with
>>    using std::string;  in cstring
>> and calls to To_String.
>
> Please be more specific.  What EXACTLY are you having a problem with?
>
>
> Gambit
> 
Re: Migrating from Builder 6 to Builder 2007
#210
Author: Remy Lebeau (TeamB)
Date: Tue, 23 Oct 2007 16:18
16 lines
1564 bytes
"Bob Lawson" <bob.lawson@alcoa.com> wrote in message 
news:471dfa62$1@newsgroups.borland.com...

> Now all I do is add the include for strings.

Don't put it above the #pragma statement.  Put it below instead:

    #include <vcl.h>
    #include <windows.h>
    #pragma hdrstop

    #include <string>


Gambit 
Re: Migrating from Builder 6 to Builder 2007
#217
Author: Leo Siefert
Date: Fri, 09 Nov 2007 13:02
24 lines
1869 bytes
Bob Lawson wrote:

>Now all I do is add the include for strings.
>...
>and now I'm back to my 51 errors!

I just tried doing exactly the same thing and I get a clean build - no
errors or warnings. Doesn't matter if the #include <string> is before
or after the #pragma hdrstop.


It sounds to me like you are somehow calling a header from a different
STL implementation. Check the include path for your project and make
sure that it points to the Builder 2007 include directories before any
other directories and try again.

Another thing you could try is turning off pre-compiled headers to
make sure that the ide is not using a bad pch file.

If that does not work, you can zip up the entire demo project and post
it to the attachments group and post a note here so that we can see if
there is something else going wrong.

 - Leo
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads