• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
« Previous 1 ... 3 4 5 6 7 ... 116 Next »

Linker errors when trying to compile
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Linker errors when trying to compile
09-09-2021, 10:29 AM (This post was last modified: 09-09-2021, 12:27 PM by LittleCoaks.)
#1
LittleCoaks Offline
Junior Member
**
Posts: 22
Threads: 16
Joined: Dec 2020
I've been stuck on this problem for a while now. I'm building with Visual Studio 2019. I've built fine before, but even since i tried adding 4 different files to the build, 2 headers and 2 cpp files, i get 8 LNK2001 errors followed by LNK1180 fatal error. I already added the files to CMakeLists.txt but i am still having issues. Any help on this is appreciated. Below is the log from Visual Studio

Code:
3>LocalPlayersWidget.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __cdecl LocalPlayersWidget::metaObject(void)const " (?metaObject@LocalPlayersWidget@@UEBAPEBUQMetaObject@@XZ)
3>LocalPlayersWidget.obj : error LNK2001: unresolved external symbol "public: virtual void * __cdecl LocalPlayersWidget::qt_metacast(char const *)" (?qt_metacast@LocalPlayersWidget@@UEAAPEAXPEBD@Z)
3>LocalPlayersWidget.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl LocalPlayersWidget::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@LocalPlayersWidget@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z)
3>LocalPlayersWidget.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const LocalPlayersWidget::staticMetaObject" (?staticMetaObject@LocalPlayersWidget@@2UQMetaObject@@B)
3>LocalPlayersWindow.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __cdecl LocalPlayersWindow::metaObject(void)const " (?metaObject@LocalPlayersWindow@@UEBAPEBUQMetaObject@@XZ)
3>LocalPlayersWindow.obj : error LNK2001: unresolved external symbol "public: virtual void * __cdecl LocalPlayersWindow::qt_metacast(char const *)" (?qt_metacast@LocalPlayersWindow@@UEAAPEAXPEBD@Z)
3>LocalPlayersWindow.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl LocalPlayersWindow::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@LocalPlayersWindow@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z)
3>LocalPlayersWindow.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const LocalPlayersWindow::staticMetaObject" (?staticMetaObject@LocalPlayersWindow@@2UQMetaObject@@B)
3>C:\Users\15165\Rio Modding Project\Project Rio\PR official\Build\x64\Release\Project Rio\bin\Project Rio.exe : fatal error LNK1120: 8 unresolved externals
3>Done building project "DolphinQt.vcxproj" -- FAILED.
========== Build: 1 succeeded, 1 failed, 32 up-to-date, 1 skipped ==========
Find
Reply
09-09-2021, 04:23 PM
#2
Zopolis4 Offline
Junior Member
**
Posts: 46
Threads: 4
Joined: Aug 2020
From what I can see, you might not have added them to DolphinQt.vcxproj file? Could you send a screenshot of the changes listed in the git changes tab?
Find
Reply
09-10-2021, 01:09 AM (This post was last modified: 09-10-2021, 01:10 AM by LittleCoaks.)
#3
LittleCoaks Offline
Junior Member
**
Posts: 22
Threads: 16
Joined: Dec 2020
(09-09-2021, 04:23 PM)Zopolis4 Wrote: From what I can see, you might not have added them to DolphinQt.vcxproj file? Could you send a screenshot of the changes listed in the git changes tab?

i def didn't do that manually, but it seems like it was done automatically. Here's a screenshot of my git changes. Some of the changes are not relevant to my problem, so i've checked off the changes that relate to the situation (if something's not checked just ignore it)


Attached Files Thumbnail(s)
   
Find
Reply
09-10-2021, 01:13 AM (This post was last modified: 09-10-2021, 01:14 AM by JosJuice.)
#4
JosJuice Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 8,845
Threads: 7
Joined: Oct 2014
DolphinQt.vcxproj has one section for things that don't need to be ran through moc and one section for things that do. You've most likely used the non-moc section when you needed the moc section. (Visual Studio's ability to automatically add things to the vcxproj files doesn't know about moc and just treats everything as if it doesn't need moc. You'll need to edit the vcxproj file manually.)
Find
Reply
09-10-2021, 01:34 AM
#5
LittleCoaks Offline
Junior Member
**
Posts: 22
Threads: 16
Joined: Dec 2020
(09-10-2021, 01:13 AM)JosJuice Wrote: DolphinQt.vcxproj has one section for things that don't need to be ran through moc and one section for things that do. You've most likely used the non-moc section when you needed the moc section. (Visual Studio's ability to automatically add things to the vcxproj files doesn't know about moc and just treats everything as if it doesn't need moc. You'll need to edit the vcxproj file manually.)

This fix worked perfectly, thank you!

I'll document what i did just in case someone else with the same problem reads this thread.
I added two header files which used Q_OBJECT. DolphinQt.vcxproj states on ln203 that if Q_OBJECT is used in the header file then the item type must be set to QtMoc. Visual Studio automatically added my two header files to DolphinQt.vcxproj with the item type ClInclude, so i changed it to QtMoc, saved the file, and then was able to build Dolphin.
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode