Commit 7854bfc
committed
[qtbase] Fix LNK2005 in consumers defining QT_DISABLE_DEPRECATED_BEFORE
On Windows static builds, compat/removed_api.cpp emits strong symbol
definitions for deprecated APIs. If consumers compile with a higher
QT_DISABLE_DEPRECATED_BEFORE value, those same functions become inline
definitions in consumer translation units, causing LNK2005 duplicate
symbol errors.
Linux and macOS linkers silently resolve this by preferring the strong
symbol, so the issue is Windows-only.
Compiling removed_api.cpp with a high QT_DISABLE_DEPRECATED_BEFORE
ensures its symbols are also emitted as inline definitions, which the
linker silently deduplicates against consumer copies.1 parent 8f54eb2 commit 7854bfc
File tree
5 files changed
+19
-1
lines changed- ports/qtbase
- versions
- q-
5 files changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8274 | 8274 | | |
8275 | 8275 | | |
8276 | 8276 | | |
8277 | | - | |
| 8277 | + | |
8278 | 8278 | | |
8279 | 8279 | | |
8280 | 8280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
3 | 8 | | |
4 | 9 | | |
5 | 10 | | |
| |||
0 commit comments