Go-oci8 compiling the installation process (as opposed to official instructions)

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Go-oci8 Download Address and description address: Https://github.com/wendal/go-oci

GO-OCI8 Official description

    1. Install the latest version of Git and set the git command to be called directly from the command line

    2. This step is a little bit more

      2.1 下载OCI最新版,存放于C:\instantclient_11_22.2 下载OCI SDK最新版,存放于C:\instantclient_11_2\sdk2.3 下载MinGW最新版,安装在C:\mingw2.4 下载pkg-config.exe和oci8.pc (已经存放在windows文件夹下)2.5 将pkg-config.exe复制到C:\mingw\bin\下2.6 将oci8.pc复制到C:\mingw\lib\pkg-config\下
    3. Modify system environment variables, add

    PATH=原有PATH;C:\instantclient_11_2;C:\mingw\bin;    PKG_CONFIG_PATH=C:\mingw\lib\pkg-config
    1. Performgo get github.com/wendal/go-oci8

      The second download, can be downloaded here, where the environment has been configured
      If this step is not in go-oci8 official download, but and I then, step by step to the various software official website to download, then pay attention to

    1. After downloading and installing, need to modify oci8.pc;

    # Package Information for pkg-config         prefix=C:/instantclient_11_2    exec_prefix=C:/instantclient_11_2    libdir=${exec_prefix}    includedir=${prefix}/sdk/include/         Name: OCI    Description: Oracle database engine    Version: 11.2    Libs: -L${libdir} -loci    Libs.private:     Cflags: -I${includedir}
  1. This package is not supported by win x64, I have not tested the 64-bit version of the installation

  2. This timego get github.com/wendal/go-oci

  3. If you appear like me

      C:\Documents and Settings\administrator>go get github.com/wendal/ GO-OCI8 # github.com/wendal/go-oci8 C:\gopath\src\github.com\wendal\go-oci8\oci8.go:119:cannot use (**C.struct_OCIS erver) (unsafe. Pointer (&CONN.SVC)) (type **c.struct_ociserver) as type **c.struct _ocisvcctx in argument to _cfunc_ocilogon C:\Go Path\src\github.com\wendal\go-oci8\oci8.go:136:cannot Use (*c.struct_ociserver) (c.svc) (type *C.struct_OCIServer) As type *c.struct_ocisvcctx in argument to _cfunc_ocilogoff c:\gopath\src\github.com\wendal\go-oci8\oci8.go:263: Cannot use (*c.struct_ociserver) (s.c.svc) (type *c.struct_ociserver) as type *c.struct_ocisvcctx on argument to _cfunc_oc Istmtexecute c:\gopath\src\github.com\wendal\go-oci8\oci8.go:383:cannot Use (*c.struct_ociserver) (S.C.SVC) (type * C.struct_ociserver) as type *c.struct_ocisvcctx in argument to _cfunc_ocistmtexecute  

This error indicates that you installed the OCI version and Go-oci8 inconsistent, this time to find the %GOPATH%\src\github.com\wendal\go-oci8\oci8.go file

There are 4 places to change

    • 119 Rows

    • 136 Rows

    • 263 rows

    • 383 rows


or replace the Ociserver directly with the ocisvcctx. Re-execute

go get github.com/wendal/go-oci

Fix it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.