fedora14下編譯qtopia問題

來源:互聯網
上載者:User

主要用strrchr函數時,從類型‘const char*’到類型‘char*’的轉換無效,新版本g++不支援報錯了。

錯誤1:
     backend/vobject.cpp: In function ‘VObject* addGroup(VObject*, const char*)’:
     backend/vobject.cpp:419: error: invalid conversion from ‘const char*’ to ‘char*’

 修改/x86-qtopia-2.2.0/qtopia/src/libraries/qtopia/backend/vobject.cpp:419行
        char *dot = strrchr(g,'.');
 為    char *dot = (char*)strrchr(g,'.');

錯誤2:
      wavplugin.cpp: 在成員函數‘virtual bool WavPlugin::isFileSupported(const QString&)’中:
      wavplugin.cpp:435:45: 錯誤:從類型‘const char*’到類型‘char*’的轉換無效

修正/x86-qtopia-2.2.0/qtopia/src/plugins/codecs/wavplugin/wavplugin.cpp:435行
       char *ext = strrchr( path.latin1(), '.' );
為    char *ext = (char*)strrchr( path.latin1(), '.' );

錯誤3:

       /usr/bin/ld: .obj/release-shared/transferserver.o: undefined reference to symbol 'crypt@@GLIBC_2.0'
       /usr/bin/ld: note: 'crypt@@GLIBC_2.0' is defined in DSO /lib/libcrypt.so.1 so try adding it to the linker command line

       這個找了好久發現用了crypt函數 而沒使用-lcrypt,   qtopia-2.2.0-FriendlyARM/qtopia/configure  1373行加入

       print CONFIG_PRI "LIBS+=-lcrypt/n";

如下:

    print CONFIG_PRI "QTOPIA_FONT_SIZES=$opt_fontsizes/n";
    print CONFIG_PRI "QTOPIA_FONT_FAMILIES=$opt_fontfamilies/n";
    print CONFIG_PRI "LIBS+=-lcrypt/n";

注意修改每次build時都會從qtopia-2.2.0.tar.gz解壓出來,需要修改qtopia-2.2.0.tar.gz裡的檔案,要不每次build都會被覆蓋。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.