Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Configuring build of Qt for VS 2017 from source keeps failing



  • I'm having issues trying to build Qt such that I can get the debug symbols to figure out why the application crashes every few days or so. This is for a 64 bit qml application with c++ feeding data from a worker thread. This is a full screen (with on screen keyboard) application that runs on windows. Below is the output from config.log with the command given in the first line. I've X'ed all personal info. What would cause the error shown in the last 2 lines?

    > Command line: -platform win32-msvc2017 -commercial -prefix win32-msvc2017 -confirm-license -debug-and-release -force-debug-info -nomake examples -nomake tests -skip qtwebengine -skip qt3d
    > + C:/Qt/5.12.1/Src/qtbase/bin/licheck.exe  yes  C:/Qt/5.12.1/Src/qtbase C:/Qt/5.12.1/Src/qtbase  win32-msvc win32-msvc
    > > Licensee="Zaatri Jerry"
    > > Edition="Device Creation"
    > > ReleaseDate="2019-01-29"
    > executing config test verifyspec
    > + cd /d C:\Qt\5.12.1\Src\config.tests\verifyspec && C:\Qt\5.12.1\Src\qtbase\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" C:/Qt/5.12.1/Src/qtbase/config.tests/verifyspec
    > + cd /d C:\Qt\5.12.1\Src\config.tests\verifyspec && set MAKEFLAGS=& jom clean && set MAKEFLAGS=& jom
    > > jom 1.1.3 - empower your cores
    > > 	del verifyspec.obj
    > > 	del verifyspec.exp
    > > Could Not Find C:\Qt\5.12.1\Src\config.tests\verifyspec\verifyspec.exp
    > > jom 1.1.3 - empower your cores
    > > 	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -O2 -MD -W0 -EHsc -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DNDEBUG -IC:\Qt\5.12.1\Src\qtbase\config.tests\verifyspec -I. -IC:\Qt\5.12.1\Src\qtbase\mkspecs\win32-msvc -Fo @C:\Users\JERRY~1.ZAA\AppData\Local\Temp\verifyspec.obj.6760.0.jom
    > > verifyspec.cpp
    > > 	link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:verifyspec.exe @C:\Users\JERRY~1.ZAA\AppData\Local\Temp\verifyspec.exe.6760.94.jom
    > > LINK : fatal error LNK1158: cannot run 'rc.exe'
    > > jom: C:\Qt\5.12.1\Src\config.tests\verifyspec\Makefile [verifyspec.exe] Error 1158
    

  • Moderators

    @jzvel said in Configuring build of Qt for VS 2017 from source keeps failing:

    fatal error LNK1158: cannot run 'rc.exe'

    That means your Visual Studio tools aren't in your build environment.

    Did you run configure from the VS Developer Command Prompt?



  • Yes, only caveat is the terminal says vs2015 x64 Native Tools Command Prompt. Although I doubt that's the issue as I've previous tried configuring with -platform win32-msvc and got the same issue.


  • Moderators

    @jzvel said in Configuring build of Qt for VS 2017 from source keeps failing:

    Yes, only caveat is the terminal says vs2015 x64 Native Tools Command Prompt. Although I doubt that's the issue as I've previous tried configuring with -platform win32-msvc and got the same issue.

    This sounds more like an issue with your Visual Studio installation than an issue with your Qt configuration.

    Call rc.exe /? on your x64 Native Tools Command Prompt. What do you see?

    trying to build Qt such that I can get the debug symbols to figure out why the application crashes every few days or so

    You could install the debug symbols from the Qt installer instead.



  • Looks like vs2015 x64 Native Tools Command Prompt didn't know where rc.exe was so I added "C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64" to path environment variable. I'm a little surprised it didn't, I thought that was the whole point of VS having its own console.

    However now when compiling my project I get "'QAbstractSocket': is not a class or namespace name". What am I lacking to get this to build to work? Do I need qtwebengine for this to build?

    On a side note, how do I clear the configuration before trying a new one?


  • Moderators

    @jzvel said in Configuring build of Qt for VS 2017 from source keeps failing:

    However now when compiling my project I get "'QAbstractSocket': is not a class or namespace name". What am I lacking to get this to build to work? Do I need qtwebengine for this to build?

    See https://doc.qt.io/qt-5/qabstractsocket.html -- You need the Qt Network module.

    On a side note, how do I clear the configuration before trying a new one?

    Delete the build folder.



  • " -make module-qtconnectivity" doesn't seem to work. Any clue what I should be using?


  • Moderators

    @jzvel said in Configuring build of Qt for VS 2017 from source keeps failing:

    " -make module-qtconnectivity" doesn't seem to work

    The qtconnectivity.git repo contains the Qt Bluetooth and Qt NFC modules.

    The Qt Network module is a core module in qtbase.git and should already be built by default.

    Just add QT += network to your .pro file, then #include <QAbstractSocket>.



  • @jksh said in Configuring build of Qt for VS 2017 from source keeps failing:

    Just add QT += network to your .pro file, then #include <QAbstractSocket>.

    The project setup isn't the issue. I can point to the installed Qt binaries and it will build and run, but if I change it to the built binaries I get the error about the compiler not knowing where QAbstractSocket is.


  • Moderators

    @jzvel said in Configuring build of Qt for VS 2017 from source keeps failing:

    I can point to the installed Qt binaries and it will build and run, but if I change it to the built binaries I get the error about the compiler not knowing where QAbstractSocket is.

    Check your folder of built binaries. Are your *.h files and *.dlls there as expected? Compare the list of files with your installed binaries.

    Also, does the error message about QAbstractSocket point to your own code or to Qt's header files? If it's your code, add #include <QAbstractSocket> to the file. (If your file relies on indirect #includes, then things can break when you change Qt versions. It is recommended to explicitly #include every class that your code depends on)



  • So just to see if that was the only issue I was having, I skipped the one project that uses SMTP and built a different qt project which builds, but now I get a window saying: "This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem." Any suggestions? I see solutions about copying the plugin folder into your project directory, but that can't be it.

    0_1568837966140_91f5411b-5c7c-4000-b496-65ebd71115e6-image.png



  • UPDATE:

    Problem fixed, I renamed the folder in case I wanted to rerun the command (note the _t2 in that error msg). I didn't realize it would break things.


Log in to reply