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

Cgo link error on macOS #6

Open
wewindy opened this issue Oct 14, 2024 · 0 comments
Open

Cgo link error on macOS #6

wewindy opened this issue Oct 14, 2024 · 0 comments

Comments

@wewindy
Copy link

wewindy commented Oct 14, 2024

I add this package to my simple go package:

go get github.com/qmuntal/draco-go

And I use the starter code from README:

package main

import (
	"fmt"
	"os"

	"github.com/qmuntal/draco-go/draco"
)

func main() {
  data, _ := os.ReadFile("./testdata/test_nm.obj.edgebreaker.cl4.2.2.drc")
  m := draco.NewMesh()
  d := draco.NewDecoder()
  d.DecodeMesh(m, data)
  fmt.Println("nº faces:", m.NumFaces())
  fmt.Println("nº points:", m.NumPoints())
  faces := m.Faces(nil)
  for i, f := range faces {
    fmt.Printf("%d: %v\n", i, f)
  }
}

When I run go build, report some warnings and errors:

/usr/local/go/pkg/tool/darwin_arm64/link: running clang failed: exit status 1
ld: library 'draco_c' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)

My platform:

  • macOS 15
  • chip: m2 (arm64)
  • go version: 1.20
  • gcc: Apple clang version 16.0.0 (clang-1600.0.26.3)
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

1 participant