Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exit status 0xc0000135, golang with windows #434

Open
ducnpdev opened this issue Sep 30, 2022 · 3 comments
Open

exit status 0xc0000135, golang with windows #434

ducnpdev opened this issue Sep 30, 2022 · 3 comments

Comments

@ducnpdev
Copy link

ducnpdev commented Sep 30, 2022

I have one issue, when start golang with windows:

i download cliet: https://www.oracle.com/database/technologies/instant-client/winx64-64-downloads.html

  • where pkg-config:
    C:\ProgramData\chocolatey\bin\pkg-config.exe

  • path of file oci8.pc
    C:\ProgramData\chocolatey\bin\oci8.pc

  • oci8.oc:
    prefix=D:/app/instantclient-sdk-windows-12.2/instantclient_12_2
    exec_prefix=${prefix}
    libdir=D:/app/instantclient-sdk-windows-12.2/instantclient_12_2/sdk/lib/msvc
    includedir=D:/app/instantclient-sdk-windows-12.2/instantclient_12_2/sdk/include
    glib_genmarshal=glib-genmarshal
    gobject_query=gobject-query
    glib_mkenums=glib-mkenums
    Name: oci8
    Description: oci8 library
    Libs: -L${libdir} -loci
    Cflags: -I${includedir}
    Version: 12.12

  • pkg-config --cflags --libs -- oci8:
    -ID:/app/instantclient-sdk-windows-12.2/instantclient_12_2/sdk/include -LD:/app/instantclient-sdk-windows-12.2/instantclient_12_2/sdk/lib/msvc -loci

  • go version:
    go version go1.18.6 windows/amd64

my-code:
package main

import (
"database/sql"
"fmt"

_ "github.com/mattn/go-oci8"

)

func main() {
fmt.Println("func main")
connectionString := "oracle://" + "user" + ":" + "pass" + "@" + "0.0.0.0" + ":" + "1521" + "/" + "database"
db, err := sql.Open("oci8", connectionString)
if err != nil {
panic(err)
}
err = db.Ping()
if err != nil {
panic(err)
}
fmt.Println("oracle connect successfully")
}

after run in cmd: go run main.go, I see error:
exit status 0xc0000135,

@mattn
Copy link
Owner

mattn commented Sep 30, 2022

Probably, you need to add path to the DLLs provided from Oracle Client into your %PATH%

@chengang2
Copy link

I have the same problem, how did you solve it?

@wangjian8774
Copy link

you can try pkg-config --cflags oci8 and see the output, if there is error reported by pop-up window which content likes "libglib-2.0-0.dll not exist", just copy one into mingw64\bin, then have a try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants