Qt ошибка undefined reference to imp

I use Qt Creator to make static C++ library and a Qt application for it.

My lib includes MyLib_global.h:

#if defined(MYLIB_LIBRARY)
#  define MYLIBSHARED_EXPORT Q_DECL_EXPORT
#else
#  define MYLIBSHARED_EXPORT Q_DECL_IMPORT
#endif

myclass.h file:

#include "MyLib_global.h"

class MYLIBSHARED_EXPORT MyClass : public QObject
{
    Q_OBJECT
    public:            
        enum Log
        {
            SomeValue,
            NotARealValue
        };
        MyClass(double var, Log e);
        ~MyClass();
}

And myclass.cpp file:

#include "myclass.h"

MyClass::MyClass(double var, Log e)
{
}
MyClass::~MyClass()
{
}

This block I wrote in .pro file:

QT       -= gui
QMAKE_CXXFLAGS += -std=c++0x
TARGET = MyLib
TEMPLATE = lib
CONFIG += staticlib

So I build this project using MinGW 4.7 32bit on Windows. Then I tried to include library in Qt GUI app by writing this in .pro file:

LIBS += -Ld:/l -lAgemarkerCore
INCLUDEPATH += d:/l/includes

«l» is a folder on my «D:» drive where I placed «libMyLib.a» file. In «d:/l/includes» folder I placed all headers from MyLib project.

Now I’m trying to create a new instance of MyClass in mainwindow.cpp file:

#include "myclass.h"

void MainWindow::someFunction()
{
    double var = 3.5;
    MyClass::Log enum_value = MyClass::SomeValue;
    MyClass* c = new MyClass(var, enum_value);
}

And there is a problem. After I compile this GUI project using the same computer placed in the same room running on the same system, the same IDE and the same compiler I used with MyLib, I get this error:

mainwindow.cpp:29: error: undefined reference to `_imp___ZN12MyClassC1EPdS0_S0_xiNS_3LogEi'

I searched lots of forums and tried few solutions that I’ve found, but they didn’t help. Most of this errors are concerned with GCC compiler, and simply changing the order of project files and libs helped with it, but I use MinGW with only one lib, therefore there isn’t any order of libs.

What can I do to link my library successful?

I use Qt Creator to make static C++ library and a Qt application for it.

My lib includes MyLib_global.h:

#if defined(MYLIB_LIBRARY)
#  define MYLIBSHARED_EXPORT Q_DECL_EXPORT
#else
#  define MYLIBSHARED_EXPORT Q_DECL_IMPORT
#endif

myclass.h file:

#include "MyLib_global.h"

class MYLIBSHARED_EXPORT MyClass : public QObject
{
    Q_OBJECT
    public:            
        enum Log
        {
            SomeValue,
            NotARealValue
        };
        MyClass(double var, Log e);
        ~MyClass();
}

And myclass.cpp file:

#include "myclass.h"

MyClass::MyClass(double var, Log e)
{
}
MyClass::~MyClass()
{
}

This block I wrote in .pro file:

QT       -= gui
QMAKE_CXXFLAGS += -std=c++0x
TARGET = MyLib
TEMPLATE = lib
CONFIG += staticlib

So I build this project using MinGW 4.7 32bit on Windows. Then I tried to include library in Qt GUI app by writing this in .pro file:

LIBS += -Ld:/l -lAgemarkerCore
INCLUDEPATH += d:/l/includes

«l» is a folder on my «D:» drive where I placed «libMyLib.a» file. In «d:/l/includes» folder I placed all headers from MyLib project.

Now I’m trying to create a new instance of MyClass in mainwindow.cpp file:

#include "myclass.h"

void MainWindow::someFunction()
{
    double var = 3.5;
    MyClass::Log enum_value = MyClass::SomeValue;
    MyClass* c = new MyClass(var, enum_value);
}

And there is a problem. After I compile this GUI project using the same computer placed in the same room running on the same system, the same IDE and the same compiler I used with MyLib, I get this error:

mainwindow.cpp:29: error: undefined reference to `_imp___ZN12MyClassC1EPdS0_S0_xiNS_3LogEi'

I searched lots of forums and tried few solutions that I’ve found, but they didn’t help. Most of this errors are concerned with GCC compiler, and simply changing the order of project files and libs helped with it, but I use MinGW with only one lib, therefore there isn’t any order of libs.

What can I do to link my library successful?

