compile: link dynamic OR static library in Windows

user1234 user1234 at 12.de
Sun Feb 5 13:37:16 UTC 2023


On Sunday, 5 February 2023 at 11:52:01 UTC, Alexander Zhirov 
wrote:
> On Saturday, 4 February 2023 at 15:56:41 UTC, Richard (Rikki) 
> Andrew Cattermole wrote:
>> [...]
>
> I don't understand why the compiler doesn't see the library.
>
> ```sh
> User at WIN-D3SHRBHN7F6 MINGW64 /home/user/pxe-restore/source
> # ls -la "C:\Program Files\PostgreSQL\15\lib\libpq.lib"
> -rw-r--r-- 1 User Отсутствует 37002 Nov  9 06:45 'C:\Program 
> Files\PostgreSQL\15\lib\libpq.lib'
>
> User at WIN-D3SHRBHN7F6 MINGW64 /home/user/pxe-restore/source
> # dmd -i app.d -L'C:\Program Files\PostgreSQL\15\lib\libpq.lib'
> lld-link: error: could not open 'pq.lib': no such file or 
> directory
> Error: linker exited with status 1
> ```

try

```
dmd -i app.d -L'-LC:\Program Files\PostgreSQL\15\lib' -Llpq
```

the first linker command gives a search path, the second a 
libname.


More information about the Digitalmars-d-learn mailing list