Sublime Forum

Compiling with multiple libraries? // Makefile . ( C program )

#1

I am unable to link the libraries created.
The build system that is created as follows:

{
“windows”:
{
“cmd”: [“g++”, “$file_name”,"-o", “${file_base_name}.exe”, “-lm”, “-Wall”, “&”,“start”, “${file_base_name}.exe”]
},
“selector”: “source.cpp, source.c”,
“shell”: true,
“working_dir”: “${file_path}”
}

At the root folder I have the files:
teste1.c, include1.c, include2.c, include1.h, include2.h,

My code teste1.c:

#include “include1.h”
#include “include2.h”
#include <stdio.h>
int main(void){
printf("%d",func1());
printf("%d",func2());
return 0;
}

0 Likes