Retro68
Retro68 copied to clipboard
Cannot link against libraries other than InterfaceLib
I cannot seem to make Retro68 link a code fragment against a system library other than InterfaceLib. Could you please tell me why my example doesn't build?
$ cat testapp.c
#include <DriverSynchronization.h>
int main(int argc, char **argv) {
SynchronizeIO();
return 0;
}
$ powerpc-apple-macos-gcc -c -o testapp.o testapp.c
$ powerpc-apple-macos-gcc -lDriverServicesLib -o testapp testapp.o
ld: testapp.o:testapp.c:(.pr+0x24): undefined reference to `.SynchronizeIO'
collect2: error: ld returned 1 exit status
I know that the linker is paying some attention to the -l argument because passing -lNonexistentLibraryName causes a different error.
Thanks!
Disregard!
The "-lDriverServicesLib" argument must go at the end of the GCC command line. This "dependency last" behaviour comes from GCC, and is not specific to Retro68.