fedora14下编译qtopia问题

时间:2022-06-25 19:30:35

主要用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都会被覆盖。