This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Unresolved external linkage

Tags: None
(comma "," separated)
patrikgwet
Registered Member
Posts
5
Karma
0

Unresolved external linkage

Wed Nov 26, 2014 2:25 pm
Hi,

I installed KDE on Windows 8 x64 and Qt5. I am using the MSVC2012 compiler. I am currently developing an application on Qt and for that I'm using the Calligra library along with the KDE dependencies. For now, I am including header from Calligra Sheets and regarding the <Doc.h> file, I face an compiler issue due to the mode_t type in the kglobal.h file. On google, I found that mode_t might be in <sys/stat.h> library, but it is not. So, I created the structure in my main header:

Code: Select all
struct mode_t
{
    int i;
};


But when I recompile the code, I have 8 unresolved external linkages 2001 followed by LNK 2019.

main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __cdecl KUndo2QStack::metaObject(void)const " (?metaObject@KUndo2QStack@@UEBAPEBUQMetaObject@@XZ)

main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void * __cdecl KUndo2QStack::qt_metacast(char const *)" (?qt_metacast@KUndo2QStack@@UEAAPEAXPEBD@Z)

main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual int __cdecl KUndo2QStack::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@KUndo2QStack@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z)

main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void __cdecl KUndo2QStack::setIndex(int)" (?setIndex@KUndo2QStack@@UEAAXH@Z)

main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void __cdecl KUndo2QStack::undo(void)" (?undo@KUndo2QStack@@UEAAXXZ)

main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void __cdecl KUndo2QStack::redo(void)" (?redo@KUndo2QStack@@UEAAXXZ)

main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl KUndo2Stack::~KUndo2Stack(void)" (__imp_??1KUndo2Stack@@UEAA@XZ) referenced in function "public: virtual void * __cdecl KUndo2Stack::`scalar deleting destructor'(unsigned int)" (??_GKUndo2Stack@@UEAAPEAXI@Z)

I could not find the reason of that issue. I tried to delete the debug folder and recompile but it did not help. Is there a solution to that issue?

thanks.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Unresolved external linkage

Sat Nov 29, 2014 8:04 am
You likely need to link to the KUndo2 library, which is included as part of Calligra according to LXR: http://lxr.kde.org/ident?_i=KUndo2QStack
Also - which Windows build are you using? You might also want to reach out to the Calligra developers through their mailing list: calligra-devel@kde.org.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
patrikgwet
Registered Member
Posts
5
Karma
0

Re: Unresolved external linkage

Sat Nov 29, 2014 8:39 pm
bcooksley wrote:You likely need to link to the KUndo2 library, which is included as part of Calligra according to LXR: http://lxr.kde.org/ident?_i=KUndo2QStack
Also - which Windows build are you using? You might also want to reach out to the Calligra developers through their mailing list: calligra-devel@kde.org.


Hi, the path to the KUndo2 library is already part of the INCLUDEPATH in my project file. I just do not know why it does not link. Is there an extra linking I need to do? ???
Regarding my Windows build, I am using a Windows 8 Pro on an AMD 64bits computer.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Unresolved external linkage

Mon Dec 01, 2014 10:42 am
You need to set more than just the include path - you also need to instruct the compiler to link your application against the KUndo library.
I'm not sure how this is done with QMake unfortunately.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
Stephen Leibowitz
Registered Member
Posts
54
Karma
0

Re: Unresolved external linkage

Mon Dec 01, 2014 7:25 pm
Usually mode_t is defined with a typedef. For example, from calligra­2.8.6\winquirks\unistd.h:
typedef int mode_t;
patrikgwet
Registered Member
Posts
5
Karma
0

Re: Unresolved external linkage

Tue Dec 02, 2014 1:34 pm
Stephen Leibowitz wrote:Usually mode_t is defined with a typedef. For example, from calligra­2.8.6\winquirks\unistd.h:
typedef int mode_t;


Yes @Stephen Leibowitz, I actually changed to a typedef.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]