Passing lots of C flas to the D compilers and DUB

data pulverizer data.pulverizer at gmail.com
Wed May 26 02:57:46 UTC 2021


Hi,

A [previous 
post](https://forum.dlang.org/post/hxlhyalzqmzzzihdjdof@forum.dlang.org) shows how to link individual C flags with `-L`, but is there a convenient way of linking lots of C flags? I've tried variations of

```
dmd `pkg-config --libs libR` `pkg-config --cflags libR`  main.d
dmd `pkg-config --cflags --libs libR`  main.d
dmd -L`pkg-config --cflags --libs libR`  main.d
...
```

for linking the R library C backend on Ubuntu Linux and it hasn't 
worked. I'm getting the usual unrecognized switch errors:

```
Error: unrecognized switch '-Wl,--export-dynamic'
Error: unrecognized switch '-fopenmp'
Error: unrecognized switch '-Wl,-Bsymbolic-functions'
Error: unrecognized switch '-Wl,-z,relro'
Error: unrecognized switch '-lR'
...
```


If there is a method, it would be really useful to know if and 
how it changes for the LDC compiler and also for DUB.

Many thanks


More information about the Digitalmars-d-learn mailing list