Note that there are some explanatory texts on larger screens.

plurals
  1. POCompilation error involving functions being declared twice and the types being different
    primarykey
    data
    text
    <p>When I try to compile my simple starter program, I get the following error:</p> <pre><code>In file included from processcommand.c:1: processcommand.h:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token processcommand.c:3: error: conflicting types for 'getinput' processcommand.h:3: error: previous declaration of 'getinput' was here processcommand.c: In function 'getinput': processcommand.c:8: warning: return makes integer from pointer without a cast processcommand.c: At top level: processcommand.c:12: error: conflicting types for 'printoutput' processcommand.h:4: error: previous declaration of 'printoutput' was here </code></pre> <p>My code files are: <strong>main.c</strong></p> <pre><code>#include "main.h" int main() { float version = 0.2; printf("Qwesomeness Command Interprepter version %f by Zeb McCorkle starting...\n", version); printf("%s", getcommand()); } </code></pre> <p><strong>main.h</strong></p> <pre><code>#include "includes.h" int main(); </code></pre> <p><strong>includes.h</strong></p> <pre><code>#include &lt;stdio.h&gt; #include &lt;string.h&gt; </code></pre> <p><strong>processcommand.c</strong></p> <pre><code>#include "processcommand.h" getinput() { char *output; printf(" "); scanf("%s", output); return output; } printoutput(char *input) { printf("%s", input); return 0; } getcommand() { printoutput("Command:"); return getinput(); } </code></pre> <p><strong>processcommand.h</strong></p> <pre><code>#include "includes.h" char *getinput(); unsigned char printoutput(char *input); char *getcommand(); </code></pre> <p>I believe that those are all of my source files. I compiled with</p> <pre><code>gcc main.c processcommand.c </code></pre> <p>Thank you for reading this.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload