I am writing a program that access registry keys using Windows APIs. I'm trying to compile my program with TCC but it's throwing an "undefined symbol" error regarding the functions I'm calling from the Windows APIs. I decided to try and compile it again with GCC and it works perfectly, no problems at all.
I've written programs that utilise Windows APIs before and compiled them perfectly fine with TCC, but whenever I try to compile anything that has something to do with the registry side of Windows APIs, it returns "undefined symbol" errors.
#include <stdio.h>
#include <Windows.h>
int main(int argc, char *argv[])
{
HKEY hkey = HKEY_LOCAL_MACHINE;
char key_name[] = "SOFTWARE\\7-zip";
HKEY key = NULL;
DWORD err = RegOpenKey(hkey, key_name, &key);
if (err != ERROR_SUCCESS)
{
printf("error opening key: %d\n", err);
}
else
{
printf("success");
}
}