Ich bin nicht neu in Visual Studio und ich weiß, dass es viele Fragen dazu gibt. Aber ich kann das wirklich nicht herausfinden. Dies ist der Fehler:Nicht aufgelöster externer Link-Fehler in Visual Studio 2015
1>moc_displaycounter.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const Counter::staticMetaObject" ([email protected]@@[email protected]@B)
1>moc_displaymanometer.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const ManoMeter::staticMetaObject" ([email protected]@@[email protected]@B)
1>moc_displaysvgmeter.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const SVGMeter::staticMetaObject" ([email protected]@@[email protected]@B)
Also habe ich eine dumpbin/export auf der Import-Bibliothek und es gab dieses:
Microsoft (R) COFF/PE Dumper Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file analogwidgets.lib
File Type: LIBRARY
Exports
ordinal name
[email protected]@[email protected]@@@Z (public: __cdecl AbstractMeter::AbstractMeter(class QWidget *))
[email protected]@@[email protected]@B (public: static struct QMetaObject const Counter::staticMetaObject)
[email protected]@@[email protected]@B (public: static struct QMetaObject const Item::staticMetaObject)
[email protected]@@[email protected]@B (public: static struct QMetaObject const Led::staticMetaObject)
[email protected]@@[email protected]@B (public: static struct QMetaObject const ManoMeter::staticMetaObject)
[email protected]@@[email protected]@B (public: static struct QMetaObject const PotentioMeter::staticMetaObject)
[email protected]@@[email protected]@B (public: static struct QMetaObject const SVGMeter::staticMetaObject)
Ich habe die genaue Signatur auf der Import-Bibliothek. Für ein gutes Maß, habe ich abhängig verwendet, um zu überprüfen, dass diese Symbole in der DLL waren (ja, ich weiß, es spielt keine Rolle bei der Verknüpfung, sondern nur um sicherzustellen, dass die Import-Bibliothek nicht kaputt ist), aber immer noch Es wird nicht verlinkt. Versuchte mit Debug und Release x64 Builds ohne Erfolg. Zuvor hatte keine Probleme mit anderen Versionen von VS.
Irgendwelche Ideen, was ich als nächstes tun sollte?
Sieht so aus, als hätten Sie vergessen, einige statische Klassenvariablen zu definieren. –
Nicht aufgelöste externe Symbolfehler treten auf, wenn Sie etwas deklarieren, aber vergessen, es zu definieren. Könnte eine Elementfunktion oder eine statische Variable sein. –