Skip to content

dyld: Library not loaded: libdb2.dylib when running GO ibm_DB sdk in MAC #24

Closed
@sanjeevghimire

Description

@sanjeevghimire

when running the code snippet I get this error:

I installed the driver as per the instruction in the readme. the lib folder has the file libdb2.dylib but it complains about it:

  Referenced from: /var/folders/_h/4trwzcd908g703_vdw2q1yn00000gn/T/go-
build774492263/b001/exe/db2conn
  Reason: image not found
signal: abort trap```

the code I am using is:

package main

import (
_ "github.com/ibmdb/go_ibm_db"
"database/sql"
"fmt"
)

func main(){
con:="HOSTNAME=host;DATABASE=db;PORT=50000;UID=u;PWD=pwd"
db, err:=sql.Open("go_ibm_db", con)
if err != nil{

	fmt.Println(err)
}
db.Close()

}


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions