Fail to build qt 5.2.1 static on windows 7 using tdm-gcc



  • hello
    i fail to build qt on w7 and i get this error
    building using qtsdk gcc goes fine

    @
    qml\qqmlengine.cpp: In function 'QString shellNormalizeFileName(const QString&)':
    qml\qqmlengine.cpp:2299:5: error: 'PIDLIST_ABSOLUTE' was not declared in this scope
    PIDLIST_ABSOLUTE file;
    ^
    qml\qqmlengine.cpp:2299:22: error: expected ';' before 'file'
    PIDLIST_ABSOLUTE file;
    ^
    In file included from c:\qt\tdm-gcc\include\winnt.h:34:0,
    from c:\qt\tdm-gcc\include\windef.h:253,
    from c:\qt\tdm-gcc\include\windows.h:48,
    from C:\Qt\Qt5.2.1\Static\src\qt-everywhere-opensource-src-5.2.1\qtbase\include\QtCore/../../src/coreli
    b/global/qt_windows.h:71,
    from C:\Qt\Qt5.2.1\Static\src\qt-everywhere-opensource-src-5.2.1\qtbase\include\QtCore/qt_windows.h:1,
    from C:\Qt\Qt5.2.1\Static\src\qt-everywhere-opensource-src-5.2.1\qtbase\mkspecs\win32-g++/qplatformdefs
    .h:63,
    from C:\Qt\Qt5.2.1\Static\src\qt-everywhere-opensource-src-5.2.1\qtbase\include\QtCore\5.2.1\QtCore/pri
    vate/../../../../../src/corelib/thread/qthread_p.h:57,
    from C:\Qt\Qt5.2.1\Static\src\qt-everywhere-opensource-src-5.2.1\qtbase\include\QtCore\5.2.1\QtCore/pri
    vate/qthread_p.h:1,
    from qml\qqmlengine.cpp:83:
    qml\qqmlengine.cpp:2300:49: error: 'file' was not declared in this scope
    if (FAILED(SHParseDisplayName(nameC, NULL, &file, 0, NULL)))
    ^
    qml\qqmlengine.cpp:2303:30: error: 'file' was not declared in this scope
    if (!SHGetPathFromIDList(file, buffer))
    ^
    Makefile.Release:30581: recipe for target '.obj/release/qqmlengine.o' failed
    mingw32-make[4]: *** [.obj/release/qqmlengine.o] Error 1
    mingw32-make[4]: Leaving directory 'C:/Qt/Qt5.2.1/Static/src/qt-everywhere-opensource-src-5.2.1/qtdeclarative/src/qml'
    Makefile:34: recipe for target 'release' failed
    mingw32-make[3]: *** [release] Error 2
    mingw32-make[3]: Leaving directory 'C:/Qt/Qt5.2.1/Static/src/qt-everywhere-opensource-src-5.2.1/qtdeclarative/src/qml'
    Makefile:44: recipe for target 'sub-qml-make_first-ordered' failed
    mingw32-make[2]: *** [sub-qml-make_first-ordered] Error 2
    mingw32-make[2]: Leaving directory 'C:/Qt/Qt5.2.1/Static/src/qt-everywhere-opensource-src-5.2.1/qtdeclarative/src'
    Makefile:41: recipe for target 'sub-src-make_first' failed
    mingw32-make[1]: *** [sub-src-make_first] Error 2
    mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.2.1/Static/src/qt-everywhere-opensource-src-5.2.1/qtdeclarative'
    Makefile:212: recipe for target 'module-qtdeclarative-make_first' failed
    mingw32-make: *** [module-qtdeclarative-make_first] Error 2
    @

    http://pastebin.com/d0jp2Pwa



  • I have same error! I try to build Qt 5.2.1 for a whole week, buy every time have this error. Someone can help to solve this problem?
    (sorry for my English grammar)



  • one year later, the problem is still present.
    the turn around found by defining PIDLIST_ABSOLUTE as a pointer to LPITEMIDLIST is not enought here. Should not deference the return of SHParseDisplayName (with &file).
    <edit>
    turnaround found when trying to build under mingw , gcc version 4.8.1
    but not necessary under Qt's mingw gcc 4.9.1 found in actual Qt5.4.1 distribution
    </edit>

    my mod to pass this point :
    in fileutils.cpp line 298 :

    #ifdef Q_OS_WIN
    	const QString nativeSeparatorName(QDir::toNativeSeparators(name));
    	const LPCTSTR nameC = reinterpret_cast<LPCTSTR>(nativeSeparatorName.utf16()); // MinGW
    	LPITEMIDLIST file;//<<<<<<<<<< direct use of LPITEMIDLIST 
    	HRESULT hr = SHParseDisplayName(nameC, NULL, file, 0, NULL);//<<<<<<<< instead of &file
    	if (FAILED(hr))
    		return name;
    	TCHAR buffer[MAX_PATH];
    	
    	if (!SHGetPathFromIDList(file, buffer))
    		return name;
    	return QDir::fromNativeSeparators(QString::fromUtf16(reinterpret_cast<const ushort *>(buffer)));
    #else // Filesystem is case-insensitive only on Windows
    	return name;
    #endif

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.