Eiffel 18.07 尝试从示例中获取 ODBC 连接 运行

Eiffel 18.07 trying to get an ODBC connection running from examples

尝试在 Debian 9 上编译 Eiffel_18.07/examples/store/esql/ 我遇到了以下错误:

In file included from od243.c:202:0,
                 from big_file_C8_c.c:42:
/opt/Eiffel_18.07/library/store/dbms/rdbms/odbc/Clib/odbc.h:27:17: fatal error: sql.h: No such file or directory
 #include <sql.h>
                 ^
compilation terminated.
Makefile:36: recipe for target 'big_file_C8_c.o' failed
make[1]: *** [big_file_C8_c.o] Error 1
Makefile:72: recipe for target 'C8/Cobj8.o' failed
make: *** [C8/Cobj8.o] Error 2
make: *** Waiting for unfinished jobs....

一个 apt-get install unixodbc unixodbc-dev odbc-postgresql 让我更进一步

gcc: error: /opt/Eiffel_18.07/library/store/spec/linux-x86-64/lib/libodbc.a: No such file or directory
Makefile:177: recipe for target 'esql' failed

当我尝试进入 /opt/Eiffel_18.07/library/store/dbms/rdbms/odbc/Clib 时,我想我将能够生成一些代码以使其在 /opt/Eiffel_18.07/library/store/install 进入 /opt/Eiffel_18.07/library/store/dbms/rdbms/odbc/Clib 之后运行,尝试 sudo /opt/Eiffel_18.07/studio/spec/linux-x86-64/bin/finish_freezing -library 得到

cp: cannot stat '/usr/include/eiffelstudio-18.07/config.sh': No such file or directory
Can't find config.sh.
Makefile.SH: 6: .: Can't open ./config.sh

作为 Eiffel 的粉丝,它似乎不是开箱即用的,我没有找到足够的文档来让它工作:-()

下面是一系列步骤,让我可以在 Ubuntu 16.04:

上构建示例
  1. 下载并解压EiffelStudio到一个新目录中(让我们将绝对路径表示为#ES#)。

  2. 设置环境变量:

    export ISE_EIFFEL=#ES#
    export ISE_PLATFORM=linux-x86-64
    export PATH=$PATH:$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
    

    这些命令假定 bash,在使用另一个 shell 时用等效项替换它们。

  3. 安装包unixodbc-dev:

    sudo apt-get install unixodbc-dev
    
  4. 编译Eiffel库的C代码store:

    cd ${ISE_EIFFEL}/library/store/dbms/rdbms/odbc/Clib
    finish_freezing -library
    

    注意: 无需在 finish_freezing 前加上 sudo 前缀,除非 EiffelStudio 已安装到路径普通用户没有写权限。否则(例如,对于 Debian 9 上的问题的原始发布者,其中 EiffelStudio 已安装在 /opt 下),权限有待提升:

    sudo -i
    cd ${ISE_EIFFEL}/library/store/dbms/rdbms/odbc/Clib
    finish_freezing -library
    exit
    
  5. 编译示例esql:

    cd ${ISE_EIFFEL}/examples/store/esql
    ec -c_compile -config esql.ecf -target esql_odbc
    
  6. 运行编译后的可执行文件:

    ./EIFGENs/esql_odbc/W_code/esql
    

以 root 身份登录改变了我的问题,而不是只执行 finish_freezing 命令的 sudo

    sudo -i

然后

    cd ${ISE_EIFFEL}/library/store/dbms/rdbms/odbc/Clib
    finish_freezing -library