linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Error in compiling a module
@ 2010-07-27 21:17 Balachandar
  2010-07-27 22:30 ` Michal Nazarewicz
  2010-07-28  4:59 ` Mulyadi Santosa
  0 siblings, 2 replies; 12+ messages in thread
From: Balachandar @ 2010-07-27 21:17 UTC (permalink / raw)
  To: kernelnewbies, linux-c-programming

Hello,
 I am trying add a new network protocol family to the kernel. But i
get the following error for .h file  '11: two or more data types in
declaration specifiers


In .c file

18: static struct net_proto_family ucnet_family_ops = {
19:	.family = PF_UCNET,
20:	.create = sock_ucnet_create,
21:	.owner = THIS_MODULE,
22:        } ;


In .h file

11: int sock_ucnet_create(struct net *net, struct socket *sock, int
protocol, int KERN);


I appreciate any help

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Error in compiling a module
  2010-07-27 21:17 Error in compiling a module Balachandar
@ 2010-07-27 22:30 ` Michal Nazarewicz
  2010-07-28  4:59 ` Mulyadi Santosa
  1 sibling, 0 replies; 12+ messages in thread
From: Michal Nazarewicz @ 2010-07-27 22:30 UTC (permalink / raw)
  To: Balachandar; +Cc: kernelnewbies, linux-c-programming

Balachandar <bala1486@gmail.com> writes:
>  I am trying add a new network protocol family to the kernel. But i
> get the following error for .h file  '11: two or more data types in
> declaration specifiers

You've probably forgotten about semicolon when declaring a structure
before the function.

> In .h file
>
> 11: int sock_ucnet_create(struct net *net, struct socket *sock, int
> protocol, int KERN);

-- 
Best regards,                                         _     _
 .o. | Liege of Serenly Enlightened Majesty of      o' \,=./ `o
 ..o | Computer Science,  Michal "mina86" Nazarewicz   (o o)
 ooo +--<mina86-tlen.pl>--<jid:mina86-jabber.org>--ooO--(_)--Ooo--

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Error in compiling a module
  2010-07-27 21:17 Error in compiling a module Balachandar
  2010-07-27 22:30 ` Michal Nazarewicz
@ 2010-07-28  4:59 ` Mulyadi Santosa
  2010-07-28 17:28   ` Balachandar
  1 sibling, 1 reply; 12+ messages in thread
From: Mulyadi Santosa @ 2010-07-28  4:59 UTC (permalink / raw)
  To: Balachandar; +Cc: kernelnewbies, linux-c-programming

On Wed, Jul 28, 2010 at 04:17, Balachandar <bala1486@gmail.com> wrote:
> Hello,
>  I am trying add a new network protocol family to the kernel. But i
> get the following error for .h file  '11: two or more data types in
> declaration specifiers

Not sure how to solve that....as to me the message seems incomplete (right?).

Easiest way first: are you sure you have included all the neccessary
header files?

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Error in compiling a module
  2010-07-28  4:59 ` Mulyadi Santosa
@ 2010-07-28 17:28   ` Balachandar
  2010-07-29  4:51     ` Mulyadi Santosa
  0 siblings, 1 reply; 12+ messages in thread
From: Balachandar @ 2010-07-28 17:28 UTC (permalink / raw)
  To: Mulyadi Santosa; +Cc: kernelnewbies, linux-c-programming

On Wed, Jul 28, 2010 at 12:59 AM, Mulyadi Santosa
<mulyadi.santosa@gmail.com> wrote:
> On Wed, Jul 28, 2010 at 04:17, Balachandar <bala1486@gmail.com> wrote:
>> Hello,
>>  I am trying add a new network protocol family to the kernel. But i
>> get the following error for .h file  '11: two or more data types in
>> declaration specifiers
>
> Not sure how to solve that....as to me the message seems incomplete (right?).
>
> Easiest way first: are you sure you have included all the neccessary
> header files?
>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer and consultant
>
> blog: the-hydra.blogspot.com
> training: mulyaditraining.blogspot.com
>

Thank you for your help. I figured out the mistake. I missed a
semicolon in one of the header file that was included in the file that
showed the error.

Thanks,
Bala
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Error in compiling a module
  2010-07-28 17:28   ` Balachandar
@ 2010-07-29  4:51     ` Mulyadi Santosa
  2010-07-29 13:56       ` Victor Rodriguez
                         ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Mulyadi Santosa @ 2010-07-29  4:51 UTC (permalink / raw)
  To: Balachandar; +Cc: kernelnewbies, linux-c-programming

Hi...

On Thu, Jul 29, 2010 at 00:28, Balachandar <bala1486@gmail.com> wrote:
> Thank you for your help. I figured out the mistake. I missed a
> semicolon in one of the header file that was included in the file that
> showed the error.

I think it would be great if you and some guys here write about
"mistakes I ever did when I write kernel codes" in kernelnewbies
wiki....so that others might learn about it.

Just 2 cents suggestion...

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Error in compiling a module
  2010-07-29  4:51     ` Mulyadi Santosa
@ 2010-07-29 13:56       ` Victor Rodriguez
  2010-07-29 13:56       ` Victor Rodriguez
                         ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Victor Rodriguez @ 2010-07-29 13:56 UTC (permalink / raw)
  To: Mulyadi Santosa; +Cc: Balachandar, kernelnewbies, linux-c-programming

On Wed, Jul 28, 2010 at 11:51 PM, Mulyadi Santosa
<mulyadi.santosa@gmail.com> wrote:
>
> Hi...
>
> On Thu, Jul 29, 2010 at 00:28, Balachandar <bala1486@gmail.com> wrote:
> > Thank you for your help. I figured out the mistake. I missed a
> > semicolon in one of the header file that was included in the file that
> > showed the error.
>
> I think it would be great if you and some guys here write about
> "mistakes I ever did when I write kernel codes" in kernelnewbies
> wiki....so that others might learn about it.
>
> Just 2 cents suggestion...
>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer and consultant
>
> blog: the-hydra.blogspot.com
> training: mulyaditraining.blogspot.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Hey think it is a really god idea to write about common mistakes in
kernel codes.  I have one , I realize  that when you just copy and
paste the code for the makefiles from the Internet or PDF's it doesn't
compile the first time, you have to eliminate some tabs spaces  first;
for example in the The Linux Kernel Module Programming Guide there is
a simple hello-1.c and its makefile is .

obj-m += hello-1.o
all:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

when you run make in the terminal

make[1]: *** No rule to make target `-C'.  Stop.

Could appear

you have to copy in plain text or type yourself. well it is not a real
kenrel problem but mya help to others i realize it happens the first
time I compiled my "simplest module"

Thanks

Victor

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Error in compiling a module
  2010-07-29  4:51     ` Mulyadi Santosa
  2010-07-29 13:56       ` Victor Rodriguez
@ 2010-07-29 13:56       ` Victor Rodriguez
  2010-07-29 16:21       ` Michal Nazarewicz
  2010-07-29 18:10       ` Jim Cromie
  3 siblings, 0 replies; 12+ messages in thread
From: Victor Rodriguez @ 2010-07-29 13:56 UTC (permalink / raw)
  To: Mulyadi Santosa; +Cc: Balachandar, kernelnewbies, linux-c-programming

On Wed, Jul 28, 2010 at 11:51 PM, Mulyadi Santosa
<mulyadi.santosa@gmail.com> wrote:
>
> Hi...
>
> On Thu, Jul 29, 2010 at 00:28, Balachandar <bala1486@gmail.com> wrote:
> > Thank you for your help. I figured out the mistake. I missed a
> > semicolon in one of the header file that was included in the file that
> > showed the error.
>
> I think it would be great if you and some guys here write about
> "mistakes I ever did when I write kernel codes" in kernelnewbies
> wiki....so that others might learn about it.
>
> Just 2 cents suggestion...
>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer and consultant
>
> blog: the-hydra.blogspot.com
> training: mulyaditraining.blogspot.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Hey think it is a really god idea to write about common mistakes in
kernel codes.  I have one , I realize  that when you just copy and
paste the code for the makefiles from the Internet or PDF's it doesn't
compile the first time, you have to eliminate some tabs spaces  first;
for example in the The Linux Kernel Module Programming Guide there is
a simple hello-1.c and its makefile is .

obj-m += hello-1.o
all:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

when you run make in the terminal

