-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed build error: AddressInputWidget.h is never moc'ed but the moc file is included during build #165
Conversation
…o load moc_AddressInputWidget.h. Include for moc file is now commented out.
This was me blindly adding the file to the MSVC project file without noticing that the class does not specify the I think the potential solutions are:
There is some discussion in #89 on this topic. I guess my question is, doesn't the CMake file work well with Visual Studio on Windows? Is there any limitation or issue? |
I don't know a lot about CMake, so I might be doing something wrong, but when I try to use the CMakeLists.txt in the Source folder, I get an error:
This is using Visual Studio 2022 (64-bit) Version 17.10.3. |
The path to the Qt library needs to be included in The Qt library for Windows is available in a Git submodule, which I guess you have checked out, or else you would have had problems with the MSVC project too. |
Okay, I was able to add that prefix path in the CMakeLists.txt when building for WIN32. It builds normally with CMake now with Visual Studio on Windows. Should I add that commit here? |
I'm not sure about it. In principle, one should be to configure the project to use their own Qt library or version; simply hardcoding the path may not be the correct thing to do. |
We are talking windows. We ship a specific submodule. It is reasonable to hard code to use the provided submodule. Why does the dolphin project not drop vcproj? |
Normally we'd check first whether Qt can be found; if not, the path to the Externals is added for a second attempt.
Good question. With regards to the issue in question, we can simple remove the line for |
I figured out how to make it first check whether Qt is already installed and revert to Externals for a second attempt for windows only using an if else block and it builds fine on Visual Studio, so I could add that commit instead. |
Is this typical in C++ projects? I'm fine with it if yes. It seems a bit strange to me, since I could potentially build with an unintended Qt version locally without realizing it if I installed Qt for other projects. |
I think we are after two distinct PRs here.
|
For example, in Dolphin, although it provides many external libraries, it usually tries to use the system's (or whatever is defined in the environment) first. Only when they cannot be found does it fallback to using the external libraries. It adds some information messages during the configuration step, announcing the use of the external library when one could not be found. (At least this is the case on Linux.) |
… the project file.
Okay, for this PR I removed the line for loading moc_AddressInputWidget from the project file. |
…ile is included during build (aldelaro5#165) * AddressInputWidget.h is never moc'ed but the compiler is instructed to load moc_AddressInputWidget.h. Include for moc file is now commented out. * Removed the line which looks for a moc_AddressInputWidget.h file from the project file.
I encountered a build error from a fresh clone of the repository. AddressInputWidget.h is never moc'ed but the compiler is instructed to load moc_AddressInputWidget.h. When I moc AddressInputWidget.h it gives a response that nothing was moc'ed from that file, so I commented out the include for moc_AddressInputWidget.h