Estou em uma plataforma Windows utilizando VS code, com o gcc do mingw de compilador e a extensão code runner do Vscode para rodar o código, eu tenho todos esses arquivos citados abaixo na mesma pasta e mesmo assim está dando esse erro.
main.c:
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <windows.h>
#include "funcoes.h"
int main(){
helloworld();
getch();
return 0;
}
funcoes.c:
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <windows.h>
#include "funcoes.h"
void helloworld(){
printf("Hello World");
}
funcoes.h:
#ifndef FUNCOES_H_INCLUDED
#define FUNCOES_H_INCLUDED
void helloworld();
#endif // FUNCOES_H_INCLUDED
Mensagem de erro:
PS D:\Projetos\Allegroteste> cd "d:\Projetos\Allegroteste\" ; if ($?) { gcc tempCodeRunnerFile.c -o tempCodeRunnerFile } ; if ($?) { start .\tempCodeRunnerFile } C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\GUSTAV~1\AppData\Local\Temp\ccVT118J.o:tempCodeRunnerFile.c:(.text+0xe): undefined reference to `helloworld' collect2.exe: error: ld returned 1 exit status PS D:\Projetos\Allegroteste>