Note that there are some explanatory texts on larger screens.

plurals
  1. POunresolved external symbol public __thiscall only in debug mode
    primarykey
    data
    text
    <p>I have looked around for posts trying to solve this error but in every case I am already doing what they have suggested. </p> <p>My compile output:</p> <blockquote> <p>main.obj:-1: error: LNK2019: unresolved external symbol "public: __thiscall KeyLogger::~KeyLogger(void)" (??1KeyLogger@@QAE@XZ) referenced in function _main</p> <p>main.obj:-1: error: LNK2019: unresolved external symbol "public: __thiscall KeyLogger::KeyLogger(void)" (??0KeyLogger@@QAE@XZ) referenced in function _main</p> <p>debug\AccipioKeyDemo.exe:-1: error: LNK1120: 2 unresolved externals</p> </blockquote> <p>I know that this is saying that I have the KeyLogger constructor and destructor defined but not implemented but I actually do have everything implemented.</p> <p>main.cpp</p> <pre><code>#include &lt;QCoreApplication&gt; #include "keylogger.h" int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); KeyLogger k; return a.exec(); } </code></pre> <p>keylogger.h</p> <pre><code>#ifndef KEYLOGGER_H #define KEYLOGGER_H #include &lt;Windows.h&gt; class KeyLogger { public: KeyLogger(); ~KeyLogger(); void start(); void stop(); private: HHOOK hook; LRESULT CALLBACK intercept(int code, WPARAM wparam, LPARAM lparam); }; #endif // KEYLOGGER_H </code></pre> <p>keylogger.cpp</p> <pre><code>#include "keylogger.h" #include &lt;QDebug&gt; KeyLogger::KeyLogger() : hook(NULL) { hook = SetWindowsHookEx(WH_KEYBOARD_LL, intercept, NULL,0); if (hook == NULL) { qDebug() &lt;&lt; "HOOK FAILED"; } else { qDebug() &lt;&lt; "HOOK SUCCESS"; } } KeyLogger::~KeyLogger() { } void KeyLogger::start() { qDebug() &lt;&lt; "start"; } void KeyLogger::stop() { qDebug() &lt;&lt; "stop"; } LRESULT CALLBACK KeyLogger::intercept(int code, WPARAM wparam, LPARAM lparam) { qDebug() &lt;&lt; "Key Pressed"; return CallNextHookEx(hook, code, wparam, lparam); } </code></pre> <p>QT Pro config</p> <pre><code>#------------------------------------------------- # # Project created by QtCreator 2013-10-10T19:58:51 # #------------------------------------------------- QT += core QT -= gui TARGET = AccipioKeyDemo CONFIG += console CONFIG -= app_bundle LIBS += user32.lib TEMPLATE = app SOURCES += main.cpp \ keylogger.cpp HEADERS += \ keylogger.h </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload