Qt app compile error.
-
Hi
Im a starter in Qt. Im use a third party library(TobiiGazeSdk) in my Qt app, and i get compile error, but dont know what is the problem. I need some help. Thank a lot.
This is the output error:mainwindow.obj : error LNK2005: "void * __cdecl xthread_create(void *,void *)" (?xthread_create@@YAPAXPAX0@Z) already defined in main.obj
mainwindow.obj : error LNK2005: "void __cdecl xthread_join(void *)" (?xthread_join@@YAXPAX@Z) already defined in main.obj
mainwindow.obj : error LNK2005: "void __cdecl xinitialize_cv(struct xcondition_variable *)" (?xinitialize_cv@@YAXPAUxcondition_variable@@@Z) already defined in main.obj
mainwindow.obj : error LNK2005: "int __cdecl xwait_until_ready(struct xcondition_variable *)" (?xwait_until_ready@@YAHPAUxcondition_variable@@@Z) already defined in main.obj
mainwindow.obj : error LNK2005: "void __cdecl xsignal_ready(struct xcondition_variable *)" (?xsignal_ready@@YAXPAUxcondition_variable@@@Z) already defined in main.obj
mainwindow.obj : error LNK2005: "void __cdecl report_and_exit_on_error(enum tobiigaze_error_code,char const *)" (?report_and_exit_on_error@@YAXW4tobiigaze_error_code@@PBD@Z) already defined in main.obj
tobii.obj : error LNK2005: "void * __cdecl xthread_create(void *,void *)" (?xthread_create@@YAPAXPAX0@Z) already defined in main.obj
tobii.obj : error LNK2005: "void __cdecl xthread_join(void *)" (?xthread_join@@YAXPAX@Z) already defined in main.obj
tobii.obj : error LNK2005: "void __cdecl xinitialize_cv(struct xcondition_variable *)" (?xinitialize_cv@@YAXPAUxcondition_variable@@@Z) already defined in main.obj
tobii.obj : error LNK2005: "int __cdecl xwait_until_ready(struct xcondition_variable *)" (?xwait_until_ready@@YAHPAUxcondition_variable@@@Z) already defined in main.obj
tobii.obj : error LNK2005: "void __cdecl xsignal_ready(struct xcondition_variable *)" (?xsignal_ready@@YAXPAUxcondition_variable@@@Z) already defined in main.obj
tobii.obj : error LNK2005: "void __cdecl report_and_exit_on_error(enum tobiigaze_error_code,char const *)" (?report_and_exit_on_error@@YAXW4tobiigaze_error_code@@PBD@Z) already defined in main.obj
moc_mainwindow.obj : error LNK2005: "void * __cdecl xthread_create(void *,void *)" (?xthread_create@@YAPAXPAX0@Z) already defined in main.obj
moc_mainwindow.obj : error LNK2005: "void __cdecl xthread_join(void *)" (?xthread_join@@YAXPAX@Z) already defined in main.obj
moc_mainwindow.obj : error LNK2005: "void __cdecl xinitialize_cv(struct xcondition_variable *)" (?xinitialize_cv@@YAXPAUxcondition_variable@@@Z) already defined in main.obj
moc_mainwindow.obj : error LNK2005: "int __cdecl xwait_until_ready(struct xcondition_variable *)" (?xwait_until_ready@@YAHPAUxcondition_variable@@@Z) already defined in main.obj
moc_mainwindow.obj : error LNK2005: "void __cdecl xsignal_ready(struct xcondition_variable *)" (?xsignal_ready@@YAXPAUxcondition_variable@@@Z) already defined in main.obj
moc_mainwindow.obj : error LNK2005: "void __cdecl report_and_exit_on_error(enum tobiigaze_error_code,char const *)" (?report_and_exit_on_error@@YAXW4tobiigaze_error_code@@PBD@Z) already defined in main.obj -
Ok, try removing the include of player.h in mainwindow.h. (This is what causes the errors it seems).
If you then get LNK2019 errors (unresolved external symbols) then you need to change the tobii.h file so it does not include the common.h file, we cross that bridge when we get to it :-)