Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Mar 2002 18:05:51 +0000
From:      David Malone <dwmalone@maths.tcd.ie>
To:        Aleksander Rozman - Andy <andy@kksonline.com>
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>
In-Reply-To: <5.0.2.1.0.20020302125303.02c1ca90@164.8.8.5>
References:  <5.0.2.1.0.20020302125303.02c1ca90@164.8.8.5>

next in thread | previous in thread | raw e-mail | index | archive | help
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-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020302180551.GA26208>