This topic has been deleted. Only users with topic management privileges can see it.

  • Hello,

    I’m rather new to Qt and do not have a lot of experience with C++. I’m trying to process data from a HID device (a joystick/gamepad) using Qt and Raw Input like described «here»:http://www.codeproject.com/Articles/185522/Using-the-Raw-Input-API-to-Process-Joystick-Input (it uses Visual C++ in the example, but the idea should be the same).

    When re-writing the example to Qt and trying to compile, I get an «undefined reference to `imp_'» error for each of the functions from the windows HID library.

    I have included the right header (hidsdi.h).

    Here I have reduced the code to almost the minimum required to tget this error:
    @#include <QCoreApplication>
    #include <windows.h>
    #include <hidsdi.h>

    int main(int argc, char *argv[])
    {
    PHIDP_PREPARSED_DATA pPreparsedData = NULL;
    HIDP_CAPS Caps;
    HidP_GetCaps(pPreparsedData, &Caps);

    QCoreApplication a(argc, argv);
    return a.exec&#40;&#41;;
    

    }@

    When trying to compile this will output:
    «undefined reference to `_imp__HidP_GetCaps@8′» — main.cpp:9
    «error: Id returned 1 exit status» — collect2.exe

    I’ve tried looking for a solution, but haven’t found one yet. It’s possible I’m missing something basic and/or obvious here.

    Thank you for your time.

  • It’s not a compiler error, but a linker error.

    The header file (.h) usually only contains the function declaration, while the actual implementation is in the corresponding library (.a or .lib) or source file (.cpp). In other words: Including the header file in the source file where you call the function is one thing, but you will also need to link against the corresponding library or compile+link the corresponding source file ;-)

  • Thank you for the quick reply.

    Does Qt only support .a (on Windows I assume) and .so (on Linux I assume)?
    I have found the hid.dll and hid.lib files in the Windows Driver Development Kit. Can I link the .lib file?

    I tried linking the .lib statically it to the project (using the GUI), but got an «No rule to make target [path to library]. Needed by [nameOfExe.exe]. Stop.» error.

    What other options do I have that I can look into? Dynamically loading the .dll?

  • This is nothing that concerns Qt! It concerns whatever C++ compiler/linker (MSVC, MinGW, GCC, etc) and what build system (Makefiles, Visual Studio, QtCreator, etc) you are using to create your software! Anyway, on the Windows platform «static» libraries have a .lib extension, but «import libraries»:http://en.wikipedia.org/wiki/Dynamic-link_library#Import_libraries for «shared» libraries (DLL files) also have a .lib extension. You never link against DLL files directly, only against the corresponding import library (.lib) — DLL’s are used at runtime! Under Linux, however, «static» libraries have a .a extension and «shared» libraries have a .so extension. Also, Linux doesn’t have anything like import libraries. You link against the .so file.

    Note confused yet?

    MinGW also uses .a library files on the Windows platform, but that does not mean you can use Linux .a files on Windows with MinGW. You can’t! ;-)

    __

    Anyway, how you link your binary against an additional library totally depends on what build system or IDE you are using. So which one you are using?

  • I’m using QtCreator and MinGW. How would I link the binary against the .lib? If I can’t, what should I change? Compile the code with Visual Studio? Or do I reconfigure QtCreator to use a different compiler/linker?

    Could I also work around it by loading the .dll using LoadLibrary? So for what I’ve looked into it seems it would make the code more messy.

  • Static linking is only possible if both pieces are compiled with the same compiler. The compile makes up names for your functions and variables etc. When two pieces of code are not compiled with the same compiler they do not find each other definitions. So, yes, compile with MS might do the trick. If you have a dll you could also use QLibrary for dynamic linking. The the compile issue is not relevant.

  • [quote author=»Grey Fox» date=»1398836084″]I’m using QtCreator and MinGW. How would I link the binary against the .lib?[/quote]

    For MinGW/GCC, you are using the «-l» linker option to link against some library. So, in order to link against «libfoo.a», simply add «-lfoo» to the linker flags (LDFLAGS). Note that the «lib…» and «.a» are added automatically.

    See also:
    http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html#Link-Options

    It seems Qt Creator has a wizard for this purpose:
    http://doc.qt.digia.com/qtcreator-2.3/creator-project-qmake-libraries.html

    [quote author=»Grey Fox» date=»1398836084″]Could I also work around it by loading the .dll using LoadLibrary?[/quote]

    Maybe you could. But then you would not only load the library via LoadLibrary(), at Runtime, you’d also have to look up and call the function via GetProcAddress(), at Runtime. And most important: Using this method, you still can not call the function directly, by using the declarations from the Header file, because that would still give you the linker error! Instead, you’ll now have to define the function prototype (function pointer type) yourself and call the function via the pointer that was returned by GetProcAddress().

    See also:
    http://msdn.microsoft.com/en-us/library/ms810279.aspx#dlldynamic_oldway

    BTW: Using the LoadLibrary+GetProcAddress is usually required only for optional dependencies, e.g. for functions that were not available on older OS versions. By using LoadLibrary+GetProcAddress you can use those functions on the newer OS versions but still make your application work on older OS. If, instead, you link against the DLL’s import library, your application won’t even start, if the required DLL (or the required function in that DLL) is missing.

    BTW2: Qt provides the QLibrary class, which can make things a bit easier.

  • Thanks for the replies.

    I’ll try to set up Qt Creator to use MSVC compiled QT and the MSVC compiler, as I only have a hidsdi.lib, not a hidsdi.a. If that fails, I’ll use QLibrary, I guess.

    In any case, I’ll post here on how it went or more question related to this if I get some.

  • If «hidsdi.lib» is the import library for your DLL file, you can probably just rename it to «libhidsdi.a» and link it with «-lhidsdi» with MinGW/GCC.

  • [quote author=»MuldeR» date=»1398883017″]If «hidsdi.lib» is the import library for your DLL file, you can probably just rename it to «libhidsdi.a» and link it with «-lhidsdi» with MinGW/GCC.[/quote]

    I misspoke before, it’s «hid.lib», not «hidsdi.lib», but that’s not important.

    I got the same «undefined reference» error when renamed the file to «libhid.a». Since the lib was compiled with MSVC, I guess I should try to set up the MSVC compiler next.

  • Renaming the file alone doesn’t help, of course. You need to make sure that it’s actually linked in! If the import library is “hid.lib”, then try renaming it to «libhid.a» and add «-lhid» to the linker options, as described above. Furthermore, you’ll have to make sure that «libhid.a» is in the library search path. You can add more library directories using the «-L» linker option.

  • [quote author=»MuldeR» date=»1398885791″]Renaming the file alone doesn’t help, of course. You need to make sure that it’s actually linked in! If the import library is “hid.lib”, then try renaming it to «libhid.a» and add «-lhid» to the linker options, as described above.[/quote]

    I did that, I apologize I did not mention that. I added the lib via the wizard in QT creator.

  • [quote author=»Grey Fox» date=»1398885881″]I added the lib via the wizard in QT creator.[/quote]

    Just to be sure:

    And did you make sure “-lhid” has actually been added to the linker options? It should now appear as an additional option in the final linker command…

  • [quote author=»MuldeR» date=»1398886337″][quote author=»Grey Fox» date=»1398885881″]I added the lib via the wizard in QT creator.[/quote]

    Just to be sure:

    And did you make sure “-lhid” has actually been added to the linker options? It should now appear as an additional option in the final linker command…[/quote]

    The .pro file did have: @LIBS += -L$$PWD/ -lhid@

    I had copied the lib to the project folder, which seems was my mistake. When I made copy of the lib and renamed it to libhid.a in it’s native directory (in WindowsKit folder, where it is together with many other libs), it worked!

    Lesson learned.

    Thank you for pointing me the right direction.

  • Good it worked for you. As a final note, the option «-L$$PWD/» means it will look for libraries in the current working directory — whatever that may happen to be. So it probably found the lib file after you placed it in the Windows SDK directory, not because of the «-L$$PWD/» command, but because the Windows SDK directory already was in your library search path anyway.

