-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Building simple Qt application after installation failed #1442
Comments
So, if I manually delete |
I'd like to add that for the Debug configuration, |
Reading a bit more about Qt, it seems that depending on your use case, you either:
Source: http://doc.qt.io/qt-5/activeqt-server.html Does vcpkg offer any way of selecting which libs will be included in the linking process? |
Okay, after browsing through some source files and other
Users need to:
|
This commit moves a few .lib files to subfolders to prevent them from automatically getting linked: Qt5Bootstrap (dbg): This lib is linked against a release version of the CRT and is only meant for release builds. For debug builds, this lib should not be linked at all. qtmain (rel), qtmaind (dbg), Qt5AxServer (rel), Qt5AxServerd (dbg): These libs are mutually exclusive. The user either links against qtmain(d) for desktop applications or against Qt5AxServer(d) for ActiveX servers. See microsoft#1442 for more information.
This commit fixes part of a previous issue: microsoft#1442 In this older issue, Qt5Bootstrap.lib was originally placed in debug/lib, causing it to be automatically linked in Visual Studio for debug builds. This caused linking errors, since Qt5Bootstrap.lib is linked against a different runtime (as detailed in the issue). The solution back then, as implemented in PR microsoft#1847 , was to place this file elsewhere. The same approach is taken here in this commit. However, the Qt5 port is nowadays modular and complicates matters. The qt5-base package produces the problematic .lib file and should be responsible for moving the file elsewhere, yet at the same time the qt5-tools package depends on this .lib file. Ideally, the qt5-tools port should be patched such that it would find Qt5Bootstrap.lib in its new location. Unfortunately, the path to Qt5Bootstrap.lib appears in a Makefile that is generated by qmake based on a *.pro and a qt.conf file, a process which I do not yet fully understand. As an alternative, I opted for temporarily copying the Qt5Bootstrap files to their original location before building the qt5-tools package and clean up afterwards.
Hi @usernameiwantedwasalreadytaken, thanks for reporting this issue. Thanks. |
@Neumann-A I think this issue is resolved in some PRs, is it correct? |
@JackBoosY: I think this:
still needs to be resolved |
After doing that the execution seems to bind to tesseract and the output is: |
@Neumann-A, since qt5 has been upgraded to 5.12.5, could you please see if this issue is resolved in some PR? |
@JonLiu1993 just look at the file list. If the files mentioned by me above are in manual-link it is resolved otherwise it is not solved. |
This commit moves a few .lib files to subfolders to prevent them from automatically getting linked: Qt5Bootstrap (dbg): This lib is linked against a release version of the CRT and is only meant for release builds. For debug builds, this lib should not be linked at all. qtmain (rel), qtmaind (dbg), Qt5AxServer (rel), Qt5AxServerd (dbg): These libs are mutually exclusive. The user either links against qtmain(d) for desktop applications or against Qt5AxServer(d) for ActiveX servers. See microsoft/vcpkg#1442 for more information.
I've found the same issue in a VS solution of a CUDA project (I've pasted the error below just as reminder) Qt5AxServer.lib(qaxserver.obj) : error LNK2001: unresolved external symbol "class QAxFactory * __cdecl qax_instantiate(void)" (?qax_instantiate@@YAPAVQAxFactory@@xz) I have the Qt plugin installed in my VS installation. Still, the CUDA project has nothing to do with Qt. I mean, is there a way to fully disable Qt plugins from VS? Is there a way to fix this? |
I've installed the qt5 module and I'm trying to build a simple project with just one file:
Visual Studio can compile fine, but gives me the following error when linking:
Any ideas how I might solve this?
P.S.: With a Debug build I've got many more linking errors...
I'm using Visual Studio 2017 Community.
Thanks in advance.
The text was updated successfully, but these errors were encountered: