Dolphin, the GameCube and Wii emulator - Forums

Full Version: QTDIR not set question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Below is an example of an error condition.
Please recall that I am pretty much "zero knowledge" on C++; as such, not only may I be wrong in my analysis, but even my terminology may be incorrect.


Example callER: (ARCodeWidget,cpp)

void ARCodeWidget::OnContextMenuRequested()
{
 QMenu menu;

 menu.addAction(tr("Sort Alphabetically"), this, &ARCodeWidget::SortAlphabetically);

 menu.exec(QCursor::pos());
}

Example callEE: (qmenu.h)

public:
   explicit QMenu(QWidget *parent = 0);
   explicit QMenu(const QString &title, QWidget *parent = 0);
   ~QMenu();

{...followed by various "addAction" function definitions

Error:

Error (active) E0304 no instance of overloaded function "QMenu::addAction" matches the argument list
      argument types are: (QString, ARCodeWidget *, void (ARCodeWidget::*)())
      object type is: QMenu

This type of error also appears in other areas:
1. with an indication that there is an argument count mismatch
2. with an indication that the system cannot convert argument {some argument number} from {current type} to {expected type}

Note that the above errors all seem to relate to improper calling of the QMenu class functions.   I have only chosen the QMenu example because it seems to be the most numerous as well as the most inconsistent in the various callER functions.

Given that there are a significant number of errors related to QMenu, it may be worth while to determine how many of each error
type there is, fix QMenu to match that majority of the callERs (so they DON'T need to be edited), and change all the remaining  CallERs (hopefully a relatively smaller number) to match.

I am hoping that the above is sufficient into to point you in the right direction.  Obviously more digging is required, as (for example), I did not include the code related to the
QMenu.addAction function.


As for the "...not a member of..." example, I will have to look at the build results again.  And while I certainly understand your text, something like this... "V14.26/std:c++Latest"... would require a "dummy down" explanation.
(Ok, not too dumb...I'll pick it up as you teach me)

Also, I will of course be happy to supply you with my system (or VS) info/configuration...although you may have to coach me as to how to find it.


Thanks
Charlie
That QMenu error is happening because the code is trying to call a function which was added in Qt 5.6. You shouldn't use a version of Qt that's as old as the one you're using, because Dolphin just isn't intended to work with versions that old.
AHA!  This makes sense, at least intellectually.

In practice, I'll need some help...

First of all (and, as I now understand from your post, the most important), I DON'T have QT installed; I did not realize that an installation was required.  I simply copied the directory over from {I forget where - and now that doesn't matter anyway} into DolphinQT in the appropriate directory.  I had thought that DolphinQT handled the entire QT requirement.   WOW -talk about missing knowledge.  

Okay, so I'm going to install QT, and make sure it is 5.6. as you have indicated.  But that's just the "mechanical"  part of the answer.  

So, "intellectual" part:  
1. Once QT is installed, is there anything else I have to do to make Dolphin understand that defining a local variable called "menu" as a QMenu means it must go find QMenu in the newly installed QT?
2. Even if Dolphin then understands what a QMenu is, how will that help those "addAction" calls whose parameters are in error?  Aren't those errors simply due to the callER-vs-callEE parameter usage, and NOT related to what a QMenu itself actually is?  That is, will a code fix still be required?

As you can see, when I said "no C++ knowledge", I meant it.

Anyway, I'm off to install QT5.6, and hope to continue learning as I hope you-all will continue helping and teaching.


Thanks so much to all of you for your patience!!!

Charlie
I would not suggest using Qt 5.6 either. White it would fix the QMenu error, there would likely still be other errors with it. You should preferably use 5.14 like Dolphin has in its submodule, or newer (5.15 does exist nowadays).

It sounds to me like you're overcomplicating the whole thing. Try to start over and clone the Dolphin git repository using git clone --recursive as LPFaint99 described, then just build Dolphin. You do not need to install Qt or edit the sln file (including setting QTDIR) to get DolphinQt to build under normal circumstances. (Make sure to use --recursive, otherwise you'll have to do a separate step afterwards to get the Qt submodule working.)
You don't need QT installed at all. At most, you only need to fix one error to get Dolphin to build, and any other errors are coming from an improper setup. Nuke your whole project and start from scratch using git commands. Don't manually mess with QT. Post errors and issues after that.
Got both messages.

Sorry for the delay, been pretty busy due to "new normal".

I'll get back to you ASAP, please be patient.

Thanks all, and stay safe.

Charlie
Hi,
Thanks for waiting...

As per "Modception" and "JosJuice" suggestions to follow "LPFaint99 " suggestion:

1. Nuked the original GIT stuff
2. Connected a USB external hard drive as drive "I:"
3. On the root of I:, created a folder "Wii"
4. Under "Wii", created a folder "Dolphin19GIT"
5. Opened a CommandLine window in Administartor mode
6. Changed to directory "I:\Wii\Dolphin19GIT"
7. Ran the command "git clone --recursive https://github.com/dolphin-emu/dolphin.git"
8. The results on the CommandLine window very closely parallel the example shown by "LPFaint99"
9. The next step is to build Dolphin:
a. Open VS2019
b. Load the project via the ".sln" file in the "Source" directory
c. Set the VS config to "Release" and "x64"
d. Execute the "Build" command
e. Receive the 300+ error messages as before.

(Note that I had previously attempted the Build in Debug mode and got the same errors)

Error examples:
1. Error C2664
'QAction *QMenu::addAction(const QIcon &,const QString &,const QObject *,const char *,const QKeySequence &)':
cannot convert argument 3 from 'void (__cdecl ARCodeWidget::* )(void)' to 'const char *'
menu.addAction(tr("Sort Alphabetically"), this, &ARCodeWidget::SortAlphabetically);
Dolphin I:\Wii\Dolphin19GIT\dolphin\Source\Core\DolphinQt\Config I:\Wii\Dolphin19GIT\dolphin\Source\Core\DolphinQt\Config\ARCodeWidget.cpp

2. Error C3861 'qOverload': identifier not found
connect(m_wiimote_boxes[i], qOverload<int>(&QComboBox::currentIndexChanged), this, &ControllersWindow::SaveSettings);
Dolphin I:\Wii\Dolphin19GIT\dolphin\Source\Core\DolphinQt\Config I:\Wii\Dolphin19GIT\dolphin\Source\Core\DolphinQt\Config\ControllersWindow.cpp

Couple of thoughts:
1. Should I NOT be using VS2019?  I have VS2008, VS2010, VS2017.
2. Should I even be using VS at all?  Perhaps a command line "make" command of some kind?

I realize that attempting to fix the errors indicated above is what got me into this whole overly-complicated mess previously, so I'll stop now and wait for advice.

Thanks
Charlie
All those steps look correct. However, it seems like the build process is still trying to use your old version of Qt despite that. I'm not entirely sure how Dolphin determines where to look for Qt or in what way you installed that old version of Qt, but try uninstalling the old version of Qt.
Thanks for that, at least.

1. There does not appear to be QT installed on my machine.  Neither the Start menu, nor the Settings/Uninstall window shows "QT".  Would it be listed under something else?

2. There IS QT data installed in the Externals,QT,QT5.14.1 directory as part of the GIT install

3. Is there a CommandLine command I could run, like ask for a QT version or something, to see if QT responds?

Thanks
Charlie
HA!  I found something!!!

In my EnvironmentalVariables, I had a key called QTDir (or something like that) that was pointed to the DolphinQT stuff.  I don't recall how it got there, but it almost surely had to be something I had done manually way back at the start of this effort.  

So, I deleted it.

Then, I got this error (among others):

`Error C2039 'result_of': is not a member of 'std'`


"HA", I said..."HA".  I have seen that somewhere before.  Reviewing the posts in this thread, I found it.  It was posted by LPFaint99:
---------------------------------
In an attempt to reproduce, I upgraded to the latest MSVC++ build tools, and was able to get the build to break. In v14.26 /std:c++latest drops some deprecated c++17 things that are used in QT
for  example

`Error C2039 'result_of': is not a member of 'std'`

using an older version with the latest visual studio is nontrivial, so i'll only add the steps if that is the issue you are having
--------------------------------

OK, so now my sanity is somewhat restored; I thank you for that, sir!!

Now, if you could, what would you like me to do next?

Based on your reference "using an older version with the latest visual studio is nontrivial,...", I am prepared to use an older version of VS (I have VS2008, VS2010, VS2013, VS2017, VS2019), or we can attack the non-trivial path.

Thanks to all so far for your help.

Charlie
Pages: 1 2 3 4