QT Creator 未定义引用链接器退出代码 1,没有 vtable 也没有程序集
QT Creator undefined reference linker exit code 1, no vtable nor assembly
我刚刚为一个运行良好的专有软件编辑代码。我将展示一些相关代码:
我之前通过 QT 处理过链接器错误,但这次程序似乎没有任何变化,但对特定文件的每个引用都返回为未定义。
SOURCES += \
main.cpp \
mainwindow.cpp \
program.cpp \
dv.cpp \
s.cpp \
l.cpp \
n.cpp \
t.cpp \
t_c.cpp
HEADERS += \
mainwindow.h \
program.h \
dv.h \
s.h \
l.h \
n.h \
t.h \
tt.h \
t_c.h
FORMS += \
mainwindow.ui \
dv.ui \
s.ui \
l.ui \
n.ui \
t.ui \
testframe.ui \
t_c.ui
Class program.h 除了所需的 Q 库(QMap、QString 等)
Class t_c.h 包括 program.h.
Class t.h 包括 program.h、tt.h(仅包括 Q 库)和 t_c.h
Class mainwindow.h 包括 program.h, dv.h, s.h, n.h, t.h
最近添加的是t_c.h的创建和添加之前program.h的函数坏了。我认为这将是 t.h 的一个问题,但是每个对 program.h 方法的引用都是 "undefined",即使在 mainwindow.cpp
/usr/bin/ld: mainwindow.o: in function `MainWindow::MainWindow(QWidget*)':
mainwindow.cpp:(.text+0x121): undefined reference to `Program::method(QString)'
undefined reference to ... [all the way down]
我试过清理,重新运行 qmake,删除构建文件夹。
Q 库之外没有外部库。没有 "assembly_86_64" 和 "vtable" 相关的错误。
由于某种原因,我在 QT 视图中压缩了一半的函数后,它们被清除了。
好的。
我刚刚为一个运行良好的专有软件编辑代码。我将展示一些相关代码:
我之前通过 QT 处理过链接器错误,但这次程序似乎没有任何变化,但对特定文件的每个引用都返回为未定义。
SOURCES += \
main.cpp \
mainwindow.cpp \
program.cpp \
dv.cpp \
s.cpp \
l.cpp \
n.cpp \
t.cpp \
t_c.cpp
HEADERS += \
mainwindow.h \
program.h \
dv.h \
s.h \
l.h \
n.h \
t.h \
tt.h \
t_c.h
FORMS += \
mainwindow.ui \
dv.ui \
s.ui \
l.ui \
n.ui \
t.ui \
testframe.ui \
t_c.ui
Class program.h 除了所需的 Q 库(QMap、QString 等)
Class t_c.h 包括 program.h.
Class t.h 包括 program.h、tt.h(仅包括 Q 库)和 t_c.h
Class mainwindow.h 包括 program.h, dv.h, s.h, n.h, t.h
最近添加的是t_c.h的创建和添加之前program.h的函数坏了。我认为这将是 t.h 的一个问题,但是每个对 program.h 方法的引用都是 "undefined",即使在 mainwindow.cpp
/usr/bin/ld: mainwindow.o: in function `MainWindow::MainWindow(QWidget*)':
mainwindow.cpp:(.text+0x121): undefined reference to `Program::method(QString)'
undefined reference to ... [all the way down]
我试过清理,重新运行 qmake,删除构建文件夹。
Q 库之外没有外部库。没有 "assembly_86_64" 和 "vtable" 相关的错误。
由于某种原因,我在 QT 视图中压缩了一半的函数后,它们被清除了。
好的。