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
Option to disable pkg-config #444
Comments
The same problem with libupnp. This is libupnp's .pc file:
As you can see, there's -pthread option which dub is passing to the linker. Example dub output:
|
I can confirm this issue, it's quite annoying... |
For the time being, you could use the "dflags" or "lflags" fields to specify the necessary libraries manually. Not sure how to best approach this, since pkg-config generally outputs in GCC format, but DMD AFAIK doesn't allow to pass flags to the GCC linker command line verbatim. So the only real option seems to be to recognize the |
If you have the necessary time, then that would be great. |
There is now an option in DMD to pass arguments directly to CC: dlang/dmd#10441 Unfortunately it still requires handling directly from |
I had problem with manually built ffmpeg libs and pkg-config on Ubuntu 14.04. The problem with ffmpeg's pkg-config was that it appended "-pthread" to libs arguments and dmd/gdc was always returning with /usr/bin/ld error "unrecognized option
-pthread
".This option may be passed to gcc when compiling sources. Unfortunately, when gcc is used as a linker (without specifying any sources, as dub/dmd does in linking stage) it passes all params to gnu LD. LD linker does not support "-phtread" option (instead one must use "-lpthread"). I also tried with gold linker, but the error was exactly the same.
Please consider adding an option to disable pkg-config's library resolution. Personally, I'm fine with setting "libs" manually. Another option may be skipping "-pthread" parameter when passing pkg-config --libs to the linker.
The text was updated successfully, but these errors were encountered: