Directly compiling a D program with other libraries

Jeremy jtbx at disroot.org
Mon Mar 13 05:05:27 UTC 2023


Hello, I am new to this forum and to D.

I am trying to compile a basic D program with libraries 
(`requests` which requires `cachetools` and `automem`) without 
using dub. I have never used dub before, only a compiler.

The folders containing the libraries are in the same folder as 
main.d, the file I am trying to compile, and the command I am 
using to compile is `ldc2 -I. main.d`.

When I compile my program, I just get linker errors such as:
```
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: main.o: in function `_Dmain':
main.d:(.text._Dmain+0x2f): undefined reference to 
`_D8requests10getContentFNcAyaZSQBd7streams__T6BufferThZQk'
```

Does anyone have any advice on how to solve my problem?


More information about the Digitalmars-d-learn mailing list