Registered Member
|
I am struggling with an issue while I am using external .h files in my project.
I am using Qt5 with MSVC2012. In my main file, I am including a header file from a KDE application. I put some INCLUDEPATH in the .pro file to link correctly. The piece of code I am in trouble with is the following:
The Doc.h belongs to the KDE application source code. Including that file includes many other files in several directories in the KDE application source code. Currently, the KUndo2Stack.h and the KUndo2Stack.cpp files are the files I am struggling with since three days now. When I run QMake and compile, I get a link 2001 errors due to unresolved externals with virtual functions in the KUndo2QStack class defined and implemented in those files. Here is an extract:
Note that the unresolved links occur only for virtual functions. Those functions are implemented as it follows:
I have turned this question upside down looking for answers on the web and the only time I got something was when I deleted the word virtual off all the related functions. It cancelled the errors but I got an unresolved link2019 error with the destructor of the class KUndo2Stack (see the code above). The destructor I am talking about is the default one, you won't see any definition or implementation of it. The exact error messages are:
I need some help to understand what is really going on and how to fix it. Thanks! |
Manager
|
moved to KDE Development -> Helping Hands
|
Administrator
|
You might want to post this on kde-devel@kde.org or calligra-devel@kde.org, as someone there is more likely to have an answer to this problem.
I suspect the implementation of KUndo2QStack is not being compiled into your library/binary.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Hi,
I have already sent, 2 days ago, an email to calligra-devel@kde.org but my message was held waiting for a moderator approval (saying because I am not a member, what I don't really understand). In fact, I am using .h and .cpp source code files of Calligra directly. Not .h and .lib files instead. Is there a problem with that? Because the other headers I included before the <Doc.h> compiled without any issues. Thanks! |
Administrator
|
As long as you include all the necessary headers, and compile the *.cpp files into your project then it should work. You might need to modify the headers though to remove the exports - it is probably them causing the issue here.
In regards to the mailing list - this is because you have not subscribed to it. It is fairly standard practice to not let non-subscribers post due to spam.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]