|
|
|
|
|
by robotpepi
131 days ago
|
|
I'm completely ignorant about this, but wouldn't it be possible to compile separately your project to improve compilation times? for instance, if you're using OP's vector library, which is self contained, you could compile that first and just once? |
|
What you can instead do is just put the add function declaration in add.h that just tells the compiler that add function takes two integers and returns an integer.
You can then put the add function definition in add.c , compile that to an add.o and link it to your main.o at link time to get your final binary - without having to recompile add.o every time you change your main.c.Precompiled headers: https://maskray.me/blog/2023-07-16-precompiled-headers