Board index » cppbuilder » Porting and include files missing

Porting and include files missing


2008-03-20 05:13:52 AM
cppbuilder77
Porting to BCB 2007 with Dec 2007 updates with files that compile fine under VS 2003 and gcc.
Anyone recognize where I ought to find equivalents (perhaps with different names) for some of the files I'm not finding below?
[BCC32 Error] unp.h(20): E2209 Unable to open include file 'sys/socket.h'
[BCC32 Error] unp.h(31): E2209 Unable to open include file 'netinet/in.h'
[BCC32 Error] unp.h(32): E2209 Unable to open include file 'arpa/inet.h'
[BCC32 Error] unp.h(35): E2209 Unable to open include file 'netdb.h'
[BCC32 Error] unp.h(41): E2209 Unable to open include file 'sys/uio.h'
[BCC32 Error] unp.h(42): E2209 Unable to open include file 'unistd.h'
[BCC32 Error] unp.h(43): E2209 Unable to open include file 'sys/wait.h'
[BCC32 Error] unp.h(44): E2209 Unable to open include file 'sys/un.h'
 
 

Re:Porting and include files missing

Randall Parker wrote:
[snip]
These are *nix files. Not sure where your VS 2003 gets them.
 

Re:Porting and include files missing

"Alex Bakaev [TeamB]" < XXXX@XXXXX.COM >wrote:
Quote
Randall Parker wrote:
[snip]

These are *nix files. Not sure where your VS 2003 gets them.
Right you are. Turns out the VS 2003 project doesn't include that .cpp file. Problem solved.
My more general problem is that I don't have an automated way (that I'm aware of) for importing the file list from a Visual Studio project into a CPP Builder project. So I include whole directories into CG CB and then start trying to build.
I've got lots of files across lots of directories and almost all are built on Linux and Windows. But a few aren't. There's no organization to it (and I did not create this state of affairs). Nowhere is it written what the differences are except by looking at pop-down lists of files in VS.
 

{smallsort}

Re:Porting and include files missing

On Wed, 19 Mar 2008 14:13:52 -0700, Randall Parker wrote:
Quote
Porting to BCB 2007 with Dec 2007 updates with files that compile fine
under VS 2003 and gcc.

Anyone recognize where I ought to find equivalents (perhaps with
different names) for some of the files I'm not finding below?

[BCC32 Error] unp.h(20): E2209 Unable to open include file
'sys/socket.h' [BCC32 Error] unp.h(31): E2209 Unable to open include
file 'netinet/in.h' [BCC32 Error] unp.h(32): E2209 Unable to open
include file 'arpa/inet.h' [BCC32 Error] unp.h(35): E2209 Unable to open
include file 'netdb.h' [BCC32 Error] unp.h(41): E2209 Unable to open
include file 'sys/uio.h' [BCC32 Error] unp.h(42): E2209 Unable to open
include file 'unistd.h' [BCC32 Error] unp.h(43): E2209 Unable to open
include file 'sys/wait.h' [BCC32 Error] unp.h(44): E2209 Unable to open
include file 'sys/un.h'
This should not be compiling under VS 2003. I am not sure how you managed
to get that working. The only way I could think that it would compile
with GCC is if you were using Cygwin, which comes with all of these
header files -- the MinGW native GCC does not.
In any case it depends on the functions you are using.
Most of what is in those headers can be found in windows.h; also the
socket stuff is in winsock2.h, so replacing all of those with:
#include <windows.h>
#include <winsock2.h>
Will cover many issues; although certainly not all. For example, the
stuff in sys/wait.h has no direct equivalent in the Windows API -- that
is Unix-specific, simply switching #includes will not solve your problem.
Same with unistd.h.
I am not sure how you were originally compiling your code but if you are
using a lot of the functions in those headers, you will likely have a lot
more issues than simply figuring out which header to #include.
Are you sure those headers are actually being #included in your VS / GCC
builds? Perhaps you are testing for some compiler define, like, I don't
know:
#if MSCVER
// include windows headers
#else
// include linux headers
#endif
That is #defined in VS and whatever GCC you are using, but not in C++
Builder?
Jason
 

Re:Porting and include files missing

On Wed, 19 Mar 2008 16:35:40 -0700, Randall Parker wrote:
Quote
My more general problem is that I don't have an automated way (that I'm
aware of) for importing the file list from a Visual Studio project into
a CPP Builder project. So I include whole directories into CG CB and
then start trying to build.
Both vcproj and C++ builder project files are XML; you could always write
a utility. I did this when importing a large CodeWarrior project into
Visual Studio, once. Turns out the time it took to figure out the format
of vcproj and codewarrior files, then slap together a utility to convert,
was far less than it would have taken to just import the files into
Visual Studio then set up all the build configurations again.
The VCL component TXMLDocument is ridiculously easy to use, too. ;)
Quote

I've got lots of files across lots of directories and almost all are
built on Linux and Windows. But a few aren't. There's no organization to
it (and I did not create this state of affairs). Nowhere is it written
what the differences are except by looking at pop-down lists of files in
VS.
 

Re:Porting and include files missing

Randall Parker wrote:
Quote
My more general problem is that I don't have an automated way (that I'm aware of) for importing the file list from a Visual Studio project into a CPP Builder project. So I include whole directories into CG CB and then start trying to build.

I feel your pain <g>. The absence of the the VC import utility is sorely
missed.
 

Re:Porting and include files missing

"Randall Parker" < XXXX@XXXXX.COM >wrote in message
Quote
I don't have an automated way (that I'm aware of) for importing
the file list from a Visual Studio project into a CPP Builder project.
Have you tried Borland's vctobpr.exe or vctobpru.exe utilities yet?
Gambit
 

Re:Porting and include files missing

Remy Lebeau (TeamB) wrote:
Quote
Have you tried Borland's vctobpr.exe or vctobpru.exe utilities yet?


They are not present in the BDS any longer. Haven't for a long time and
don't support VS 2003 project file format.
 

Re:Porting and include files missing

Remy Lebeau (TeamB) wrote:
Quote
"Randall Parker" < XXXX@XXXXX.COM >wrote in message
news:47e1a34c$ XXXX@XXXXX.COM ...

>I don't have an automated way (that I'm aware of) for importing
>the file list from a Visual Studio project into a CPP Builder project.

Have you tried Borland's vctobpr.exe or vctobpru.exe utilities yet?
I never heard of them until just now. When I get back to my work PC tomorrow I'll see
if I can find them.
Quote

Gambit


 

Re:Porting and include files missing

Jason Cipriani wrote:
Quote
On Wed, 19 Mar 2008 14:13:52 -0700, Randall Parker wrote:

>Porting to BCB 2007 with Dec 2007 updates with files that compile fine
>under VS 2003 and gcc.
>
>Anyone recognize where I ought to find equivalents (perhaps with
>different names) for some of the files I'm not finding below?
>
>[BCC32 Error] unp.h(20): E2209 Unable to open include file
>'sys/socket.h' [BCC32 Error] unp.h(31): E2209 Unable to open include
>file 'netinet/in.h' [BCC32 Error] unp.h(32): E2209 Unable to open
>include file 'arpa/inet.h' [BCC32 Error] unp.h(35): E2209 Unable to open
>include file 'netdb.h' [BCC32 Error] unp.h(41): E2209 Unable to open
>include file 'sys/uio.h' [BCC32 Error] unp.h(42): E2209 Unable to open
>include file 'unistd.h' [BCC32 Error] unp.h(43): E2209 Unable to open
>include file 'sys/wait.h' [BCC32 Error] unp.h(44): E2209 Unable to open
>include file 'sys/un.h'

This should not be compiling under VS 2003. I am not sure how you managed
to get that working. The only way I could think that it would compile
with GCC is if you were using Cygwin, which comes with all of these
header files -- the MinGW native GCC does not.
Turns out I imported a couple too many files into the CG CB project. Those files only
belonged in the Linux version of the project. Given that I'm doing this manually to
over 100 C++ files this sort of mistake will happen.
I really need an automated way to import the list of files from a VS 2003 (or VS 2005
since I can migrate my VS 2003 files into VS 2005 format) project file into a CG CB
project.
This is going to be an on-going need since the VS projects and solutions are getting
updated by several people. I need to automatically update my CG CB project with the
changes to the VS solution. I'd rather just reimport all the files each time since
some get added and some get removed.
Quote

In any case it depends on the functions you are using.

Most of what is in those headers can be found in windows.h; also the
socket stuff is in winsock2.h, so replacing all of those with:

#include <windows.h>
#include <winsock2.h>

Will cover many issues; although certainly not all. For example, the
stuff in sys/wait.h has no direct equivalent in the Windows API -- that
is Unix-specific, simply switching #includes will not solve your problem.
Same with unistd.h.

I am not sure how you were originally compiling your code but if you are
using a lot of the functions in those headers, you will likely have a lot
more issues than simply figuring out which header to #include.

Are you sure those headers are actually being #included in your VS / GCC
builds? Perhaps you are testing for some compiler define, like, I don't
know:

#if MSCVER
// include windows headers
#else
// include linux headers
#endif

That is #defined in VS and whatever GCC you are using, but not in C++
Builder?

Jason
 

Re:Porting and include files missing

Randall Parker wrote:
[...]
Quote
I really need an automated way to import the list of files from a VS
2003 (or VS 2005 since I can migrate my VS 2003 files into VS 2005
format) project file into a CG CB project.

This is going to be an on-going need since the VS projects and solutions
are getting updated by several people. I need to automatically update my
CG CB project with the changes to the VS solution. I'd rather just
reimport all the files each time since some get added and some get removed.
I don't know about VS 2003, but VS 2005's project files have an XML
format, so it shouldn't be too difficult to find out how the information
is stored and possibly to write a utility to pull the file list out.
Cheers,
Nicola
--
Nicola Musatti
Team Browns
Home: nicola.musatti.googlepages.com/home
Blog: wthwdik.wordpress.com/