Problem Description:

I want to add python functions in C++ code.
The project is written using qt.

In Mask.pro I have:

...
INCLUDEPATH += "D:/workplace/Python/include"
LIBS += -L"D:/workplace/Python/libs"
...

In main.cpp I have:

#pragma push_macro("slots")
#undef slots
#include <Python.h>
#pragma pop_macro("slots")
...
PyObject *pName, *pModule, *pFunc;
PyObject *pArgs, *pValue;

Py_Initialize();
pName = PyUnicode_DecodeFSDefault("Morpho");

pModule = PyImport_Import(pName);
pFunc = PyObject_GetAttrString(pModule, 0);

Py_XDECREF(pFunc);
Py_DECREF(pModule);
...

Errors while compiling:

D:workplacePythonincludeobject.h:500: ошибка: undefined reference to `_imp___Py_Dealloc'
debug/main.o: In function `Py_DECREF':
D:/workplace/Python/include/object.h:500: undefined reference to `_imp___Py_Dealloc'
C:ProjectsCprojectQTMaskbuild-Mask-Desktop-Debug..Maskmain.cpp:99: ошибка: undefined reference to `_imp__Py_Initialize'
debug/main.o: In function `Z5qMainiPPc':
C:ProjectsCprojectQTMaskbuild-Mask-Desktop-Debug/../Mask/main.cpp:99: undefined reference to `_imp__Py_Initialize'
C:ProjectsCprojectQTMaskbuild-Mask-Desktop-Debug..Maskmain.cpp:100: ошибка: undefined reference to `_imp__PyUnicode_DecodeFSDefault'
C:ProjectsCprojectQTMaskbuild-Mask-Desktop-Debug..Maskmain.cpp:102: ошибка: undefined reference to `_imp__PyImport_Import'
C:ProjectsCprojectQTMaskbuild-Mask-Desktop-Debug..Maskmain.cpp:103: ошибка: undefined reference to `_imp__PyObject_GetAttrString'

I just can’t find what I am doing wrong or what I even could forget about.


Whole .pro file:

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++11

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

SOURCES += 
    QMTIFF.cpp 
    main.cpp 
    mainwindow.cpp 
    processingBlock.cpp

HEADERS += 
    QMTIFF.h 
    mainwindow.h 
    processingBlock.h

FORMS += 
    mainwindow.ui

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

DISTFILES += 
    Morpho.py

LIBS += -L"D:/workplace/Python/libs" -lpython310

INCLUDEPATH += "D:/workplace/Python/include"
DEPENDPATH += "D:/workplace/Python/include"

LIBS += -L"D:/Qt/Qt5.15.2/5.15.2/Src/qtimageformats/src/3rdparty/libtiff/libtiff" -ltiff

INCLUDEPATH += "D:/Qt/Qt5.15.2/5.15.2/Src/qtimageformats/src/3rdparty/libtiff/libtiff"
DEPENDPATH += "D:/Qt/Qt5.15.2/5.15.2/Src/qtimageformats/src/3rdparty/libtiff/libtiff"

All errors and warnings:

C:ProjectsCprojectQTMaskMaskQMTIFF.cpp:103: предупреждение: comparison between signed and unsigned integer expressions [-Wsign-compare]
..MaskQMTIFF.cpp: In constructor 'QMTIFF::QMTIFF(QString)':
..MaskQMTIFF.cpp:103:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     } while (n < NOfPages);
          ~~^~~~~~~~~~
C:ProjectsCprojectQTMaskMaskQMTIFF.cpp:53: предупреждение: unused parameter 'test' [-Wunused-parameter]
..MaskQMTIFF.cpp:53:24: warning: unused parameter 'test' [-Wunused-parameter]
 QMTIFF::QMTIFF(QString test)
                        ^~~~
C:ProjectsCprojectQTMaskMaskmain.cpp:17: предупреждение: unused variable 'Num' [-Wunused-variable]
..Maskmain.cpp: In function 'int qMain(int, char**)':
..Maskmain.cpp:17:18: warning: unused variable 'Num' [-Wunused-variable]
     unsigned int Num = 1190;
                  ^~~
C:ProjectsCprojectQTMaskMaskmain.cpp:25: предупреждение: unused variable 'from' [-Wunused-variable]
..Maskmain.cpp:25:9: warning: unused variable 'from' [-Wunused-variable]
     int from = 1001;
         ^~~~
C:ProjectsCprojectQTMaskMaskmain.cpp:26: предупреждение: unused variable 'to' [-Wunused-variable]
..Maskmain.cpp:26:9: warning: unused variable 'to' [-Wunused-variable]
     int to  =  1190;
         ^~
C:ProjectsCprojectQTMaskMaskmain.cpp:96: предупреждение: unused variable 'pArgs' [-Wunused-variable]
..Maskmain.cpp:96:15: warning: unused variable 'pArgs' [-Wunused-variable]
     PyObject *pArgs, *pValue;
               ^~~~~
C:ProjectsCprojectQTMaskMaskmain.cpp:96: предупреждение: unused variable 'pValue' [-Wunused-variable]
..Maskmain.cpp:96:23: warning: unused variable 'pValue' [-Wunused-variable]
     PyObject *pArgs, *pValue;
                       ^~~~~~
D:workplacePythonincludeobject.h:500: ошибка: undefined reference to `_imp___Py_Dealloc'
debug/main.o: In function `Py_DECREF':
D:/workplace/Python/include/object.h:500: undefined reference to `_imp___Py_Dealloc'
C:ProjectsCprojectQTMaskbuild-Mask-Desktop-Debug..Maskmain.cpp:98: ошибка: undefined reference to `_imp__Py_Initialize'
debug/main.o: In function `Z5qMainiPPc':
C:ProjectsCprojectQTMaskbuild-Mask-Desktop-Debug/../Mask/main.cpp:98: undefined reference to `_imp__Py_Initialize'
C:ProjectsCprojectQTMaskbuild-Mask-Desktop-Debug..Maskmain.cpp:99: error: undefined reference to `_imp__PyUnicode_DecodeFSDefault'
C:ProjectsCprojectQTMaskbuild-Mask-Desktop-Debug..Maskmain.cpp:101: error: undefined reference to `_imp__PyImport_Import'
C:ProjectsCprojectQTMaskbuild-Mask-Desktop-Debug..Maskmain.cpp:102: ошибка: undefined reference to `_imp__PyObject_GetAttrString'
:-1: error: collect2.exe: error: ld returned 1 exit status

Solution – 1

Python (at least the official binaries) for Win is built using VStudio ([Python.Wiki]: WindowsCompilers).
According to an output line added after a while (:-1: error: collect2.exe: error: ld returned 1 exit status), it seems a different build toolchain (looks like a port from Nix (MinGW, MSYS2, Cygwin, …)) is used.

It’s generally advisable not to mix build toolchains, as that could yield errors (at build time, or (even worse) crashes at runtime). Check [SO]: How to circumvent Windows Universal CRT headers dependency on vcruntime.h (@CristiFati’s answer) for a remotely related example.

Try setting VStudio (might need to install it – Community Edition is free) in your .pro file, like in the image below (don’t mind the older version, this is what I have configured already):

Img00


This (original answer) is a generic advice and is not the cause for the current failure, as the library is automatically included (via pyconfig.h).

You specified where the linker should search for libraries, but you didn’t specify which libraries to use. Check [SO]: How to include OpenSSL in Visual Studio (@CristiFati’s answer) for more details on building on Win.

Inside Python‘s lib directory («D:/workplace/Python/libs» in your case), there should be a file called python${PYTHON_MAJOR}${PYTHON_MINOR}.lib depending on which Python version you are using (e.g. python39.lib for Python 3.9). You need to let the linker know about it:

LIBS += -L"D:/workplace/Python/libs" -lpython39

