From mboxrd@z Thu Jan 1 00:00:00 1970 From: cmorrow132@gmail.com (Matt M) Date: Thu, 11 Aug 2016 19:25:45 +0000 Subject: Kernel module compilation errors Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org I am just getting started with kernel module development, and I can't get anything to compile. I get the following errors: In file included from main.c:1:0: /usr/src/linux/include/linux/init.h:142:13: error: expected ?=?, ?,?, ?;?, ?asm? or ?__attribute__? before ?load_default_modules? void __init load_default_modules(void); ^~~~~~~~~~~~~~~~~~~~ /usr/src/linux/include/linux/init.h:143:12: error: expected ?=?, ?,?, ?;?, ?asm? or ?__attribute__? before ?init_rootfs? int __init init_rootfs(void); ^~~~~~~~~~~ /usr/src/linux/include/linux/init.h:285:13: error: expected ?=?, ?,?, ?;?, ?asm? or ?__attribute__? before ?parse_early_param? void __init parse_early_param(void); ^~~~~~~~~~~~~~~~~ /usr/src/linux/include/linux/init.h:286:13: error: expected ?=?, ?,?, ?;?, ?asm? or ?__attribute__? before ?parse_early_options? void __init parse_early_options(char *cmdline); The errors go on and on, but the majority look like that. My code: #include #include int main() { return 0; } The compile command: gcc -I /usr/src/linux/include/ main.c Thanks in advance for any help -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160811/aacb7cd0/attachment.html