-4

I started recently with programming and this is what I wrote:

#include <stdio.h>
int main() {
    int a,b,c;

    a=2;
    b=7;
    c=a+b;

    printf ("c vale %d\n;c");

    return 0;
}

Something simple I thought but then this error tends to appear:

C:/MinGW/i686-pc-mingw32/lib/libmingw32.a(lib32_libmingw32_a-crt0_c.o):crt0_c.c:(.text+0x3c): undefined reference to `WinMain@16'

can anyone explain me step by step what should I fix?

jpw
  • 44,361
  • 6
  • 66
  • 86

1 Answers1

0

Compile as console and change this line

   printf ("c vale %d\n;c");

to

    printf ("c vale %d\n", c);  // vale or value ???
BobRun
  • 756
  • 5
  • 12
  • 2
    _Compile as console_ isn't that informative. If one has to ask this kind of question, one isn't likely to know how to change that information. – Tas Nov 14 '15 at 23:54
  • 1
    I agree with Tas. Although *"compile as console"* is correct, it's not helpful unless you explain *how* to compile as console. – user3386109 Nov 14 '15 at 23:58