Skip to content

Commit 4090b4f

Browse files
committed
Add documentation about library files on Windows (issue #276)
Document that .dll.a is the correct import library format for GCC toolchains (MSYS2/MinGW, Cygwin), and that .lib files are MSVC-specific. Also add linking examples using pkg-config and manual flags. Closes #276
1 parent 25990b0 commit 4090b4f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,31 @@ configure: WARNING: Building from MSYS environment. Binaries will depend on msys
163163

164164
Consider switching to the MinGW64 shell for native Windows binaries.
165165

166+
#### Library files on Windows
167+
168+
When building with GCC-based toolchains (MSYS2/MinGW, Cygwin), the following library files are generated:
169+
170+
| File | Purpose |
171+
|------|---------|
172+
| `libhttpserver.a` | Static library archive |
173+
| `libhttpserver.dll` | Shared library (DLL) |
174+
| `libhttpserver.dll.a` | Import library for linking against the DLL |
175+
| `libhttpserver.la` | Libtool archive (used by libtool during linking) |
176+
177+
**Note about `.lib` files:** The `.dll.a` format is the import library format used by GCC toolchains. If you're looking for `.lib` files, those are the MSVC (Microsoft Visual C++) import library format and are only generated when building with the MSVC toolchain. The `.dll.a` file serves the same purpose as `.lib` but for GCC-based compilers.
178+
179+
**Linking against libhttpserver:**
180+
181+
Using pkg-config (recommended):
182+
```bash
183+
g++ myapp.cpp $(pkg-config --cflags --libs libhttpserver) -o myapp
184+
```
185+
186+
Manual linking:
187+
```bash
188+
g++ myapp.cpp -I/mingw64/include -L/mingw64/lib -lhttpserver -lmicrohttpd -o myapp
189+
```
190+
166191
[Back to TOC](#table-of-contents)
167192

168193
## Getting Started

0 commit comments

Comments
 (0)