From owner-freebsd-questions@FreeBSD.ORG Fri Nov 28 05:54:24 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 95AF016A4CE for ; Fri, 28 Nov 2003 05:54:24 -0800 (PST) Received: from ms-smtp-02.tampabay.rr.com (ms-smtp-02-smtplb.tampabay.rr.com [65.32.5.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C8C543FE5 for ; Fri, 28 Nov 2003 05:54:23 -0800 (PST) (envelope-from ka0ttic@cfl.rr.com) Received: from cfl.rr.com (237.92.35.65.cfl.rr.com [65.35.92.237]) hASDsKKD009189 for ; Fri, 28 Nov 2003 08:54:20 -0500 (EST) Message-ID: <3FC75380.3070706@cfl.rr.com> Date: Fri, 28 Nov 2003 08:54:08 -0500 From: Aaron Walker User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20031113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-questions@freebsd.org X-Enigmail-Version: 0.76.4.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Symantec AntiVirus Scan Engine Subject: compiler errors on freebsd; compiles fine on linux X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2003 13:54:24 -0000 I am attempting to write a http server (mainly just to learn), and I installed FreeBSD on my other box (I have Gentoo linux on my main box) to test the code to make sure its compatible with both BSD and Linux. The code compiles fine on linux, but I am getting weird compiler errors under FBSD. all my source files compile fine except main.c: #include #include #include "lwhttpd.h" #include "server.h" int main(int argc, char *argv[]) { struct in_addr local_addr; uint16_t port; /* setup defaults */ verbose = 1; local_addr.s_addr = INADDR_ANY; port = 0; nchildren = 5; server_init(local_addr, port); return 0; } gcc -c -g main.c produces: In file included from main.c:1: /usr/include/netinet/in.h:235: syntax error before `in_addr_t' /usr/include/netinet/in.h:287: syntax error before `u_char' In file included from /usr/include/netinet/in.h:487, from main.c:1: /usr/include/netinet6/in6.h:122: syntax error before `u_int8_t' /usr/include/netinet6/in6.h:144: syntax error before `u_int8_t' /usr/include/netinet6/in6.h:149: syntax error before `u_int32_t' /usr/include/netinet6/in6.h:608: syntax error before `struct' /usr/include/netinet6/in6.h:610: syntax error before `__P' /usr/include/netinet6/in6.h:611: syntax error before `__P' /usr/include/netinet6/in6.h:612: syntax error before `__P' /usr/include/netinet6/in6.h:614: syntax error before `*' /usr/include/netinet6/in6.h:615: syntax error before `__P' /usr/include/netinet6/in6.h:616: syntax error before `__P' /usr/include/netinet6/in6.h:618: syntax error before `inet6_rthdr_space' /usr/include/netinet6/in6.h:619: syntax error before `__P' /usr/include/netinet6/in6.h:620: syntax error before `__P' /usr/include/netinet6/in6.h:622: syntax error before `__P' /usr/include/netinet6/in6.h:626: syntax error before `__P' /usr/include/netinet6/in6.h:627: syntax error before `__P' /usr/include/netinet6/in6.h:628: syntax error before `__P' /usr/include/netinet6/in6.h:630: syntax error before `__P' /usr/include/netinet6/in6.h:631: syntax error before `__P' /usr/include/netinet6/in6.h:633: syntax error before `__P' /usr/include/netinet6/in6.h:634: syntax error before `__P' /usr/include/netinet6/in6.h:636: syntax error before `__P' /usr/include/netinet6/in6.h:638: syntax error before `__P' /usr/include/netinet6/in6.h:640: syntax error before `__P' /usr/include/netinet6/in6.h:641: syntax error before `inet6_rth_space' /usr/include/netinet6/in6.h:642: syntax error before `__P' /usr/include/netinet6/in6.h:643: syntax error before `__P' /usr/include/netinet6/in6.h:644: syntax error before `__P' /usr/include/netinet6/in6.h:645: syntax error before `__P' /usr/include/netinet6/in6.h:646: syntax error before `__P' In file included from /usr/include/sys/inttypes.h:9, from /usr/include/sys/types.h:48, from main.c:2: /usr/include/machine/ansi.h:118: syntax error before `typedef' main.c: In function `main': main.c:15: structure has no member named `s_addr' Any ideas why I am getting these errors? Obviously something with the headers, but why? I especially don't understand why s_addr would not be a memer of struct in_addr, because isn't that specified my POSIX? Sorry for the long post and thanks. Aaron