make[1]: *** No rule to make target `-C'.  Stop.

Could appear

you have to copy in plain text or type yourself. well it is not a real
kenrel problem but mya help to others i realize it happens the first
time I compiled my "simplest module"

Thanks

Victor

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Error in compiling a module
  2010-07-29  4:51     ` Mulyadi Santosa
  2010-07-29 13:56       ` Victor Rodriguez
  2010-07-29 13:56       ` Victor Rodriguez
@ 2010-07-29 16:21       ` Michal Nazarewicz
  2010-07-29 17:52         ` Mulyadi Santosa
  2010-07-29 18:10       ` Jim Cromie
  3 siblings, 1 reply; 12+ messages in thread
From: Michal Nazarewicz @ 2010-07-29 16:21 UTC (permalink / raw)
  To: Mulyadi Santosa; +Cc: Balachandar, kernelnewbies, linux-c-programming

[-- Attachment #1: Type: text/plain, Size: 824 bytes --]

Mulyadi Santosa <mulyadi.santosa@gmail.com> writes:

> Hi...
>
> On Thu, Jul 29, 2010 at 00:28, Balachandar <bala1486@gmail.com> wrote:
>> Thank you for your help. I figured out the mistake. I missed a
>> semicolon in one of the header file that was included in the file that
>> showed the error.
>
> I think it would be great if you and some guys here write about
> "mistakes I ever did when I write kernel codes" in kernelnewbies
> wiki....so that others might learn about it.

Personally, I see it as a suggestion for a wikibooks or similar.

-- 
Best regards,                                         _     _
 .o. | Liege of Serenly Enlightened Majesty of      o' \,=./ `o
 ..o | Computer Science,  Michal "mina86" Nazarewicz   (o o)
 ooo +--<mina86-tlen.pl>--<jid:mina86-jabber.org>--ooO--(_)--Ooo--

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Error in compiling a module
  2010-07-29 16:21       ` Michal Nazarewicz
@ 2010-07-29 17:52         ` Mulyadi Santosa
  0 siblings, 0 replies; 12+ messages in thread
From: Mulyadi Santosa @ 2010-07-29 17:52 UTC (permalink / raw)
  To: Michal Nazarewicz; +Cc: Balachandar, kernelnewbies, linux-c-programming

2010/7/29 Michal Nazarewicz <mina86@tlen.pl>:
> Personally, I see it as a suggestion for a wikibooks or similar.


Good point...let's see if I can contribute something in that topic
too. Anybody could kindly help?

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Error in compiling a module
  2010-07-29  4:51     ` Mulyadi Santosa
                         ` (2 preceding siblings ...)
  2010-07-29 16:21       ` Michal Nazarewicz
@ 2010-07-29 18:10       ` Jim Cromie
  2010-07-29 20:23         ` Mulyadi Santosa
  3 siblings, 1 reply; 12+ messages in thread
From: Jim Cromie @ 2010-07-29 18:10 UTC (permalink / raw)
  To: Mulyadi Santosa; +Cc: Balachandar, kernelnewbies, linux-c-programming

On Wed, Jul 28, 2010 at 10:51 PM, Mulyadi Santosa
<mulyadi.santosa@gmail.com> wrote:
> Hi...
>
> On Thu, Jul 29, 2010 at 00:28, Balachandar <bala1486@gmail.com> wrote:
>> Thank you for your help. I figured out the mistake. I missed a
>> semicolon in one of the header file that was included in the file that
>> showed the error.
>
> I think it would be great if you and some guys here write about
> "mistakes I ever did when I write kernel codes" in kernelnewbies
> wiki....so that others might learn about it.
>
> Just 2 cents suggestion...
>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer and consultant


Hi Mulyadi,

Youre a regular here, and would have some "authority" on making recommendations.

The trouble I have with "edit the wiki" suggestions is that people
get intimidated by questions of "where to put stuff ?".

I just looked at HelpforBeginners
http://kernelnewbies.org/HelpForBeginners

and encountered this:
You are encouraged to edit the WikiSandBox whichever way you like.
Please restrain yourself from editing other pages until you feel at
home with the ways a wiki works.

The unintended message I got from this is "dont touch the other stuff",
which doesnt set the bar low enough to encourage contributions -
it implies that "judges" might not like your content or its placement.

my $.02 - perhaps we need a CatchAll bucket for content that could be useful,
but contributor doesnt know where to put it.  Organization could come
afterwards.
You cant sort a deck of cards until youve got the cards, and once you
do, its trivial
to determine that the 10-of-Spades is missing.

The bit Id add, in response to the now solved problem, would be:

Try making the *.i file to trace down whats missing (or not missing)

make -C /home/jimc/lx/linux-2.6.git O=/home/jimc/lx/sk/. drivers/hwmon/pc87360.i
  Using /home/jimc/lx/linux-2.6.git as source for kernel
  ....
  CPP [M] drivers/hwmon/pc87360.i

wrt Victor's post, my impression was that the real error was not spaces/tabs
but lack of linkage to the src tree...

$> make O=../<mybuilddir> defconfig
will write a new Makefile into the build dir, so you can make further
from there,
ie copy in an old .config, then make oldconfig to update it per latest source.

[jimc@harpo sk]$ make
make -C /home/jimc/lx/linux-2.6.git O=/home/jimc/lx/sk/.
  Using /home/jimc/lx/linux-2.6.git as source for kernel
  GEN     /home/jimc/lx/sk/Makefile
  CHK     include/linux/version.h

His hint is useful and valuable in the right place, but I dont know
where that is
at this point, and I suspect many potential contributors would appreciate
more specific guidance, or a default place that can be organized once it
gets some content.

thanks

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Error in compiling a module
  2010-07-29 18:10       ` Jim Cromie
