Skip to content

Dependency with qmain is always added, and strange directories #48

@mkentie

Description

@mkentie

I'm using the Qt VS Tools 3.4.1. Previously I was using 2.10. One of the applications in our solution is an MFC application that contains a single UI file that requires the moc compiler. So this application's vcxproj is marked as a Qt project. Previously this worked fine. After updating to 3.4.1, however, when compiling I get the error

qtmaind.lib(qtmain_win.obj) : error LNK2019: unresolved external symbol main referenced in function WinMain

As seen in the screenshot, vcxproj file generated by the VS Addin always links with qtmain(d).lib. Furthermore, strange hard-coded directories are added to the library paths (mysql, etc). I assume this generated vcxproj file is the issue, somehow?

After some searching, I tried adding the -= entrypoint flag to the qmake settings, but this doesn't help

To Reproduce
Steps to reproduce the behavior:
Convert an MFC project (which uses MFC's WinMain) to a Qt project by adding the 'QtVS_v304' keyword, props and target files.

Expected behavior
Qt projects shouldn't always link with qtmain.lib, or it should be able to be turned off.

Screenshots
If applicable, add screenshots to help explain your problem.

Image Image

Desktop (please complete the following information):

  • Qt VS Tool Version Qt VS Tools 3.4.1
  • Visual Studio version VS2022

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions