Skip to content
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

Debug build failure in 3.3.1 #40

Open
ColDunlop opened this issue Dec 3, 2024 · 7 comments
Open

Debug build failure in 3.3.1 #40

ColDunlop opened this issue Dec 3, 2024 · 7 comments

Comments

@ColDunlop
Copy link

ColDunlop commented Dec 3, 2024

Describe the bug
Since 3.3.1 the Debug configuration is broken.
Changes to the file "qt_defaults.props" mean that $(QtBuildConfig) is defined incorrectly".
This escalates through to "qt_vars.targets" and $(QMakeArgsList) never contains "CONFIG += debug".
Result is that on the link line, the application built with Debug tries to link with Release libraries.
If your Qt installation is split into two separate folders (Debug, Release) then the Debug build fails.
If your Qt installation is combined, then the Debug build links with Release libraries.

To Reproduce
Steps to reproduce the behaviour:
Using a Debug only Qt installation.
Create an example Qt app using the MSVS Project Wizard.
Try and build it with Debug.
It will fail with unable to locate e.g. Qt6AXContainer.lib instead of Qt6AXContainerd.lib

Expected behavior
In a Debug environment $(QtBuildConfig) should be "debug", and "CONFIG += debug" should be added.

Screenshots
Changes that have caused this behaviour in 3.3.1 is below:
qt_defaults.props
image

Place where "CONFIG += debug" should be added:
qt_vars.targets
image

Desktop (please complete the following information):

  • Qt VS Tool Version 3.3.1
  • Visual Studio version VS2022
  • Qt Version 6.7.1

Additional context
It was bad enough in 3.3.0 with the missing moc include paths bug, and now this in 3.3.1 is another catastrophic failure.

@espr14
Copy link

espr14 commented Dec 4, 2024

Same issue in 3.3.0.46. I haven't tried 33, but 3.3.0.13 is OK.

@DmiShUa
Copy link

DmiShUa commented Dec 4, 2024

I have the same bug.
I resolved by set Project - Properties - Advanced - Use Debug Libraries to Yes

@noahwh
Copy link

noahwh commented Dec 5, 2024

Opened https://bugreports.qt.io/browse/QTVSADDINBUG-1273 as I suspect that tracker is more closely watched by the maintainer.

@anoymouserver
Copy link

See QTVSADDINBUG-1263 where I've reported the same issue a week ago.

@kaheimri
Copy link
Collaborator

kaheimri commented Dec 5, 2024

@ALL We are very sorry that this has happened, we are considering several steps to provide an upgrade path for projects without UseDebugLibraries for debug configurations set in the .vcxproj file.

As a temporary solution, you can overcome the issue with either of the following steps:

  1. Modify each project in your solution by opening Project Settings >Advanced and set Use Debug Libraries to Yes for your debug configurations.
    UseDebugLibraries

  2. Instead of modifying each project file, you can set the property for all projects under a filesystem hierarchy by adding a Directory.Build.props file at the root with the following content:

    <?xml version="1.0" encoding="utf-8"?>
        <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
            <PropertyGroup>
                <UseDebugLibraries Condition="'$(Configuration)' == 'Debug'">true</UseDebugLibraries>
            </PropertyGroup>
        </Project>

When building a project, MSBuild will search upwards on the directory structure for this file and import it if found (cf. MSBuild docs).

@noahwh
Copy link

noahwh commented Dec 5, 2024

I don't maintain a vcxproj file, I am importing a .pro file. Surely you don't believe this is working correctly?

@kaheimri
Copy link
Collaborator

kaheimri commented Dec 6, 2024

We have reverted the offending commit and uploaded the package again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants