Closed jjang3 closed 11 months ago
The e9compile
script does not support seperate compilation. This is because the patch binary is very low-level with no support for any kind of linking.
The "correct" way to do it is to #include
everything into one big .c
file, e.g. in print.c
:
#include "sub.c"
...
Hello,
This is quite weird because somehow, what was working is not working for me, and I'm lost on why that is the case. I am using an old commit, but I am hoping to see by asking this question whether it might be possible to figure out how to use it on the latest commit or whether this is even feasible anymore (I am really sure it was working before).
So I have these fours files to add support for
extern
global variable (for special purpose):print.c
(I'm using the one fromexample
),sub.c
,sub.h
, andglobal.h
Files look like this:
After creating these files, I minimally modify
e9compile.sh
to add newsub.c
andsub.o
. It looks like this:This will create
sub.o
andprint.o
which I will now try to link:However, this causes a weird linking error I didn't face before, and now I'm wondering what went wrong.
Would you happen to have any suggestions on how to fix this problem? I looked through
stack_overflow
, but the answers suggest it is a linking order problem. But I changed the order and tried to do everything I could think of at the moment, but cannot find the fix for it.I would appreciate any suggestions. Kind regards.