Retro68 icon indicating copy to clipboard operation
Retro68 copied to clipboard

Cannot link against libraries other than InterfaceLib

Open elliotnunn opened this issue 2 years ago • 1 comments

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!

elliotnunn avatar May 06 '23 11:05 elliotnunn

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.

elliotnunn avatar May 23 '23 03:05 elliotnunn