compilation error - mission header files [message #78849] |
Fri, 22 August 2003 08:58  |
Eclipse User |
|
|
|
Originally posted by: rb200m.doc.ic.ac.uk
using MinGW, the compiler compains that the header files <sys/socket.h>
and <netinet/in.h> cannot be found. I've had a look and indeed they are
missing from the /include directory.
So i installed Cygwin instead and the file are readily available but there
is no make.exe or gcc.exe under the Cygwin/bin directory.
Any ideas
Cheers :-)
|
|
|
|
|
Re: compilation error - mission header files [message #79026 is a reply to message #79002] |
Tue, 26 August 2003 21:09   |
Eclipse User |
|
|
|
ali wrote:
> kesselhaus wrote:
>
>
>>ali wrote:
>
>
>>>using MinGW, the compiler compains that the header files <sys/socket.h>
>>>and <netinet/in.h> cannot be found. I've had a look and indeed they are
>>>missing from the /include directory.
>
>
>>These header files are specific to UNIX and _not_ Windows. Windows uses
>>a little different APIs where Inet is going through Winsock.
>
>
> Yes, indeed. It is a UNIX project, which i've imported into Eclipse's CDT,
> and there are differences in the socket programming API between Win and
> UNIX, but i was thinking the project would still compile under CDT because
> we're using CYGWIN which is a UNIX environment for windows.
> Are u saying that i should rewrite specific parts of the project to
> conform with winsock API??
> Thanx for the help :-)
Well, this depends on your program requirements. If you want to compile
by using the cygwin headers and libs, you have to supply the cygwin.dll
with your program. If this is no option, you should separate the
low-level socket access. The MinGW toolchain is gcc/g++ based but its
using the winapi. I do not know of an extra library simulating the UNIX
socket API yet.
>
>>>So i installed Cygwin instead and the file are readily available but there
>>>is no make.exe or gcc.exe under the Cygwin/bin directory.
>>>Any ideas
>>>Cheers :-)
>>>
>>Did you check the make and gcc within the setup.exe program?
>
> I installed most packages, except a couple i think. Now i can find
> "make.exe" but still not gcc or g++?? I'll try installing the whole
> thing-ahhh, this is gonna take ages. Good luck me!
Maybe you missed the package. In the setup program gcc/g++ is available
under the Developing tree.
|
|
|
Re: compilation error - mission header files [message #79090 is a reply to message #79026] |
Wed, 27 August 2003 09:21   |
Eclipse User |
|
|
|
Originally posted by: rb200m.doc.ic.ac.uk
kesselhaus wrote:
> ali wrote:
> > kesselhaus wrote:
> >
> >
> >>ali wrote:
> >
> >
> >>>using MinGW, the compiler compains that the header files <sys/socket.h>
> >>>and <netinet/in.h> cannot be found. I've had a look and indeed they are
> >>>missing from the /include directory.
> >
> >
> >>These header files are specific to UNIX and _not_ Windows. Windows uses
> >>a little different APIs where Inet is going through Winsock.
> >
> >
> > Yes, indeed. It is a UNIX project, which i've imported into Eclipse's CDT,
> > and there are differences in the socket programming API between Win and
> > UNIX, but i was thinking the project would still compile under CDT because
> > we're using CYGWIN which is a UNIX environment for windows.
> > Are u saying that i should rewrite specific parts of the project to
> > conform with winsock API??
> > Thanx for the help :-)
> Well, this depends on your program requirements. If you want to compile
> by using the cygwin headers and libs, you have to supply the cygwin.dll
> with your program. If this is no option, you should separate the
> low-level socket access. The MinGW toolchain is gcc/g++ based but its
> using the winapi. I do not know of an extra library simulating the UNIX
> socket API yet.
> >
> >>>So i installed Cygwin instead and the file are readily available but there
> >>>is no make.exe or gcc.exe under the Cygwin/bin directory.
> >>>Any ideas
> >>>Cheers :-)
> >>>
> >>Did you check the make and gcc within the setup.exe program?
> >
> > I installed most packages, except a couple i think. Now i can find
> > "make.exe" but still not gcc or g++?? I'll try installing the whole
> > thing-ahhh, this is gonna take ages. Good luck me!
> Maybe you missed the package. In the setup program gcc/g++ is available
> under the Developing tree.
The compiler now doesnt complain about missing header file but i get a
link error saying:
/usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../libcygwin.a(lib cmain.o)(.text+0x7c):
undefined reference to `_WinMain@16'
collect2: ld returned 1 exit status
Any ideas what this means?
thanx -:)
|
|
|
Re: compilation error - mission header files [message #79140 is a reply to message #79090] |
Wed, 27 August 2003 14:54   |
Eclipse User |
|
|
|
ali wrote:
> kesselhaus wrote:
>
>
>>ali wrote:
>>
>>>kesselhaus wrote:
>>>
>>>
>>>
>>>>ali wrote:
>>>
>>>
>>>>>using MinGW, the compiler compains that the header files <sys/socket.h>
>>>>>and <netinet/in.h> cannot be found. I've had a look and indeed they are
>>>>>missing from the /include directory.
>>>
>>>
>>>>These header files are specific to UNIX and _not_ Windows. Windows uses
>>>>a little different APIs where Inet is going through Winsock.
>>>
>>>
>>>Yes, indeed. It is a UNIX project, which i've imported into Eclipse's CDT,
>>>and there are differences in the socket programming API between Win and
>>>UNIX, but i was thinking the project would still compile under CDT because
>>>we're using CYGWIN which is a UNIX environment for windows.
>>>Are u saying that i should rewrite specific parts of the project to
>>>conform with winsock API??
>>>Thanx for the help :-)
>
>
>>Well, this depends on your program requirements. If you want to compile
>>by using the cygwin headers and libs, you have to supply the cygwin.dll
>>with your program. If this is no option, you should separate the
>>low-level socket access. The MinGW toolchain is gcc/g++ based but its
>>using the winapi. I do not know of an extra library simulating the UNIX
>>socket API yet.
>
>
>>>>>So i installed Cygwin instead and the file are readily available but there
>>>>>is no make.exe or gcc.exe under the Cygwin/bin directory.
>>>>>Any ideas
>>>>>Cheers :-)
>>>>>
>>>>
>>>>Did you check the make and gcc within the setup.exe program?
>>>
>>>I installed most packages, except a couple i think. Now i can find
>>>"make.exe" but still not gcc or g++?? I'll try installing the whole
>>>thing-ahhh, this is gonna take ages. Good luck me!
>
>
>>Maybe you missed the package. In the setup program gcc/g++ is available
>>under the Developing tree.
>
>
> The compiler now doesnt complain about missing header file but i get a
> link error saying:
> /usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../libcygwin.a(lib cmain.o)(.text+0x7c):
> undefined reference to `_WinMain@16'
> collect2: ld returned 1 exit status
> Any ideas what this means?
> thanx -:)
>
This seems to be an error in your linker flags.
This depends on how you link.
Put this in an example Makefile for an example project and play with
it to find out, how different it works
------------------------------------------------------------ ------------
CC = gcc
LINKER = ld
OBJECTS = main.o
#USE_TO_LINK = CC
USE_TO_LINK = LINKER
ifeq ($(USE_TO_LINK),LINKER)
# LDFLAGS for using ld
# ld does not know of the Path (-L) and lib-name (-l) of the C-library
# so you need to give this to the linker!
LD = $(LINKER)
LDFLAGS = -L<path_to_libc> -lc
# you could also give the c-library as a fully-qualified name
#LDFLAGS = <path_to_libc>/libc.a
else
# LDFLAGS for using gcc
# Path (-L) and lib-name (-l) of the C-library is already
# "hard-coded" into gcc
LD = $(CC)
LDFLAGS =
endif
myapp.exe: $(OBJECTS)
$(LD) -o $@ $^ $(LDFLAGS)
------------------------------------------------------------ ------------
Hope this will help to get an understanding of how the linking works
with the different tools. Btw., gcc and g++ work the same, but g++ has
also "hard-coded" path and lib for stdc++ lib.
|
|
|
Re: compilation error - mission header files [message #79240 is a reply to message #79140] |
Thu, 28 August 2003 08:11  |
Eclipse User |
|
|
|
Originally posted by: rb200m.doc.ic.ac.uk
kesselhaus wrote:
> ali wrote:
> > The compiler now doesnt complain about missing header file but i get a
> > link error saying:
> >
/usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../libcygwin.a(lib cmain.o)(.text+0x7c):
> > undefined reference to `_WinMain@16'
> > collect2: ld returned 1 exit status
> > Any ideas what this means?
> > thanx -:)
> >
> This seems to be an error in your linker flags.
> This depends on how you link.
> Put this in an example Makefile for an example project and play with
> it to find out, how different it works
> ------------------------------------------------------------ ------------
> CC = gcc
> LINKER = ld
> OBJECTS = main.o
> #USE_TO_LINK = CC
> USE_TO_LINK = LINKER
> ifeq ($(USE_TO_LINK),LINKER)
> # LDFLAGS for using ld
> # ld does not know of the Path (-L) and lib-name (-l) of the C-library
> # so you need to give this to the linker!
> LD = $(LINKER)
> LDFLAGS = -L<path_to_libc> -lc
> # you could also give the c-library as a fully-qualified name
> #LDFLAGS = <path_to_libc>/libc.a
> else
> # LDFLAGS for using gcc
> # Path (-L) and lib-name (-l) of the C-library is already
> # "hard-coded" into gcc
> LD = $(CC)
> LDFLAGS =
> endif
> myapp.exe: $(OBJECTS)
> $(LD) -o $@ $^ $(LDFLAGS)
> ------------------------------------------------------------ ------------
> Hope this will help to get an understanding of how the linking works
> with the different tools. Btw., gcc and g++ work the same, but g++ has
> also "hard-coded" path and lib for stdc++ lib.
Thank you so much for your time. I appreciate it :-)
ali
|
|
|
Powered by
FUDForum. Page generated in 0.04272 seconds