PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > Compiler error
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Compiler error

Réponse
 
LinkBack Outils de la discussion
Vieux 03/02/2008, 11h59   #1
M.Caggiano
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Compiler error

I've write a function without errors but i've this message after
compilation:

*** ["../Socket/Client/Client.o"] Error1

how can i resolve this problem?
Many many thanks in advance.
  Réponse avec citation
Vieux 03/02/2008, 12h22   #2
Flash Gordon
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

M.Caggiano wrote, On 03/02/08 11:59:
> I've write a function without errors but i've this message after
> compilation:
>
> *** ["../Socket/Client/Client.o"] Error1
>
> how can i resolve this problem?
> Many many thanks in advance.


The first thing to do is correct your assumption that the function is
without errors. You obviously have an error somewhere or you would not
get an error reported. Then consider how *anyone* is supposed to guess
what the problem is based on what you posted.
--
Flash Gordon
  Réponse avec citation
Vieux 03/02/2008, 14h20   #3
Kenny McCormack
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

In article <a9og75x3mo.ln2@news.flash-gordon.me.uk>,
Flash Gordon <spam@flash-gordon.me.uk> wrote:
>M.Caggiano wrote, On 03/02/08 11:59:
>> I've write a function without errors but i've this message after
>> compilation:
>>
>> *** ["../Socket/Client/Client.o"] Error1
>>
>> how can i resolve this problem?
>> Many many thanks in advance.

>
>The first thing to do is correct your assumption that the function is
>without errors. You obviously have an error somewhere or you would not
>get an error reported. Then consider how *anyone* is supposed to guess
>what the problem is based on what you posted.
>--
>Flash Gordon


So ful. So sweet. So kind.

Fine example of modern US civility. A beacon for us all.

  Réponse avec citation
Vieux 03/02/2008, 15h28   #4
Mark McIntyre
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

M.Caggiano wrote:
> I've write a function without errors but i've this message after
> compilation:
>
> *** ["../Socket/Client/Client.o"] Error1
>
> how can i resolve this problem?


Read the compiler / linker manual to find out what "error 1" is.
This looks more like a linker error, by the way - nothing to do with C.

--
Mark McIntyre

CLC FAQ <http://c-faq.com/>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
  Réponse avec citation
Vieux 03/02/2008, 16h22   #5
Harald van Dijk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

On Sun, 03 Feb 2008 15:28:42 +0000, Mark McIntyre wrote:
> M.Caggiano wrote:
>> I've write a function without errors but i've this message after
>> compilation:
>>
>> *** ["../Socket/Client/Client.o"] Error1
>>
>> how can i resolve this problem?

>
> Read the compiler / linker manual to find out what "error 1" is. This
> looks more like a linker error, by the way - nothing to do with C.


Doesn't look like a linker error to me. It looks like there's an error
reported by make or a similar build tool in generating
.../Socket/Client/Client.o, which is typically the job of the compiler,
not the linker. I don't know why the OP didn't bother to post an actually
useful error message though.
  Réponse avec citation
Vieux 03/02/2008, 16h52   #6
M.Caggiano
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

On 3 Feb, 13:22, Flash Gordon <s...@flash-gordon.me.uk> wrote:
> M.Caggiano wrote, On 03/02/08 11:59:
>
> > I've write a function without errors but i've this message after
> > compilation:

>
> > *** ["../Socket/Client/Client.o"] Error1

>
> > how can i resolve this problem?
> > Many many thanks in advance.

>
> The first thing to do is correct your assumption that the function is
> without errors. You obviously have an error somewhere or you would not
> get an error reported. Then consider how *anyone* is supposed to guess
> what the problem is based on what you posted.
> --
> Flash Gordon


The only error of the function is that.
I don't know whether to also think because the message is enough
vague.
Thanks the same.
  Réponse avec citation
Vieux 03/02/2008, 17h26   #7
Walter Roberson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

