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

symbol lookup error: git2go_play: undefined symbol: git_reference_is_tag #79

Closed
timhughes opened this issue Apr 2, 2014 · 2 comments
Closed

Comments

@timhughes
Copy link

fedora: 20
go:1.1
libgit2: f28e4c97b38c1ec60dc6ce6e5306067ad24aeb8e (Tue Apr 1 2014)
git2go: 9cd1d12

I have a issue with the Reference.IsTag() method which appears to be unimplemented but Reference.IsBranch() works. I have checked the code base in both libgit2 and git2go and they bothe appear to be implemented the same.

git2go_play --repo ~/git/testrepo/
&{0x8ec2d0}
git2go_play: symbol lookup error: git2go_play: undefined symbol: git_reference_is_tag

Sample code

package main

import (
    "github.com/libgit2/git2go"
    "fmt"
    "log"
    "flag"
)

func main(){
    repoPath := flag.String("repo", "~/git/testrepo", "path to the git repository")
    flag.Parse()

    repo, err := git.OpenRepository(*repoPath)
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println(repo)
    refs, err := repo.NewReferenceIterator()
    if err != nil {
        log.Fatal(err)
    }
    for ref := range refs.Iter() {
        msg := ""
        if ref.IsBranch() {
            msg += "IsBranch"
        }
        if ref.IsTag() {
            msg += "IsTag"
        }
        if ref.IsRemote(){
            msg += "IsRemote"
        }

        fmt.Printf("%s: %s\n", msg, ref.Name())

    }
}
@carlosmn
Copy link
Member

carlosmn commented Apr 2, 2014

That version of the library does have that function. Have you double-checked your library load paths? Does ldd git2go_play show where you installed this version of the library?

@timhughes
Copy link
Author

sorry, my fault. Fedora doesn't look in /usr/local/lib/ by default so it was picking up the fedora packaged version. I uninstalled the fedora libgit2 rpms and fixed my ld configs so that it would find the library I compiled from source.

sudo yum -y remove libgit2 libgit2-devel

sudo "echo /usr/local/lib > /etc/ld.so.conf.d/local-libs.conf"
sudo ldconfig

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

2 participants