From owner-freebsd-questions Sat Mar 2 4:11:38 2002 Delivered-To: freebsd-questions@freebsd.org Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by hub.freebsd.org (Postfix) with ESMTP id 03AA337B400 for ; Sat, 2 Mar 2002 04:11:36 -0800 (PST) Received: by elvis.mu.org (Postfix, from userid 1192) id CC4E5AE25A; Sat, 2 Mar 2002 04:11:35 -0800 (PST) Date: Sat, 2 Mar 2002 04:11:35 -0800 From: Alfred Perlstein To: Aleksander Rozman - Andy Cc: freebsd-questions@FreeBSD.ORG Subject: Re: How to write code in FreeBSD Message-ID: <20020302121135.GV77980@elvis.mu.org> References: <5.0.2.1.0.20020302125303.02c1ca90@164.8.8.5> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.0.2.1.0.20020302125303.02c1ca90@164.8.8.5> User-Agent: Mutt/1.3.27i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Aleksander Rozman - Andy [020302 04:01] wrote: > > Hi ! Hello, don't cc' both questions and hackers. > > I was wondering if there are any guidelines how to write code in FreeBSD. I > have taken a look at several code of FreeBSD but each is written > differently? Problem is I don't know which is preferred way. man 9 style > Reason I am asking this is that I am trying to add some code to kernel. > Compile is OK, no error, no warning, but on link all variables defined with > extern are marked as : undefined reference to 'variable', variable is > extern and .h file which has it defined is included... Where can be the > problem?? Another problem is that I get multiple definition error...how can > I get over this. By learning how to properly link C code. Perhaps if you gave us some sample code, how you compile and link it and the error messages you actually get it would help some. -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message