Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot link against libraries other than InterfaceLib #207

Open
elliotnunn opened this issue May 6, 2023 · 1 comment
Open

Cannot link against libraries other than InterfaceLib #207

elliotnunn opened this issue May 6, 2023 · 1 comment

Comments

@elliotnunn
Copy link

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant