Might be a duplicate but i wasn't able to find a answer for my question.
Usually if you want to import multiple functions from different c files in one main class, one would make a .h file and list up all functions from the .c sources.
My problem is, that all functions are wridden in .asm files. I used extern void asmFunc(int i, char c);
to use the function in further code, but they become more and more and i don't want to end up with 200 of those extern lines at the beginning of my main. How can i create a library.h with all assembly functions so i can just write #include "library.h"
at the beginning of my main class?
EDIT: I think i didn't give enough specific information:
- I use MINGW gcc and NASM to compile c and asm files
- I have to compile all files to .o first so i can match them
- The first answer i got didn't work because my compile chain is a bit complicated thanks to the restrictions i have on Windows (i want Linux back)
It looks like this: I got a folder containing three folders with seperated library-like structures: bwt (basic window toolkit), io and std (stuff like strlen) They are compiled into bwt.o io.o and std.o.
Now i want to make a .h file for each of them so i can #include "bwt.h"
in all kernel classes which need them. How do i get gcc to realize, that all functions in bwt.h are defined in bwt.o?