{"id":1145,"date":"2022-08-30T15:13:08","date_gmt":"2022-08-30T15:13:08","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/linux-header-files-giving-syntax-error-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:13:08","modified_gmt":"2022-08-30T15:13:08","slug":"linux-header-files-giving-syntax-error-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/linux-header-files-giving-syntax-error-collection-of-common-programming-errors\/","title":{"rendered":"Linux header files giving syntax error-Collection of common programming errors"},"content":{"rendered":"<p>On trying to compile a program using <code>gcc<\/code> I get the following error.<\/p>\n<blockquote>\n<p>In file included from \/usr\/include\/unistd.h:218:0, from fcfssched.c:3: \/usr\/include\/x86_64-linux-gnu\/bits\/types.h:31:1:<\/p>\n<p>error: expected \u2018=\u2019, \u2018,\u2019, \u2018;\u2019, \u2018asm\u2019 or \u2018<strong>attribute<\/strong>\u2019 before \u2018typedef\u2019<\/p>\n<\/blockquote>\n<p>The error appears to be in the header file <code>\/bits\/types.h<\/code><\/p>\n<p>The second error is (probably) a result of the first.<\/p>\n<blockquote>\n<p>In file included from \/usr\/include\/stdlib.h:320:0, from fcfssched.c:5: \/usr\/include\/x86_64-linux-gnu\/sys\/types.h:34:1:<\/p>\n<p>error: unknown type name \u2018__u_char\u2019<\/p>\n<\/blockquote>\n<p>How do I solve this ?<\/p>\n<p>The header file appears to be fine. I just updated the headers using the <code>libc6-dev<\/code> package. I am using Ubuntu 12.04 x86 with Kernel 3.2.0-36-generic<\/p>\n<ol>\n<li>\n<p>This kind of error generally occurs in case of syntax error around the include directive in the user code.<\/p>\n<p>You should have a look in your sources if there is not a missing <code>;<\/code> or <code>}<\/code> near the include which falls by including <code>\/bits\/types.h<\/code> (following the inclusion tree).<\/p>\n<\/li>\n<li>\n<p>This error generally comes when you missed the (;) or (}) in the coding line. Kindly check the each line of code written by you.<\/p>\n<p>The best way to get the issue resolve is to start check the code reverse line by line from the error line received. Don&#8217;t check the standard files included in the project. The error comes from the your coded file.<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-09 23:32:12. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>On trying to compile a program using gcc I get the following error. In file included from \/usr\/include\/unistd.h:218:0, from fcfssched.c:3: \/usr\/include\/x86_64-linux-gnu\/bits\/types.h:31:1: error: expected \u2018=\u2019, \u2018,\u2019, \u2018;\u2019, \u2018asm\u2019 or \u2018attribute\u2019 before \u2018typedef\u2019 The error appears to be in the header file \/bits\/types.h The second error is (probably) a result of the first. In file included from [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1145","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1145"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1145\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}