In article <cca3e$47a5ea29$541dfcd3$2815@cache3.tilbu1.nb.hom e.nl>,
=?UTF-8?q?Harald_van_D=C4=B3k?= <truedfx@gmail.com> wrote:
>On Sun, 03 Feb 2008 15:28:42 +0000, Mark McIntyre wrote:
>> M.Caggiano wrote:
>>> I've write a function without errors but i've this message after
>>> compilation:


>>> *** ["../Socket/Client/Client.o"] Error1


>> Read the compiler / linker manual to find out what "error 1" is. This
>> looks more like a linker error, by the way - nothing to do with C.


>Doesn't look like a linker error to me. It looks like there's an error
>reported by make or a similar build tool in generating
>../Socket/Client/Client.o,


I would agree. "Error 1" is make's typical error report after
a problem in the previous step, whether that step be a compile or link.
It is what "make" reports for the majority of situations in which
the previous step returned a non-success error code. The actual
problem would have appeared above that.
--
"No one has the right to destroy another person's belief by
demanding empirical evidence." -- Ann Landers
  Réponse avec citation
Vieux 03/02/2008, 18h09   #8
Richard Heathfield
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

Mark McIntyre said:

<snip>

> This looks more like a linker error, by the way - nothing to do with C.


Linking is Translation Phase 8, a very important part of the translation
process for C programs. It is lots to do with C.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
  Réponse avec citation
Vieux 03/02/2008, 18h49   #9
Mark McIntyre
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

Richard Heathfield wrote:
> Mark McIntyre said:
>
> <snip>
>
>> This looks more like a linker error, by the way - nothing to do with C.

>
> Linking is Translation Phase 8, a very important part of the translation
> process for C programs. It is lots to do with C.


Read what I wrote more carefully.

While "linking" is something to do with C, the linker is not. The linker
is a language-neutral tool that performs the action of linking.

--
Mark McIntyre

CLC FAQ <http://c-faq.com/>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
  Réponse avec citation
Vieux 03/02/2008, 18h52   #10
Mark McIntyre
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

Harald van Dijk wrote:
> On Sun, 03 Feb 2008 15:28:42 +0000, Mark McIntyre wrote:
>> M.Caggiano wrote:
>>> I've write a function without errors but i've this message after
>>> compilation:
>>>
>>> *** ["../Socket/Client/Client.o"] Error1
>>>
>>> how can i resolve this problem?

>> Read the compiler / linker manual to find out what "error 1" is. This
>> looks more like a linker error, by the way - nothing to do with C.

>
> Doesn't look like a linker error to me. It looks like there's an error
> reported by make or a similar build tool in generating


You may be right, but my crystal ball isn't up to devining anything
better than "user claims no bugs in C code, but still gets error,
possible error in the next step of creating an executable"...

> ../Socket/Client/Client.o, which is typically the job of the compiler,
> not the linker.


it could equally well be a problem /reading/ that object in order to
link it. The OP removed all useful context...

I don't know why the OP didn't bother to post an actually
> useful error message though.


I suspect its the usual reason - he snipped what he thought was
irrelevant but didn't know enough about the problem to get that snippage
right.

To the OP: post more detail...
--
Mark McIntyre

CLC FAQ <http://c-faq.com/>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
  Réponse avec citation
Vieux 03/02/2008, 18h53   #11
Mark McIntyre
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

M.Caggiano wrote:
> The only error of the function is that.


You typed
gcc myfile.c

and that was the only output?????

> I don't know whether to also think because the message is enough
> vague.


You need to post more detail...

--
Mark McIntyre

CLC FAQ <http://c-faq.com/>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
  Réponse avec citation
Vieux 03/02/2008, 20h25   #12
Keith Thompson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

