Luigi Auriemma

aluigi.org (ARCHIVE-ONLY FORUM!)
It is currently 19 Jul 2012 13:36

All times are UTC [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: Help compiling proxymini on unix
PostPosted: 20 Mar 2011 01:50 

Joined: 24 Jan 2011 13:58
Posts: 27
This is what I get.
Code:
> uname -rms
FreeBSD 8.1-STABLE amd64
> gcc -o proxymini proxymini.c -lpthread
proxymini.c:104: warning: 'struct sockaddr_in' declared inside parameter list
proxymini.c:104: warning: its scope is only this definition or declaration, which is probably not what you want
proxymini.c:105: warning: 'struct sockaddr_in' declared inside parameter list
proxymini.c:106: warning: 'struct sockaddr_in' declared inside parameter list
proxymini.c:107: warning: 'struct sockaddr_in' declared inside parameter list
proxymini.c:108: warning: 'struct sockaddr_in' declared inside parameter list
proxymini.c:109: warning: 'struct sockaddr_in' declared inside parameter list
proxymini.c:113: warning: 'struct sockaddr_in' declared inside parameter list
proxymini.c:129: error: 'INADDR_ANY' undeclared here (not in a function)
proxymini.c: In function 'main':
proxymini.c:137: error: storage size of 'peer' isn't known
proxymini.c:138: error: storage size of 'peer_bind' isn't known
proxymini.c:166: error: 'INADDR_NONE' undeclared (first use in this function)
proxymini.c:166: error: (Each undeclared identifier is reported only once
proxymini.c:166: error: for each function it appears in.)
proxymini.c:225: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'
proxymini.c:238: warning: cast to pointer from integer of different size
proxymini.c: At top level:
proxymini.c:251: warning: 'struct sockaddr_in' declared inside parameter list
proxymini.c:251: error: conflicting types for 'bind_tcp_socket'
proxymini.c:104: error: previous declaration of 'bind_tcp_socket' was here
proxymini.c: In function 'bind_tcp_socket':
proxymini.c:256: error: dereferencing pointer to incomplete type
proxymini.c:257: error: dereferencing pointer to incomplete type
proxymini.c:258: error: dereferencing pointer to incomplete type
proxymini.c:258: error: dereferencing pointer to incomplete type
proxymini.c:260: error: dereferencing pointer to incomplete type
proxymini.c:262: error: dereferencing pointer to incomplete type
proxymini.c:264: error: 'IPPROTO_TCP' undeclared (first use in this function)
proxymini.c:267: error: dereferencing pointer to incomplete type
proxymini.c:272: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'
proxymini.c:275: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'
proxymini.c: At top level:
proxymini.c:291: warning: 'struct sockaddr_in' declared inside parameter list
proxymini.c:291: error: conflicting types for 'bind_udp_socket'
proxymini.c:105: error: previous declaration of 'bind_udp_socket' was here
proxymini.c: In function 'bind_udp_socket':
proxymini.c:295: error: dereferencing pointer to incomplete type
proxymini.c:296: error: dereferencing pointer to incomplete type
proxymini.c:297: error: dereferencing pointer to incomplete type
proxymini.c:299: error: 'IPPROTO_UDP' undeclared (first use in this function)
proxymini.c:302: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'
proxymini.c:305: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'
proxymini.c: At top level:
proxymini.c:326: warning: 'struct sockaddr_in' declared inside parameter list
proxymini.c:326: error: conflicting types for 'handle_socks4'
proxymini.c:107: error: previous declaration of 'handle_socks4' was here
proxymini.c: In function 'handle_socks4':
proxymini.c:327: error: storage size of 'peerl' isn't known
proxymini.c:357: warning: passing argument 6 of 'myconnect' from incompatible pointer type
proxymini.c:360: error: 'INADDR_NONE' undeclared (first use in this function)
proxymini.c:387: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'
proxymini.c: At top level:
proxymini.c:403: warning: 'struct sockaddr_in' declared inside parameter list
proxymini.c:403: error: conflicting types for 'handle_socks5'
proxymini.c:108: error: previous declaration of 'handle_socks5' was here
proxymini.c: In function 'handle_socks5':
proxymini.c:404: error: storage size of 'peerl' isn't known
proxymini.c:456: warning: passing argument 6 of 'myconnect' from incompatible pointer type
proxymini.c:459: error: 'INADDR_NONE' undeclared (first use in this function)
proxymini.c:501: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'
proxymini.c: At top level:
proxymini.c:521: warning: 'struct sockaddr_in' declared inside parameter list
proxymini.c:521: error: conflicting types for 'handle_socks5_udp'
proxymini.c:109: error: previous declaration of 'handle_socks5_udp' was here
proxymini.c: In function 'handle_socks5_udp':
proxymini.c:522: error: storage size of 'peer' isn't known
proxymini.c:535: error: 'IPPROTO_UDP' undeclared (first use in this function)
proxymini.c:537: error: dereferencing pointer to incomplete type
proxymini.c:538: error: dereferencing pointer to incomplete type
proxymini.c:539: error: dereferencing pointer to incomplete type
proxymini.c:540: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'
proxymini.c:561: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'
proxymini.c:597: error: 'INADDR_NONE' undeclared (first use in this function)
proxymini.c:604: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'
proxymini.c:608: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'
proxymini.c:619: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'
proxymini.c: At top level:
proxymini.c:631: warning: 'struct sockaddr_in' declared inside parameter list
proxymini.c:631: error: conflicting types for 'handle_http'
proxymini.c:106: error: previous declaration of 'handle_http' was here
proxymini.c: In function 'handle_http':
proxymini.c:659: error: 'INADDR_NONE' undeclared (first use in this function)
proxymini.c:659: warning: passing argument 6 of 'myconnect' from incompatible pointer type
proxymini.c: In function 'client':
proxymini.c:701: error: storage size of 'peer' isn't known
proxymini.c:712: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'
proxymini.c: At top level:
proxymini.c:809: warning: 'struct sockaddr_in' declared inside parameter list
proxymini.c:809: error: conflicting types for 'myconnect'
proxymini.c:113: error: previous declaration of 'myconnect' was here
proxymini.c: In function 'myconnect':
proxymini.c:810: error: storage size of 'peerl' isn't known
proxymini.c:815: error: 'INADDR_NONE' undeclared (first use in this function)
proxymini.c:824: error: dereferencing pointer to incomplete type
proxymini.c:824: error: dereferencing pointer to incomplete type
proxymini.c:838: error: dereferencing pointer to incomplete type
proxymini.c:839: error: dereferencing pointer to incomplete type
proxymini.c:840: error: dereferencing pointer to incomplete type
proxymini.c:842: error: 'IPPROTO_TCP' undeclared (first use in this function)
proxymini.c:847: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'
proxymini.c:849: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'
proxymini.c: In function 'resolv':
proxymini.c:946: error: 'INADDR_NONE' undeclared (first use in this function)
proxymini.c: In function 'dnsdb':
proxymini.c:976: error: 'INADDR_NONE' undeclared (first use in this function)
proxymini.c: In function 'get_ifaces':
proxymini.c:1052: error: 'IPPROTO_TCP' undeclared (first use in this function)
proxymini.c:1079: error: dereferencing pointer to incomplete type
proxymini.c:1080: error: dereferencing pointer to incomplete type
proxymini.c:1080: error: 'INADDR_NONE' undeclared (first use in this function)
proxymini.c:1082: error: dereferencing pointer to incomplete type
proxymini.c:1084: error: dereferencing pointer to incomplete type
proxymini.c: In function 'get_sock_ip_port':
proxymini.c:1096: error: storage size of 'peer' isn't known
proxymini.c:1099: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'
proxymini.c:1102: error: 'INADDR_NONE' undeclared (first use in this function)
proxymini.c: In function 'get_peer_ip_port':
proxymini.c:1112: error: storage size of 'peer' isn't known
proxymini.c:1115: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_in'


Top
 Profile  
 
 
 Post subject: Re: Help compiling proxymini on unix
PostPosted: 20 Mar 2011 16:23 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
it looks like on bsd you must specify an additonal "include".
try to make a: grep -rs INADDR_NONE /usr/include
it should tell you the name of the missing include file.

for example if INADDR_NONE is declared in /usr/include/asdf.h then you should add #include <asdf.h> at line 48 of proxymini.c

in my opinion it could be something like: #include <inet.h>


Top
 Profile  
 
 Post subject: Re: Help compiling proxymini on unix
PostPosted: 21 Mar 2011 01:20 

Joined: 24 Jan 2011 13:58
Posts: 27
This is what I get.I do not know what it means.
Code:
> grep -rs INADDR_NONE /usr/include
/usr/include/netinet/in.h:#define       INADDR_NONE             0xffffffff     /* -1 return */


Top
 Profile  
 
 Post subject: Re: Help compiling proxymini on unix
PostPosted: 21 Mar 2011 02:33 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
ok add the following at line 48 of proxymini.c:
#include <netinet/in.h>


Top
 Profile  
 
 Post subject: Re: Help compiling proxymini on unix
PostPosted: 21 Mar 2011 22:31 

Joined: 24 Jan 2011 13:58
Posts: 27
I added #include <netinet/in.h> on line 48.Then executed this.
Code:
> gcc -o proxymini proxymini.c -lpthread
proxymini.c: In function 'main':
proxymini.c:238: warning: cast to pointer from integer of different size
>

There is a compiled binary in the directory.I do not know if it has been compiled correctly because of the error.What does the error mean?I checked like 238 but I do not understand it.
I think the error could be crucial because proxymini does not open any port for incoming connections.


Last edited by fango on 22 Mar 2011 21:55, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Help compiling proxymini on unix
PostPosted: 21 Mar 2011 23:12 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
it's correct, that one is only an useless warning so the executable is ok


Top
 Profile  
 
 Post subject: Re: Help compiling proxymini on unix
PostPosted: 22 Mar 2011 21:47 

Joined: 24 Jan 2011 13:58
Posts: 27
Thanks for the help.Could you please explain what "INADDR_NONE" mean? Is it a function or something else.I'm total noob :)


Top
 Profile  
 
 Post subject: Re: Help compiling proxymini on unix
PostPosted: 23 Mar 2011 01:41 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
it's a define, practically something like an "alias"
for example if I use #define BLAH 1234 then everytime I use BLAH in my code it's exactly like if I use 1234


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for: