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

Link errors on MinGW #31

Closed
DiligentGraphics opened this issue Jan 24, 2019 · 5 comments
Closed

Link errors on MinGW #31

DiligentGraphics opened this issue Jan 24, 2019 · 5 comments

Comments

@DiligentGraphics
Copy link
Collaborator

When building the engine on MinGW, some applications fail to link due to duplicate symbols coming from the import library, which makes no sense. The size of import libraries is ridiculous for DLLs exporting just one public symbol. Apparently there is an issue with the linker that adds a bunch of stuff to the import library even though all symbols are hidden.

https://stackoverflow.com/questions/54331717/duplicate-symbol-defined-in-a-dll-import-library-in-mingw-build

@logzero
Copy link

logzero commented May 1, 2020

It is possible to tell the linker (ld) which symbols to export
https://stackoverflow.com/questions/435352/limiting-visibility-of-symbols-when-linking-shared-libraries

I've tried it with a simple test lib and it seems to work under mingw.

@TheMostDiligent
Copy link
Contributor

I thought this is what I was doing with -fvisibility=hidden and __attribute__((visibility("default"))). However, this all made no difference.

@TheMostDiligent
Copy link
Contributor

Did you manage to build Atmosphere sample?

@logzero
Copy link

logzero commented May 1, 2020

Took me a bit of trial-and-error, but I've got it to run.

There is another issue though. The samples using xinput don't link against it (-lxinput).

@TheMostDiligent
Copy link
Contributor

This commit fixes compile errors.

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

Successfully merging a pull request may close this issue.

2 participants