I just started coding in C. I downloaded the C/C++ extension, ran VScode through command prompt… Everything was, so far, working perfeclty. But, I tried working with source and header file, and I got an error that I can’t get rid of.
Here are my three files:
main.c
#include <stdio.h>
#include <stdlib.h>
#include "area.h"
int main(int argc, char *argv[]) // Équivalent de int main()
{
double result;
result = areaRectangle(2.0,3.0);
printf("%f", result);
return 0;
}
area.h
#ifndef area_h
#define area_h
#include <stdio.h>
double areaRectangle(double , double);
#endif
area.c
#include "area.h"
double areaRectangle(double height, double lenght){
return height*lenght;
}
And then, here is the error code that I get when running main.c (I can’t copy paste the code since it’s in french, but i’ll do my best translating it):
main.obj : error LNK2019: unresolved external symbol _areaRectangle called in function _main
I don’t know where does the problem comes from… and I checked multiple times where does the error occurs…
Thanks for your help 🙂