Harald van Dijk <truedfx@gmail.com> writes:
> On Sun, 03 Feb 2008 15:28:42 +0000, Mark McIntyre wrote:
>> M.Caggiano wrote:
>>> I've write a function without errors but i've this message after
>>> compilation:
>>>
>>> *** ["../Socket/Client/Client.o"] Error1
>>>
>>> how can i resolve this problem?

>>
>> Read the compiler / linker manual to find out what "error 1" is. This
>> looks more like a linker error, by the way - nothing to do with C.

>
> Doesn't look like a linker error to me. It looks like there's an error
> reported by make or a similar build tool in generating
> ../Socket/Client/Client.o, which is typically the job of the compiler,
> not the linker. I don't know why the OP didn't bother to post an actually
> useful error message though.


It's hard to tell, but most tools I've seen report the name of the
*input* file in an error message. If the error message referred to
"../Socket/Client/Client.c", I'd assume a compile-time error; given
the reference to "Client.o", it's probably a link-time error.

Though it's conceivable that there was an error *writing* Client.o.

(I'm also assuming that the ".o" suffix denotes an object file, the
output of the compiler; this is not 100% certain, but I think it's a
safe bet, especially given that the form of the path implies a
Unix-like system.)

--
Keith Thompson (The_Other_Keith) <kst-u@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
  Réponse avec citation
Vieux 03/02/2008, 20h38   #13
Keith Thompson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

"M.Caggiano" <Michele.Caggiano@gmail.com> writes:
> I've write a function without errors but i've this message after
> compilation:
>
> *** ["../Socket/Client/Client.o"] Error1
>
> how can i resolve this problem?
> Many many thanks in advance.


First of all, it's important to copy-and-paste the *exact* error
message. Whatever tool produced the message, I suspect it actually
printed "Error 1", not "Error1". This may seem like a trivial point,
but we can't guess what other errors you may have inadvertently
produced when you re-typed the message.

As it happens, the form of the error message looks familiar; it
appears to be from the GNU "make" command, and it indicates that
*some* command, intended to create the file
"../Socket/Client/Client.o", failed with a status code of 1. Most
likely that command was the compiler. Normally you should have seen
the compiler's output just before the message you quoted. The most
likely explanations are (a) you've failed to show us the relevant
output (without which we can't possibly guess what the problem is), or
(b) the make command was invoked in such a way that it discarded the
compiler's diagnostic output (which would be an odd thing to do).

You seem to be assuming that you've written a function without errors;
since you're getting an error message, that seems unlikely. Look for
error messages from the compiler. Look at your Makefile and at the
way you're invoking the "make" command to be sure that it's letting
you see any messages from the compiler.

For with using make, post to comp.unix.programmer. If you can
see the compiler's output, pay attention to the messages; if they
indicate a problem in your C source, and you have trouble correcting
it, post here with more details. If the problem has to do with a
system-specific feature, rather than with the core C language and
library, we might redirect you; in particular, sockets are not part of
standard C, and can be discussed in comp.unix.programmer.

You might also want to read this:
<http://www.catb.org/~esr/faqs/smart-questions.html>.

--
Keith Thompson (The_Other_Keith) <kst-u@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
  Réponse avec citation
Vieux 03/02/2008, 20h44   #14
Keith Thompson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

Keith Thompson <kst-u@mib.org> writes:
> Harald van Dijk <truedfx@gmail.com> writes:
>> On Sun, 03 Feb 2008 15:28:42 +0000, Mark McIntyre wrote:
>>> M.Caggiano wrote:
>>>> I've write a function without errors but i've this message after
>>>> compilation:
>>>>
>>>> *** ["../Socket/Client/Client.o"] Error1
>>>>
>>>> how can i resolve this problem?
>>>
>>> Read the compiler / linker manual to find out what "error 1" is. This
>>> looks more like a linker error, by the way - nothing to do with C.

>>
>> Doesn't look like a linker error to me. It looks like there's an error
>> reported by make or a similar build tool in generating
>> ../Socket/Client/Client.o, which is typically the job of the compiler,
>> not the linker. I don't know why the OP didn't bother to post an actually
>> useful error message though.

>
> It's hard to tell, but most tools I've seen report the name of the
> *input* file in an error message. If the error message referred to
> "../Socket/Client/Client.c", I'd assume a compile-time error; given
> the reference to "Client.o", it's probably a link-time error.


It appears that I was mistaken. I realized after I wrote the above
that ``make'' *does* report the name of the output file in its error
messages. See my other followup for more details.

--
Keith Thompson (The_Other_Keith) <kst-u@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
  Réponse avec citation
Vieux 03/02/2008, 21h09   #15
Morris Dovey
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

"M.Caggiano" wrote:
>
> ---ATTENTION---
> Problem resolved boys!!
> Thanks to everybody.
> Now however I will open a new discussion from the title "Socket: bind
> error...why??"


Excellent! Please tell us what the problem was and how you
resolved it.

news:comp.unix.programmer would be a much better forum for
discussion of networking code.

--
Morris Dovey
DeSoto Solar
DeSoto, Iowa USA
http://www.iedu.com/DeSoto
  Réponse avec citation
Vieux 03/02/2008, 21h24   #16
M.Caggiano
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

On 3 Feb, 21:38, Keith Thompson <ks...@mib.org> wrote:
> "M.Caggiano" <Michele.Caggi...@gmail.com> writes:
> > I've write a function without errors but i've this message after
> > compilation:

>
> > *** ["../Socket/Client/Client.o"] Error1

>
> > how can i resolve this problem?
> > Many many thanks in advance.

>
> First of all, it's important to copy-and-paste the *exact* error
> message. Whatever tool produced the message, I suspect it actually
> printed "Error 1", not "Error1". This may seem like a trivial point,
> but we can't guess what other errors you may have inadvertently
> produced when you re-typed the message.
>
> As it happens, the form of the error message looks familiar; it
> appears to be from the GNU "make" command, and it indicates that
> *some* command, intended to create the file
> "../Socket/Client/Client.o", failed with a status code of 1. Most
> likely that command was the compiler. Normally you should have seen
> the compiler's output just before the message you quoted. The most
> likely explanations are (a) you've failed to show us the relevant
> output (without which we can't possibly guess what the problem is), or
> (b) the make command was invoked in such a way that it discarded the
> compiler's diagnostic output (which would be an odd thing to do).
>
> You seem to be assuming that you've written a function without errors;
> since you're getting an error message, that seems unlikely. Look for
> error messages from the compiler. Look at your Makefile and at the
> way you're invoking the "make" command to be sure that it's letting
> you see any messages from the compiler.
>
> For with using make, post to comp.unix.programmer. If you can
> see the compiler's output, pay attention to the messages; if they
> indicate a problem in your C source, and you have trouble correcting
> it, post here with more details. If the problem has to do with a
> system-specific feature, rather than with the core C language and
> library, we might redirect you; in particular, sockets are not part of
> standard C, and can be discussed in comp.unix.programmer.
>
> You might also want to read this:
> <http://www.catb.org/~esr/faqs/smart-questions.html>.
>
> --
> Keith Thompson (The_Other_Keith) <ks...@mib.org>
> Nokia
> "We must do something. This is something. Therefore, we must do this."
> -- Antony Jay and Jonathan Lynn, "Yes Minister"


Thank's for your answer.
This is the c code:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winsock.h>
#include <windows.h>

void err_fatal(char *);
int readn(SOCKET, char *, int);


main()
{
/* apertura connessione lato client */
int taddr_n, tport_n;
struct sockaddr_in saddr;
int result;
char buffer[1024]; // buffer

SOCKET s;
WSADATA data; // inizializzo la variabile che contiene le primitive
di Winsock
WORD p;
int err=0;
p=MAKEWORD(2,0); // creo la variabile p che contiene la versione
della wsock32.dll
err=WSAStartup(p,&data); // inizializzo la wsock32.dll verificandone
la mancanza di errori

/* creazione socket */
s=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(s==INVALID_SOCKET) err_fatal("socket() failed!");
printf("Creazione socket riuscita\n");
printf("\nConnessione...\n");

//taddr_n=inet_addr("130.192.3.45"); /* restituisce l'indirizzo in
ordine di rete */
//tport_n=htons(25);
taddr_n=inet_addr("127.0.0.1");
tport_n=htons(1037);

saddr.sin_family=AF_INET;
saddr.sin_port=tport_n;
saddr.sin_addr.s_addr=taddr_n;

result=connect(s,(struct sockaddr*) &saddr,sizeof(struct sockaddr));
if(result==-1) err_fatal("connect() failed!");

/* Riceve un messaggio */
if((readn(s,buffer,sizeof(buffer)))==0) err_fatal("read() failed!");

/* Stampa il messaggio ricevuto */
printf("Ho ricevuto: %s\n",buffer);

system("pause");

/* Chiude i socket */
WSACleanup();
closesocket(s);
}

/* stampa errore */
void err_fatal(char *mes)
{
printf("%s, errno=%d\n",mes,WSAGetLastError());
perror("");
system("pause");
exit(1);
}

/* lettura di n byte */
int readn(SOCKET s, char *ptr, int len)
{
int nread;
nread=recv(s,ptr,len,0);
return nread;
}


it's a simply program that uses the "socket" to communicate with a
server.
Made the compilation the ONLY error(Any Warning, any other error!!)
that I have it is:

*** ["../Socket/Client/Client.o"] Error 1

The compiler that I use is the Dev-C++.
The description of the error is simply this: without other number
codes or various comments.
I know that the description is "vague": in fact doesn't a lot me
to resolve the problem!

This is everything.
  Réponse avec citation
Vieux 03/02/2008, 21h34   #17
M.Caggiano
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

On 3 Feb, 22:24, "M.Caggiano" <Michele.Caggi...@gmail.com> wrote:
> On 3 Feb, 21:38, Keith Thompson <ks...@mib.org> wrote:
>
>
>
> > "M.Caggiano" <Michele.Caggi...@gmail.com> writes:
> > > I've write a function without errors but i've this message after
> > > compilation:

>
> > > *** ["../Socket/Client/Client.o"] Error1

>
> > > how can i resolve this problem?
> > > Many many thanks in advance.

>
> > First of all, it's important to copy-and-paste the *exact* error
> > message. Whatever tool produced the message, I suspect it actually
> > printed "Error 1", not "Error1". This may seem like a trivial point,
> > but we can't guess what other errors you may have inadvertently
> > produced when you re-typed the message.

>
> > As it happens, the form of the error message looks familiar; it
> > appears to be from the GNU "make" command, and it indicates that
> > *some* command, intended to create the file
> > "../Socket/Client/Client.o", failed with a status code of 1. Most
> > likely that command was the compiler. Normally you should have seen
> > the compiler's output just before the message you quoted. The most
> > likely explanations are (a) you've failed to show us the relevant
> > output (without which we can't possibly guess what the problem is), or
> > (b) the make command was invoked in such a way that it discarded the
> > compiler's diagnostic output (which would be an odd thing to do).

>
> > You seem to be assuming that you've written a function without errors;
> > since you're getting an error message, that seems unlikely. Look for
> > error messages from the compiler. Look at your Makefile and at the
> > way you're invoking the "make" command to be sure that it's letting
> > you see any messages from the compiler.

>
> > For with using make, post to comp.unix.programmer. If you can
> > see the compiler's output, pay attention to the messages; if they
> > indicate a problem in your C source, and you have trouble correcting
> > it, post here with more details. If the problem has to do with a
> > system-specific feature, rather than with the core C language and
> > library, we might redirect you; in particular, sockets are not part of
> > standard C, and can be discussed in comp.unix.programmer.

>
> > You might also want to read this:
> > <http://www.catb.org/~esr/faqs/smart-questions.html>.

>
> > --
> > Keith Thompson (The_Other_Keith) <ks...@mib.org>
> > Nokia
> > "We must do something. This is something. Therefore, we must do this."
> > -- Antony Jay and Jonathan Lynn, "Yes Minister"

>
> Thank's for your answer.
> This is the c code:
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> #include <winsock.h>
> #include <windows.h>
>
> void err_fatal(char *);
> int readn(SOCKET, char *, int);
>
> main()
> {
> /* apertura connessione lato client */
> int taddr_n, tport_n;
> struct sockaddr_in saddr;
> int result;
> char buffer[1024]; // buffer
>
> SOCKET s;
> WSADATA data; // inizializzo la variabile che contiene le primitive
> di Winsock
> WORD p;
> int err=0;
> p=MAKEWORD(2,0); // creo la variabile p che contiene la versione
> della wsock32.dll
> err=WSAStartup(p,&data); // inizializzo la wsock32.dll verificandone
> la mancanza di errori
>
> /* creazione socket */
> s=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
> if(s==INVALID_SOCKET) err_fatal("socket() failed!");
> printf("Creazione socket riuscita\n");
> printf("\nConnessione...\n");
>
> //taddr_n=inet_addr("130.192.3.45"); /* restituisce l'indirizzo in
> ordine di rete */
> //tport_n=htons(25);
> taddr_n=inet_addr("127.0.0.1");
> tport_n=htons(1037);
>
> saddr.sin_family=AF_INET;
> saddr.sin_port=tport_n;
> saddr.sin_addr.s_addr=taddr_n;
>
> result=connect(s,(struct sockaddr*) &saddr,sizeof(struct sockaddr));
> if(result==-1) err_fatal("connect() failed!");
>
> /* Riceve un messaggio */
> if((readn(s,buffer,sizeof(buffer)))==0) err_fatal("read() failed!");
>
> /* Stampa il messaggio ricevuto */
> printf("Ho ricevuto: %s\n",buffer);
>
> system("pause");
>
> /* Chiude i socket */
> WSACleanup();
> closesocket(s);
>
> }
>
> /* stampa errore */
> void err_fatal(char *mes)
> {
> printf("%s, errno=%d\n",mes,WSAGetLastError());
> perror("");
> system("pause");
> exit(1);
>
> }
>
> /* lettura di n byte */
> int readn(SOCKET s, char *ptr, int len)
> {
> int nread;
> nread=recv(s,ptr,len,0);
> return nread;
>
> }
>
> it's a simply program that uses the "socket" to communicate with a
> server.
> Made the compilation the ONLY error(Any Warning, any other error!!)
> that I have it is:
>
> *** ["../Socket/Client/Client.o"] Error 1
>
> The compiler that I use is the Dev-C++.
> The description of the error is simply this: without other number
> codes or various comments.
> I know that the description is "vague": in fact doesn't a lot me
> to resolve the problem!
>
> This is everything.


A last precise statement: it needs to linking the project with:
"libws2_32.a"
Otherwise the compiler doesn't recognize any necessary functions for
the use of the sockets.
  Réponse avec citation
Vieux 03/02/2008, 21h58   #18
M.Caggiano
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

---ATTENTION---
Problem resolved boys!!
Thanks to everybody.
Now however I will open a new discussion from the title "Socket: bind
error...why??"

  Réponse avec citation
Vieux 03/02/2008, 22h19   #19
M.Caggiano
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

On 3 Feb, 22:09, Morris Dovey <mrdo...@iedu.com> wrote:
> "M.Caggiano" wrote:
>
> > ---ATTENTION---
> > Problem resolved boys!!
> > Thanks to everybody.
> > Now however I will open a new discussion from the title "Socket: bind
> > error...why??"

>
> Excellent! Please tell us what the problem was and how you
> resolved it.
>
> news:comp.unix.programmer would be a much better forum for
> discussion of networking code.
>
> --
> Morris Dovey
> DeSoto Solar
> DeSoto, Iowa USAhttp://www.iedu.com/DeSoto


I have not exactly understood sincerely the motive for this type of
error.
The solution has been banal: have simply revolved the obstacle!

Have recopied the whole code in a new file contained in a new project
and once compiled....... any error!

I don't have idea of the why.
Do you succeed in explaining you him?
  Réponse avec citation
Vieux 03/02/2008, 22h55   #20
Mark McIntyre
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

M.Caggiano wrote:

(snip unix-specific sockets code)

> This is everything.


Not quite everything - you forgot to explain how you're compiling, what
flags you passed to the compiler and linker etc.

By the way, the code is very unix-like. You may have much more luck in
comp.unix.programming. Or a Dev-C++ newsgroup.


--
Mark McIntyre

CLC FAQ <http://c-faq.com/>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
  Réponse avec citation
Vieux 03/02/2008, 22h56   #21
Mark McIntyre
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

M.Caggiano wrote:
> ---ATTENTION---
> Problem resolved boys!!
> Thanks to everybody.
> Now however I will open a new discussion from the title "Socket: bind
> error...why??"


Open that discussion in comp.unix.programming - sockets aren't part of
the C language and the unix guys know much more about them. If it were
me, I'd check permissions though.

--
Mark McIntyre

CLC FAQ <http://c-faq.com/>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
  Réponse avec citation
Vieux 03/02/2008, 23h08   #22
Richard Heathfield
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

Mark McIntyre said:

> M.Caggiano wrote:
>> ---ATTENTION---
>> Problem resolved boys!!
>> Thanks to everybody.
>> Now however I will open a new discussion from the title "Socket: bind
>> error...why??"

>
> Open that discussion in comp.unix.programming


No such group. And, assuming you mean comp.unix.programmer, it's hard to
see how they'd be interested in discussing a Win32 API program.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
  Réponse avec citation
Vieux 04/02/2008, 10h36   #23
Robert Latest
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

M.Caggiano wrote:

> Thank's for your answer.
> This is the c code:
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> #include <winsock.h>
> #include <windows.h>


And these few lines are enough to see that what you're having is not really
a C problem but (possibly) a Windows API problem, and is therefore off-topic
in this newsgroup.

Go to a newsgroup concerned with Windows networking programming, where your
question is on-topic. We can't realy you here.

robert
  Réponse avec citation
Vieux 05/02/2008, 23h17   #24
Mark McIntyre
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

Richard Heathfield wrote:

No such group.

typo.

>And, assuming you mean comp.unix.programmer, it's hard to
> see how they'd be interested in discussing a Win32 API program.


Huh? The original code was unix sockets stuff.

--
Mark McIntyre

CLC FAQ <http://c-faq.com/>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
  Réponse avec citation
Vieux 05/02/2008, 23h25   #25
dj3vande@csclub.uwaterloo.ca.invalid
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Compiler error

In article <_76qj.440$Gv.435@en-nntp-07.dc1.easynews.com>,
Mark McIntyre <markmcintyre@spamcop.net> wrote:

>>And, assuming you mean comp.unix.programmer, it's hard to
>> see how they'd be interested in discussing a Win32 API program.

>
>Huh? The original code was unix sockets stuff.


Quoth the OP in
<9cd5c6be-2f16-406f-a8fa-8438a769613a@n20g2000hsh.googlegroups.com>:

--------
This is the c code:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winsock.h>
#include <windows.h>
--------

Looks like Win32 to me.


dave

--
Dave Vandervies dj3vande at eskimo dot com
[O]ne of them said that she figured I was a professional. (Amateur potters
often think this; professionals never make that mistake. As I said, I fit
quite squarely in the intermediate category.) --Moebius Stripper
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : ou