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

Undefined reference when using {.link.} pragma to link dynamic library #17453

Open
Clonkk opened this issue Mar 22, 2021 · 0 comments
Open

Undefined reference when using {.link.} pragma to link dynamic library #17453

Clonkk opened this issue Mar 22, 2021 · 0 comments

Comments

@Clonkk
Copy link
Contributor

Clonkk commented Mar 22, 2021

When using {.link: "path/to/lib/lib.so.} to link pragma, it can cause undefined reference issues because it is not placed at the end of the compilation line (typically if --as-needed is specifiedin the system gcc).

It is used in the manual chapter importcpp (https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma), and I believe it is a bad example to give as it may work or not depending on environment (It was typically breaking during CI but not locally for me).

I believe that either the manual should be changed to specify that {.link.} should not be used for libraries and no examples using it should be provided or {.link.} should be modified to place link argument at the end of the compile line.

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