# Undefined function troubleshooting

**URL:** <https://forum.golangbridge.org/t/undefined-function-troubleshooting/37286>\
**Category:** Technical Discussion\
**Created:** [December 23, 2024, 2:05pm UTC](https://forum.golangbridge.org/t/undefined-function-troubleshooting/37286 "2024-12-23T14:05:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![huaraz](https://forum.golangbridge.org/letter_avatar_proxy/v4/letter/h/c2a13f/32.png) [@huaraz](https://forum.golangbridge.org/u/huaraz)\
**Post date:** [December 23, 2024, 2:05pm UTC](https://forum.golangbridge.org/t/undefined-function-troubleshooting/37286/1 "2024-12-23T14:05:37Z")

</div>

I get an undefined function error although the function exists in the code. How can I find the reason ? What methods can I use to troubleshoot this situation

I import:

```
    "github.com/jcmturner/gokrb5/v8/client"
    "github.com/jcmturner/gokrb5/v8/config"
    "github.com/jcmturner/gokrb5/v8/credentials"
    "github.com/jcmturner/gokrb5/v8/krberror"
    "github.com/jcmturner/gokrb5/v8/spnego"

```

and can use successfully client.NewWithPassword but not client.NewClientFromCCache which are both defined in [gokrb5/client/client.go at master · jcmturner/gokrb5 · GitHub](https://github.com/jcmturner/gokrb5/blob/master/client/client.go)

---

<div class="post-metadata">

**Author:** ![pekim](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/pekim/32/14094_2.png) [@pekim](https://forum.golangbridge.org/u/pekim)\
**Post date:** [December 23, 2024, 3:31pm UTC](https://forum.golangbridge.org/t/undefined-function-troubleshooting/37286/2 "2024-12-23T15:31:48Z")

</div>

I’m not sure what’s causing your problem, but I can build a project that uses both of the functions that you mention.

`go.mod`

```auto
module temp

go 1.23.4

require github.com/jcmturner/gokrb5/v8 v8.4.4

require (
	github.com/hashicorp/go-uuid v1.0.3 // indirect
	github.com/jcmturner/aescts/v2 v2.0.0 // indirect
	github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
	github.com/jcmturner/gofork v1.7.6 // indirect
	github.com/jcmturner/rpc/v2 v2.0.3 // indirect
	golang.org/x/crypto v0.6.0 // indirect
	golang.org/x/net v0.7.0 // indirect
)

```

`main.go`

```go
package main

import (
	"fmt"

	"github.com/jcmturner/gokrb5/v8/client"
	"github.com/jcmturner/gokrb5/v8/config"
	"github.com/jcmturner/gokrb5/v8/credentials"
)

func main() {
	c1 := client.NewWithPassword("", "", "", &config.Config{})
	fmt.Println(c1)

	c2, err := client.NewFromCCache(&credentials.CCache{}, &config.Config{})
	fmt.Println(err)
	fmt.Println(c2)
}

```

```sh
$ go build main.go
$ ls -l
total 3096
-rw-r--r--. 1 mike mike 409 Dec 23 15:25 go.mod
-rw-r--r--. 1 mike mike 6203 Dec 23 15:25 go.sum
-rwxr-xr-x. 1 mike mike 3150575 Dec 23 15:30 main
-rw-r--r--. 1 mike mike 365 Dec 23 15:24 main.go

```

So it’s probably something silly. Perhaps a typo?

---

<div class="post-metadata">

**Author:** ![huaraz](https://forum.golangbridge.org/letter_avatar_proxy/v4/letter/h/c2a13f/32.png) [@huaraz](https://forum.golangbridge.org/u/huaraz)\
**Post date:** [December 24, 2024, 12:39am UTC](https://forum.golangbridge.org/t/undefined-function-troubleshooting/37286/3 "2024-12-24T00:39:44Z")

</div>

Oh yes something silly. the function name changed i.e. it lost Client in the name. 😊

---

<div class="post-metadata">

**Author:** ![system](https://forum.golangbridge.org/uploads/default/original/2X/5/5ad234f7c3dbc68b6cc72d338ce4f2973d9fd81c.png) [@system](https://forum.golangbridge.org/u/system)\
**Post date:** [March 24, 2025, 12:40am UTC](https://forum.golangbridge.org/t/undefined-function-troubleshooting/37286/4 "2025-03-24T00:40:29Z")

</div>

Closed on March 24, 2025, 12:40am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