@ 2010-07-29 20:23         ` Mulyadi Santosa
  2010-07-29 20:35           ` Greg Freemyer
  0 siblings, 1 reply; 12+ messages in thread
From: Mulyadi Santosa @ 2010-07-29 20:23 UTC (permalink / raw)
  To: Jim Cromie; +Cc: Balachandar, kernelnewbies, linux-c-programming

On Fri, Jul 30, 2010 at 01:10, Jim Cromie <jim.cromie@gmail.com> wrote:
> Hi Mulyadi,
>
> Youre a regular here, and would have some "authority" on making recommendations.

Oh please, I am just ordinary member :)

Uhm, maybe someone should contact Rik and talk about it. Or, at least,
everybody write their own mistakes when dealing with kernel dev on
their blog...that way, at least it is documented. So when the time
comes, it would simply be links to them.

Maybe just a simple idea that pops from my head...

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Error in compiling a module
  2010-07-29 20:23         ` Mulyadi Santosa
@ 2010-07-29 20:35           ` Greg Freemyer
  0 siblings, 0 replies; 12+ messages in thread
From: Greg Freemyer @ 2010-07-29 20:35 UTC (permalink / raw)
  To: Mulyadi Santosa
  Cc: Jim Cromie, Balachandar, kernelnewbies, linux-c-programming

On Thu, Jul 29, 2010 at 4:23 PM, Mulyadi Santosa
<mulyadi.santosa@gmail.com> wrote:
> On Fri, Jul 30, 2010 at 01:10, Jim Cromie <jim.cromie@gmail.com> wrote:
>> Hi Mulyadi,
>>
>> Youre a regular here, and would have some "authority" on making recommendations.
>
> Oh please, I am just ordinary member :)

I nominate Mulyadi KernelNewbie Distinguished Penguin in honor of
services rendered.

In honor of that, he is to so sign all future emails to the
kernelnewbies mailing list.

Greg (regular penguin, of the family Gecko)

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-07-29 20:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-27 21:17 Error in compiling a module Balachandar
2010-07-27 22:30 ` Michal Nazarewicz
2010-07-28  4:59 ` Mulyadi Santosa
2010-07-28 17:28   ` Balachandar
2010-07-29  4:51     ` Mulyadi Santosa
2010-07-29 13:56       ` Victor Rodriguez
2010-07-29 13:56       ` Victor Rodriguez
2010-07-29 16:21       ` Michal Nazarewicz
2010-07-29 17:52         ` Mulyadi Santosa
2010-07-29 18:10       ` Jim Cromie
2010-07-29 20:23         ` Mulyadi Santosa
2010-07-29 20:35           ` Greg Freemyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).