中标麒麟QT+ODBC+人大金仓开发环境配置

一、吐槽     

       最近由于项目的背景,需要在中标麒麟的系统上搭建QT通过ODBC访问人大金仓数据库的开发环境,平常用惯了Ubuntu手到擒来的特性,实在有点不适应。在找了大半天也没有找到麒麟提供的软件源的情况下,我发现它有可能基于REHL6.4深度定制,就索性给它换了一套由163提供的CentOS源,结果倒是发现很多待安装的软件包依赖都不是很好,真是醉了。实在没办法只能源码编译走起  : ( 

二、安装人大金仓     

      就整体的思路来说,安装人大金仓的过程分为两部分:一、选择安装特性、解压缩文件、配置文件和环境变量,二、安装驱动、安装并启动服务。在上述安装步骤完成的基础上,就可以创建一个数据库实例,完成初始化活动。

      我安装过程中的问题出在执行 Root.sh 的过程中。(前面的步骤可以按照《金仓数据库管理系统KingbaseES V7 快速安装指南》走,一般来说问题不大)从出错的信息出发去查找shell文件,可以发现是对应的环境变量没有赋值,导致出现路径中出现这个符号 $,以及找不到目录、文件和用户名。

      解决问题的方法,就是在保存当前用户的环境变量的文件中去添加这些变量,然后修改 Root.sh 保证 shell 文件能得到正确的值。

错误如下:

        [root@localhost Install]# sh Root.sh

        Root.sh:行20: $/Install/root.log: 没有那个文件或目录

        Root.sh:行21: $/Install/root.log: 没有那个文件或目录

        Root.sh:行22: $/Install/root.log: 没有那个文件或目录

        cp: 无法获取"$/Uninstall/rmln.sh" 的文件状态(stat): 没有那个文件或目录

        Root.sh: 第 247 行:cd: $/Install/startup-desktop/icons: 没有那个文件或目录

        find: `./hicolor': 没有那个文件或目录 

        tee: $/Install/root.log: 没有那个文件或目录

 

       id: $: no such user

       chown: 无效的用户: "$."

       chmod: 无法访问"$/Install/root.log": 没有那个文件或目录

       Complete.

       在解决这个问题之后,还有可能遇到动态链接库找不到的问题,按照它的需求,对一些已存在的的库,做一个软链接即可。

三、配置ODBC数据源

       如何配置ODBC数据源可以参照《KingbaseES系统安装》(官方提供的手册)。但是,在配置完 odbc.ini 与 odbcinst.ini  两个文件之后,仍需要配置环境变量,ODBCINI 和 ODBCSYSINI 来指定上述两个配置文件的位置。否则可能出现如下错误:

        [zzuie@localhost Desktop]$ isql -v kingbase

        [08001][unixODBC]Could not connect to the server

        [08001][unixODBC]Could not connect to server;

        [ISQL]ERROR: Could not SQLConnect

四、编译安装 QT 5.3.2

       我使用的中标麒麟版本中,GCC的版本是 4.4.7 而且不包含 G++功能。要编译安装QT 5.3.2,至少要使用 GCC 4.8.4 且具有G++功能。可是 GCC4.8.4 已经转移到了 C++ 上,那么问题来了,怎么安装高版本的GCC ?

       GCC 4.8 Release Series Changes, New Features, and Fixes: GCC now uses C++ as its implementation language.

       This means that to build GCC from sources, you will need a C++ compiler that understands C++ 2003.

       https://gcc.gnu.org/gcc-4.8/changes.html

你可以安装一个低版本的GCC  : ), 然后再安装高版本的GCC。然后然后你就可以很欢畅地去编译 QT 5.3.2 了

updated 2015/4/20

   上述表达:“要编译安装QT 5.3.2,至少要使用 GCC 4.8.4 且具有G++功能”,是错误的。其实后来在编译安装QT5.3.2过程中,我使用源码编译安装了GCC 4.7.0 ,在此基础上仍然可以编译QT5.3.2。QT官方给出的环境如下:

http://doc.qt.io/qt-5/supported-platforms.html,指出:

  Platform                                                            Compiler

     Ubuntu Linux 11.10, X11 (32-bit and 64-bit)         As provided by Ubuntu
     Ubuntu Linux 12.04, X11 (64-bit)                         As provided by Ubuntu
     RedHat 6.5, X11 (64-bit)                                     As provided by Red Hat
     openSUSE 13.1, X11 (64-bit)                               As provided by SUSE

   Ubuntu Release Notes

     Ubuntu 11.10 includes gcc 4.6 as the default compiler. The GCC packages are built from the 4.6-2011.07 Linaro GCC release based on the GCC 4.6.1 release. See ToolChain/CompilerFlags for a summary of compiler defaults which are different from the upstream release.

  Ubuntu 12.04 is distributed with a default toolchain that includes: GCC 4.6.3 (and changes from Linaro GCC 4.6-2012.02), binutils 2.22, eglibc 2.15, andLinaro gdb 7.4-2012.04.

     RedHat Enterprise Linux Desktop(v.6)

     

     Reference:  https://wiki.ubuntu.com/OneiricOcelot/ReleaseNotes#GCC_4.6_Toolchain

        https://wiki.ubuntu.com/PrecisePangolin/ReleaseNotes/UbuntuDesktop
                        https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html-single/6.5_Technical_Notes/index.html#gcc  

                        https://rhn.redhat.com/errata/RHBA-2013-1609.html

posted @ 2015-03-20 22:44  Madshaw  阅读(4149)  评论(5编辑  收藏  举报