doulei6778 2018-03-12 14:19
浏览 108
已采纳

Golang DB2错误

I'm trying to connect to a db2 using golang using https://bitbucket.org/phiggins/db2cli. While trying to follow the instructions, I run into this error

vendor/bitbucket.org/phiggins/db2cli/api/api_unix.go:12:11: fatal 
error: 'sqlcli1.h' file not found
#include <sqlcli1.h>
      ^~~~~~~~~~~
1 error generated.

This is the script I tried to use

#!/bin/bash
DB2HOME=$HOME/sqllib
export CGO_LDFLAGS=-L$DB2HOME/lib
export CGO_CFLAGS=-I$DB2HOME/include

go install .

Could someone point me to what I need to do to use db2cli? I'm running this code on a macbook.

  • 写回答

1条回答 默认 最新

  • duanlong4890 2018-03-12 15:50
    关注

    To build golang with the phiggins db2cli , your workstation or server needs to have a Db2 product (e.g. a suitable client, or a server package) installed locally specifically to deliver the INCLUDE files and the library files for development with Db2.

    The Db2-client software comes in different packages for different purposes, and a Db2-client also comes with a Db2-LUW server. For development purposes (i.e. to compile and link executable programs) you need the "IBM Data Server Driver package".

    IBM describes the different Db2 client types at this link.

    If your remote Db2-server runs on Linux/Unix/Windows, you can also try building golang-db2cli on that hostname and copy the build-targets to your workstation provided the server and workstation run the same distro and bitness and release and that the Db2 version/fixpack is identical to that of the client.

    Otherwise you can download and install the relevant package from IBM's Fix Central website (registration required) , or from IBM's Passport Advantage website for registered entitled customers. The Db2-client download links are available currently at this link.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来