0

I tried to include <windows.h> with also <stdio.h> but it shows: tcc: undefined symbol '_MessageBoxA@16' when i use my only Pocket Edition TinyCCompiler. does anybody know why?

#include <stdio.h>
#include <winapi/windows.h>
#include <winapi/winuser.h>
/* ooops fell of my chair */
int main()
{
   char name[40];
   char age[6];
   printf("Enter name:");
   scanf("%39s", name);
   printf("\n");
   printf("Enter age:");
   scanf("%5s", age);
   printf("\n");
   printf("You: Hello my name is %s, and i'm %s years old.",name,age);
   printf("\n----------------OTHER PROGRAM----------");
   MessageBox(0, "Hello", "Hellodd", 1);
   return 0;
}
August Karlstrom
  • 10,773
  • 7
  • 38
  • 60
  • Have you followed the instructions in [tcc-win32.txt](https://github.com/LuaDist/tcc/blob/master/win32/tcc-win32.txt)? – Ted Lyngmo Mar 21 '22 at 15:17

1 Answers1

1

You need to link with user32:

tcc -Wall code.c -luser32
August Karlstrom
  • 10,773
  • 7
  • 38
  • 60