mysteriumnetwork / go-openvpn

GNU Affero General Public License v3.0
119 stars 34 forks source link

running c++ failed: exit status 1 #69

Open QU35T-code opened 1 year ago

QU35T-code commented 1 year ago

go get -u github.com/mysteriumnetwork/go-openvpn

if _, err := os.Stat(vpnFileParam); os.IsNotExist(err) {
            fmt.Println("The file does not exist :", vpnFileParam)
            os.Exit(1)
        }
        bytes, err := os.ReadFile(vpnFileParam)
        if err != nil {
            log.Fatal(err.Error())
        }
        config := openvpn3.NewConfig(string(bytes))
        session := openvpn3.NewSession(config, openvpn3.UserCredentials{}, &loggingCallbacks{})
        session.Start()
        err = session.Wait()
        if err != nil {
            fmt.Println("Openvpn3 error: ", err)
        } else {
            fmt.Println("Graceful exit")
        }
}
/opt/homebrew/Cellar/go/1.21.0/libexec/pkg/tool/darwin_arm64/link: running c++ failed: exit status 1
ld: Undefined symbols:
  _check_library, referenced from:
      __cgo_c835f25f288e_Cfunc_check_library in 000002.o
  _cleanup_session, referenced from:
      __cgo_c835f25f288e_Cfunc_cleanup_session in 000005.o
  _new_session, referenced from:
      __cgo_c835f25f288e_C2func_new_session in 000005.o
      __cgo_c835f25f288e_Cfunc_new_session in 000005.o
  _reconnect_session, referenced from:
      __cgo_c835f25f288e_Cfunc_reconnect_session in 000005.o
  _start_session, referenced from:
      __cgo_c835f25f288e_C2func_start_session in 000005.o
      __cgo_c835f25f288e_Cfunc_start_session in 000005.o
  _stop_session, referenced from:
      __cgo_c835f25f288e_Cfunc_stop_session in 000005.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)