From owner-freebsd-hackers Sat Mar 2 10: 6:10 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (Postfix) with SMTP id C877537B41A; Sat, 2 Mar 2002 10:05:52 -0800 (PST) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 2 Mar 2002 18:05:51 +0000 (GMT) Date: Sat, 2 Mar 2002 18:05:51 +0000 From: David Malone To: Aleksander Rozman - Andy Cc: freebsd-hackers@FreeBSD.ORG, freebsd-questions@FreeBSD.ORG Subject: Re: How to write code in FreeBSD Message-ID: <20020302180551.GA26208@walton.maths.tcd.ie> 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.25i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Mar 02, 2002 at 12:57:29PM +0100, Aleksander Rozman - Andy wrote: > 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. Most code in FreeBSD is written according to the rules in the style(9) man page. Code which has been imported from other projects is usually not subject to these guidelines. > 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. It's almost impossible to say without seeing the code. Can you produce a short example and say how you are compiling and linking it into the kernel. David. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message