Note: On Win you don’t have to separately install Python packages (python*, libpython*, libpython*-dev, …) as they are all contained by the (official) installer.

Всем доброго времени суток

Пожалуйста, обратите внимание: C ++ новичок здесь

Я создаю общие библиотеки среди различных других функций C ++, чтобы обеспечить полное понимание, однако я в растерянности.

Проблема:

Как следует из названия, список ошибок:

Я понятия не имею, что их вызывает, и поиск в Google не дает много понимания. Как предложено Вот добавить Q_Object макрос, я сделал это, но, очевидно, это бесполезно.

Различные другие сообщения SO предлагают проверить правильный заголовок и т. Д., Который является правильным.

Ошибка:

netm.cpp:3: error: undefined reference to `vtable for netm'
netm.cpp:3: error: undefined reference to `_imp___ZN4miscC1Ev'

netm.cpp:6: error: undefined reference to `vtable for netm'
netm.cpp:6: error: undefined reference to `_imp___ZN4miscC1Ev'
//...

У меня есть еще несколько ошибок, подобных этим выше, но их решение должно помочь мне в решении остальных

Из всех уроков и т. Д., Которые я изучил, я не сделал ничего необычного.

Замечания: Я не уверен, какая информация все требуется, если потребуется больше, я с удовольствием поделюсь.

//.pro

QT       -= gui
QT       += network

TARGET = netm
TEMPLATE = lib

DEFINES += NETM_LIBRARY

SOURCES += netm.cpp

HEADERS += netm.h\
netm_global.h

