I am trying to compile test.c with "fonction_lire.h and fonction_lire.c" included. The problem is that I get this error during compilation : The terminal process failed to launch (exit code: -1). When I click on "debug anyway" I get this message : "launch: program mypath\test.exe does not exist.
The file test.exe is not created during compilation.
An other question is that when I work in a folder, should a ".vscode" extension with launch.json and task.json need be created for each project or just one time for all my projects in the folder ?
Here is the structure of my folder
fonction_lire.c :
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "fonction_lire.h"
....
fonction_lire.h :
#ifndef H_FILE
#define H_FILE
void viderBuffer();
int lire(char* chaine,int longueur);
long lireLong();
double lireDouble();
#endif
test.c :
#include <stdlib.h>
#include <stdio.h>
#include "fonction_lire.h"
int main(int argc, char *argv[])
{
double poid = 0;
printf("Combien pesez vous ? ");
poid = lireDouble();
printf("Ah ! Vous pesez donc %f kg !\n\n", poid);
return 0;
}
Executing task: C/C++: gcc.exe build active file
Starting build...
C:\msys64\mingw64\bin\gcc.exe -fdiagnostics-color=always -g "C:\Users\Matt7\OneDrive - student.helmo.be\Bureau\MyCApp\fonction_lire\test.c" -o "C:\Users\Matt7\OneDrive - student.helmo.be\Bureau\MyCApp\fonction_lire\test.exe"
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Matt7\AppData\Local\Temp\ccXChbyj.o: in function main': C:/Users/Matt7/OneDrive - student.helmo.be/Bureau/MyCApp/fonction_lire/test.c:10: undefined reference to
lireDouble'
collect2.exe: error: ld returned 1 exit status
Build finished with error(s).
- The terminal process failed to launch (exit code: -1).
- Terminal will be reused by tasks, press any key to close it.
I want to compile the test.c file without error. I also want to understand whether I need to create a ".vscode" folder for each project and how i can do this.