[Kde-pim] Akonadi-1.2.1 build error

Sagara Wijetunga sagara at tomahawk.com.sg
Fri Oct 23 15:04:01 BST 2009


Ingo Klöcker wrote:
> On Friday 23 October 2009, Sagara Wijetunga wrote:
>   
>> Sagara Wijetunga wrote:
>>     
>>> Ok, I have debugged the /usr/bin/automoc4. What happens is,
>>> AutoMoc::dotFilesCheck(bool x) exists with EXIT_FAILURE.
>>>
>>> Breakpoint 1, AutoMoc::dotFilesCheck (this=0xbfbfe988, x=false)
>>>     at /tmp/automoc4-0.9.88/kde4automoc.cpp:105
>>> 105         if (!x) {
>>>
>>>
>>> (gdb) backtrace
>>> #0  AutoMoc::dotFilesCheck (this=0xbfbfe988, x=false)
>>>     at /tmp/automoc4-0.9.88/kde4automoc.cpp:105
>>> #1  0x0804debe in AutoMoc::run (this=0xbfbfe988)
>>>     at /tmp/automoc4-0.9.88/kde4automoc.cpp:259
>>> #2  0x0805382c in main (argc=0, argv=0x0)
>>>     at /tmp/automoc4-0.9.88/kde4automoc.cpp:114
>>>
>>>
>>> The backtrace shows AutoMoc::dotFilesCheck() is called at line 259.
>>>
>>> dotFiles.setFileName(args[1] + QLatin1String(".files"));
>>> dotFiles.open(QIODevice::ReadOnly | QIODevice::Text);
>>>
>>> const QByteArray &line = dotFiles.readLine();
>>> Line 259 => dotFilesCheck(line == "SOURCES:\n");
>>>
>>> Regards
>>> Sagara
>>>       
>> Due to some reason, the comparison in the dotFilesCheck() produces
>> false, therefore, it goes into dotFilesCheck() and prints and error
>> message and exits. This error message also does not appear.
>>
>> Following code fragment is from kde4automoc.cpp of automoc4
>> (ftp://ftp.kde.org/pub/kde/stable/automoc4/):
>>
>>     cout << "args[1]: " << args[1] << '\n';     // sagara
>>
>>     dotFiles.setFileName(args[1] + QLatin1String(".files"));
>>     dotFiles.open(QIODevice::ReadOnly | QIODevice::Text);
>>
>>     const QByteArray line = dotFiles.readLine();
>>
>>     cout << "line: " << line << '\n';    // sagara
>>
>>     dotFilesCheck(line == "SOURCES:\n");
>>
>>
>> When run  automoc4, it does not display any output. A simple C++ test
>> program produces output.
>>
>> What else do I have to do to see output from  automoc4?
>>     
>
> Use qDebug() (and its friends) instead of cout.
>
>
> Regards,
> Ingo
>   

Ingo, thanks for the info. I'm not good in C++ but I'm a good C 
programmer. With help from you guys I can proceed and find where the 
error is.

1. /usr/bin/automoc4 --help, /usr/bin/automoc4 --version does not print 
anything. It seems these are implemented using cout:
if ((args[1]=="--help") || (args[1]=="-h")) {
        printUsage(args[0]);
       ::exit(0);
        }
        else if (args[1]=="--version") {
        printVersion();
       ::exit(0);
        }

void AutoMoc::printUsage(const QString &path)
{
    cout << "Usage: " << path << " <outfile> <srcdir> <builddir> <moc 
executable> <cmake executable> [--touch]" << endl;
}

void AutoMoc::printVersion()
{
    cout << "automoc4 " << AUTOMOC4_VERSION << endl;
}


2. All dotFiles.readLine() calls are of following type:
QByteArray line = dotFiles.readLine();

But the problematic one is:
const QByteArray &line = dotFiles.readLine();

Not sure whether the "&line" is correct?


3. If you could help me with how to write a qDebug() to display the 
args[1] and line, I can check what's it reading and further narrow down 
the issue.

Regards
Sagara
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list