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

Unable to link go app against gocv in container #14

Open
Sauraus opened this issue Feb 27, 2019 · 0 comments
Open

Unable to link go app against gocv in container #14

Sauraus opened this issue Feb 27, 2019 · 0 comments

Comments

@Sauraus
Copy link
Collaborator

Sauraus commented Feb 27, 2019

Step 7/13 : ENV CGO_LDFLAGS "-L/usr/local/lib64 -lopencv_core -lopencv_face -lopencv_videoio -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs -lopencv_objdetect -lopencv_features2d -lopencv_video -lopencv_dnn -lopencv_xfeatures2d -lopencv_plot -lopencv_tracking"
---> Running in bc1b6ba9cb0b
Removing intermediate container bc1b6ba9cb0b
---> 26a9b6248b32
Step 8/13 : RUN cd $GOPATH/src/github.com/EsportsOne/oneview-golang && CGO_ENABLED=1 GOOS=linux packr2 build -a -tags netgo -ldflags '-w -extldflags "-static"' -o oneview .
---> Running in e2fc156622c4
github.com/EsportsOne/oneview-golang
/usr/local/go/pkg/tool/linux_amd64/link: running g++ failed: exit status 1
/usr/lib/gcc/x86_64-alpine-linux-musl/8.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lopencv_core

The above is the error that I get when I try to actually build a static go app that is dependent on gocv, I had to overwrite the CGO_LDFLAGS because the development image defined the folder as being -L/usr/local/lib without the 64 part which is wrong for Alpine.

I can see the opencv_core lib in the /usr/local/lib64 folder and its also listed in the CFO_LDFLAGS and yet the linker barfs on them any idea?

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