unix {
target.path = /usr/lib
INSTALLS += target
}

//netm_global.h — ПОЛНЫЙ

#ifndef NETM_GLOBAL_H
#define NETM_GLOBAL_H

#include <QtCore/qglobal.h>

#if defined(NETM_LIBRARY)
#  define NETMSHARED_EXPORT Q_DECL_EXPORT
#else
#  define NETMSHARED_EXPORT Q_DECL_IMPORT
#endif

#endif // NETM_GLOBAL_H

//netm.h — ПОЛНЫЙ

#ifndef NETM_H
#define NETM_H

#include "netm_global.h"#include "../misc/misc.h"#include "../gen/gen.h"
#include <QHostInfo>
#include <QTcpSocket>

class NETMSHARED_EXPORT netm
{
Q_OBJECT

public:
netm();
netm(QString hostname);
bool Send(int portNumber, char* message = NULL);
ReturnObject read();

bool isServerOnline(QString IP = QString());
int getPing(QString IP = QString());
void getIP();
void disconnectFromServer();
~netm();

private slots:
void getIP();

private:
misc m;
QHostInfo serverInfo;
QHostAddress serverIP;
QTcpSocket tcp_con;

};

#endif // NETM_H

//netm.cpp — Частично

#include "netm.h"
netm::netm(){                                    <--- ERROR line
}

netm::netm(QString hostname)                     <--- ERROR line
{
serverInfo.lookupHost(hostname, 0, SLOT(getIP()));
}

//...

Помощь (с объяснениями) будет принята с благодарностью!

ОБНОВИТЬ

Как и предполагалось, я определил конструктор в misc.cppт.к. его нету.

Перекомпилируя, я прочитал ошибку, указав, что netm класс, необходимый для наследования от QObject.

Таким образом добавление / изменение:

//netm.h — Частично

#include //...
#include <QObject>

class NETMSHARED_EXPORT netm : public QObject
{
Q_OBJECT

public:
netm();
netm(QString hostname);
//...
};

Ошибки сохраняются:

netm.cpp:3: error: undefined reference to `_imp___ZN4miscC1Ev'
netm.cpp:3: error: undefined reference to `_imp___ZN4miscD1Ev'
netm.cpp:6: error: undefined reference to `_imp___ZN4miscC1Ev'
netm.cpp:6: error: undefined reference to `_imp___ZN4miscD1Ev'

Ради полноты (misc тоже динамическая библиотека):

//misc.h

#ifndef MISC_H
#define MISC_H

#include "misc_global.h"
#include <QString>
#include <QList>class MISCSHARED_EXPORT misc
{
public:

misc();
~misc();

//String Literals
//Network related
static QString googleDNS;

//Command Codes
static QString CMD_AUTH;
static QString CMD_REQ;

//Request Codes
static QString REQ_USER_INFO;
static QString REQ_VPN_DATA;
static QString REQ_VPN_UP;

//...
};

//misc.cpp

#include "misc.h"
misc::misc(){
//Network related
QString googleDNS = QStringLiteral("8.8.8.8");

//Command Codes
QString CMD_AUTH = QStringLiteral("AUTH");
QString CMD_REQ = QStringLiteral("REQ");

//Request Codes
QString REQ_USER_INFO = QStringLiteral("USER_INFO");
QString REQ_VPN_DATA = QStringLiteral("VPN_DATA");
QString REQ_VPN_UP = QStringLiteral("VPN_UP");
}

misc::~misc(){}

Как видно здесь, конструктор существует,

какие-нибудь другие мысли?

0

Решение

Пропущенные звонки _imp___ZN4miscC1Ev, который misc::misc() в соответствии с c++filtскорее всего означает, что класс misc отсутствует определенный конструктор по умолчанию. Убедитесь, что вы компилируете определение misc::misc(),

Для vtable ошибка, убедитесь, что вы предоставили определение (даже пустое или заглушенное) для каждой функции, объявленной в netm (или, как минимум, все виртуальные функции в netm). vtable класс ссылается на каждую виртуальную функцию, поэтому все виртуальные функции должны быть определены, иначе он не будет компилироваться.

3

Другие решения

Других решений пока нет …

Понравилась статья? Поделить с друзьями:
  • Python сборщик ошибок
  • Qt кракозябры вместо ошибок
  • Python перезапуск скрипта после ошибки
  • Qt platform plugin windows ошибка как исправить amd
  • Python пользовательские ошибки