[Qt-interest] 4.6.2 qmake mingw bug when generating scripts for ar

Alex deathbaba at gmail.com
Thu Mar 4 23:28:46 CET 2010


Hello,

I've encountered some errors when used Qt 4.6.2 mingw binaries with mingw
itself from Qt-Creator 1.3.1
When I used absolute paths for temporary files and binaries inside my
static library project, ar tool
gave me error about invalid lines in it's input script. I've checked ar's
script (which is generated by
qmake) and found, that it misses ADDMOD keyword when path is absolute.
I've found inside qmake sources
the reason for such behavior:

qmake/generators/win32/mingw_make.cpp

void createArObjectScriptFile(const QString &fileName, const QString
&target, const QStringList &objList)
{
         QString filePath = Option::output_dir + QDir::separator() +
fileName;
         QFile file(filePath);
         if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
             QTextStream t(&file);
             t << "CREATE " << target << endl;
             for (QStringList::ConstIterator it = objList.constBegin(); it  
!=
objList.constEnd(); ++it) {
                 if (QDir::isRelativePath(*it))
		t << "ADDMOD " << *it << endl;
	    else
		t << *it << endl;
             }
             t << "SAVE" << endl;
	t.flush();
             file.close();
         }
}

After commenting out "if (QDir::isRelativePath(*it))" condition and
rebuilding qmake everything works fine.

So, is it correct behavior? What was the reason for this "if"?

With best regards,
Alex Zolotarev



More information about the Qt-interest-old mailing list