Closed Rocco-Gossmann closed 10 months ago
Ah, I see what the problem is: since you're using rgbasm -E
, the anonymous labels are exported, and this is causing a link failure.
The fix is not to export anonymous labels, regardless of that flag.
Can confirm, that removing -E
from the rgbasm
command fixed the problem.
Thanks.
Just out of curiosity, What is the point of rgbds -E ...
?
Labels seem to be still exported, in the linking step when setting the -n
parameter.
rgblink ... -n$(TARGET).sym
Even if rgbds -E
was not set.
Imo, it serves no good purpose; but it's there, maybe for some legacy reason, and so we're keeping it to avoid breaking backwards compat.
The reason why these labels are still exported is because they are defined with ::
; -E
only affects labels defined with :
(or local labels defined with no colons).
Even without ::
, I still get this error. On the other hand, without -E
, there's no error, whether or not the asm uses ::
.
a.asm:
SECTION "a", ROM0[$00]
fn_a:
xor a
: nop
jr :-
b.asm:
SECTION "b", ROM0[$10]
fn_b:
xor a
: nop
jr :-
$ rgbasm -E -o a.o a.asm
$ rgbasm -E -o b.o b.asm
$ rgblink -t -o c.gb -n c.sym a.o b.o
error: "!0" both in b.o from b.asm(5) and in a.o from a.asm(5)
Hello,
I'm trying to learn the ropes of rgbds and I encountered an issue regarding the "Anonymous Labels" described here: https://rgbds.gbdev.io/docs/v0.6.1/rgbasm.5#Anonymous_labels
My Project has multiple asm files, which get compiled individualy and then linked together in the end.
Everything is managed via a Makefile.
this is my
main.asm
This is the
core/memory.inc
thatmain.asm
includes.And this is the
core/memory.asm
that contains the actual function that gets executed whenfill_mem()
is calledBoth
main.asm
andcore/memory.asm
get compiled individualy.and then linked together
which then results in this lovely little error here: