<p dir="ltr">Yes the way comments are included within / ... / is wrong as there is an Asterisk after the / too . Compiler is not able to recognise the same.<br><br><br></p>
<div id='cm_signature'> via <a href="https://cloudmagic.com/k/d/mailapp?ct=pa&cv=8.5.49&pv=6.0.1&source=email_footer_2">CloudMagic Email</a> </div><div class="cm_quote" style=" color: #787878">On Mon, Jul 25, 2016 at 11:48 PM, Mike Krinkin <<a href="mailto:krinkin.m.u@gmail.com">krinkin.m.u@gmail.com</a>> wrote:</div><br><div id="oldcontent" style="background: rgb(255, 255, 255);"><blockquote style=""><p dir="ltr">On Mon, Jul 25, 2016 at 08:04:41PM +0200, hinawa wrote:<br>
> hello i am starting to write modules and this code does not compile<br>
> <br>
> hello.c:<br>
> <br>
> /********************<br>
> <br>
> Modulo experimental<br>
> <br>
> ********************/*</p>
<p dir="ltr">Probably, error is in the line above.</p>
<p dir="ltr">> <br>
> #include <linux/init.h><br>
> #include <linux/module.h><br>
> #include <linux/kernel.h><br>
> <br>
> MODULE_LICENSE("GPL");<br>
> MODULE_AUTHOR("Alberto Cerezo <ac90869@gmail.com>");<br>
> MODULE_DESCRIPTION("\"Hola Mundo\" Modulo experimental");<br>
> MODULE_VERSION("printk");<br>
> <br>
> static int __init hola_init(void)<br>
> {<br>
>         printk(KERN_INFO "Hola mundo\n");<br>
>         return 0;<br>
> }<br>
> <br>
> <br>
> static void __exit hola_exit(void)<br>
> {<br>
>         printk(KERN_INFO "Adios, me marcho\n");<br>
> }<br>
> <br>
> module_init(hola_init);<br>
> module_exit(hola_exit);<br>
> <br>
> <br>
> Makefile:<br>
> <br>
> obj-m += hello.o<br>
> <br>
> all:<br>
>         make -C /lib/modules/$(shell uname -r)/build M=${PWD} modules<br>
> clean:<br>
>         make -C /lib/modules/$(shell uname -r)/build M=${PWD} clean<br>
> <br>
> <br>
> error:<br>
> <br>
> In file included from <br>
> /usr/src/linux-headers-4.6.0-1-common/include/linux/init.h:4:0,<br>
> from <br>
> /home/hinawa/Documentos/programasC/modulos/mod1/hello.c:9:<br>
> /usr/src/linux-headers-4.6.0-1-common/include/linux/compiler.h:89:1: <br>
> error: expected identifier or ‘(’ before ‘struct’<br>
> struct ftrace_branch_data {<br>
> ^<br>
> make[4]: *** [/home/hinawa/Documentos/programasC/modulos/mod1/hello.o] <br>
> Error 1<br>
> make[3]: *** [_module_/home/hinawa/Documentos/programasC/modulos/mod1] <br>
> Error 2<br>
> make[2]: *** [sub-make] Error 2<br>
> make[1]: *** [all] Error 2<br>
> make: *** [all] Error 2<br>
> <br>
> <br>
> <br>
> I do not get to find the error because the code appears to be correct ...<br>
> <br>
> thks<br>
> <br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> Kernelnewbies@kernelnewbies.org<br>
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</p>
<p dir="ltr">_______________________________________________<br>
Kernelnewbies mailing list<br>
Kernelnewbies@kernelnewbies.org<br>
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies<br>
</p>
</blockquote></div>