Quote:
Originally Posted by iBasher
I tried using:
Code:
# gcc main.c test.S -o test
-over 200 lines of warnings and errors-
How should I do this?
|
Generally, that's the correct command to use - gcc will produce object files for both the source files, and then try to link them.
Note that if you #include your test.h file in test.S, it should either not use anything that isn't valid assembly (such as function declarations) or these should be inside blocks like the following:
Code:
/* test.h */
/* Defines for both C and assembler. */
#define MY_VALUE 0x12
/* gcc predefines __ASSEMBLER__ when preprocessing assembly language */
#ifndef __ASSEMBLER__
/* Only seen by C code. */
int my_func(void);
#endif
If this doesn't help, try and deal with the
very first error you get (possibly by posting it here if you don't know how to fix it) and move on from there.