Eiffel 18.07试图从示例中运行ODBC连接

时间:2018-09-19 21:14:37

标签: odbc sudo eiffel

尝试仅在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

作为埃菲尔铁塔的粉丝,它似乎并没有开箱即用,而且我也没有找到足够的文档来使其正常运行:-()

2 个答案:

答案 0 :(得分:1)

以下是一系列步骤,使我可以在 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库 store 的C代码:

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

    注意:除非将 EiffelStudio 安装到没有普通用户写入权限的路径,否则无需在finish_freezing之前为sudo加上前缀。否则(例如,对于 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
    

答案 1 :(得分:0)

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

    sudo -i

然后

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