vscode-amiga-vbcc-example
vscode-amiga-vbcc-example copied to clipboard
Linker issue?
I am trying to run a program consisting of several object files
if I only run main.o (build main exe) and display "helloWorld" in int main() its working fine
But the moment I add more object files (audio,game), it will not start with main()... it will build, but it will not work. FS-UAE is starting, normal OS screen is shown, but no error, nothing happens
_OBJ = audio.o game.o main.o
Only when removing audio.o and game.o again it will display HelloWorld
Whats going on here? That should have no effect if I include additional object files in a executable. The main() function which is unchanged should always work.
Any ideas?
btw before having this issue I had fixed the following build issue:
https://github.com/Sakura-IT/SonnetAmiga/issues/27
with adding the vbcc -mrel flag to the pre-existing Makefile
The main.o must be the first object in an amiga executable.
_obj = main.o ...
strangely no.
If i have _obj = main.o ,audio.o , build is succ but fails to execute main() If i have _obj = main.o, it executes main()
Also it seems all other objects files when added work fine... its just once I add audio.o it does not start main(). So its a singular issue with one specific object file.
Then it must be something specific with the audio.o. I bet its not the name but what it inside of it, no ?
yes its not the name - tested that. inside of audio.c/audio.h is just ordinary code (functions). maybe I will ask the creator of vbcc
To get to the root cause. Try to comment out parts of the code in audio.c until it works or until you reduced it to the problematic part.
thanks. I tried so. seems its about the datatypes library. I use NDK3.9 includes and copied the libs to the libs folder of my target (but its only amiga.lib, small.lib, debug.lib reaction.lib.. not more). seems I am missing some important libs. @prb28 Maybe this vscode plugin could add those as default? I see many different libs in the default setup. (m040, m060, many more). I do not know if they are part of NDK3.9 or what they do)
@ouya99 ,sorry for the delay, I've missed your question. This project is intended to be a example, not a complete sdk ready for work. So yes there are libs missing, but for now, I will not take it further. I'm more focused on the extension capabilities.
A simple solution could be using VC frontend for linking instead of directly calling VLink.
VC frontend with its config file aos68k is already used for compiling. This config file adds -mrel parameter when you ask him to link like this :
$(CC) $(CONFIG) -g -v $(OBJ) -o $(EXE)