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

Getting gst_message_stringer.go:17:10: undefined: Message while trying to deploy to docker #31

Open
its-saeed opened this issue Mar 18, 2022 · 6 comments

Comments

@its-saeed
Copy link

Building a project which depends on go-gst with this command:

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o main .

results in the following errors:

../../../go/pkg/mod/github.com/tinyzimmer/[email protected]/gst/gst_message_stringer.go:17:10: undefined: Message
../../../go/pkg/mod/github.com/tinyzimmer/[email protected]/gst/gst_message_stringer.go:21:7: undefined: MessageEOS
../../../go/pkg/mod/github.com/tinyzimmer/[email protected]/gst/gst_message_stringer.go:24:7: undefined: MessageInfo
../../../go/pkg/mod/github.com/tinyzimmer/[email protected]/gst/gst_message_stringer.go:27:7: undefined: MessageWarning
../../../go/pkg/mod/github.com/tinyzimmer/[email protected]/gst/gst_message_stringer.go:30:7: undefined: MessageError
../../../go/pkg/mod/github.com/tinyzimmer/[email protected]/gst/gst_message_stringer.go:33:7: undefined: MessageTag
../../../go/pkg/mod/github.com/tinyzimmer/[email protected]/gst/gst_message_stringer.go:40:7: undefined: MessageBuffering
../../../go/pkg/mod/github.com/tinyzimmer/[email protected]/gst/gst_message_stringer.go:51:7: undefined: MessageStateChanged
../../../go/pkg/mod/github.com/tinyzimmer/[email protected]/gst/gst_message_stringer.go:55:7: undefined: MessageStateDirty
../../../go/pkg/mod/github.com/tinyzimmer/[email protected]/gst/gst_message_stringer.go:58:7: undefined: MessageStepDone
../../../go/pkg/mod/github.com/tinyzimmer/[email protected]/gst/gst_message_stringer.go:58:7: too many errors

@brucekim
Copy link
Collaborator

Hi,
What do you use the flag CGO_ENABLED=0?
go-gst needs cgo because of binding gstreamer written in C.
Have you setup gstreamer on your devlopment environment?

@its-saeed
Copy link
Author

Thanks for your reply. I think you're right. Whenever I remove CGO_ENABLED following errors start to come up:

# pkg-config --cflags  -- gio-2.0 glib-2.0 gobject-2.0 gio-2.0 glib-2.0 gobject-2.0 gio-2.0
Package gio-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gio-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gio-2.0' found
Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
Package gobject-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gobject-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gobject-2.0' found
Package gio-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gio-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gio-2.0' found
Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
Package gobject-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gobject-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gobject-2.0' found
Package gio-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gio-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gio-2.0' found
pkg-config: exit status 1

I'm using golang:1.16.6 image as the image for development environment, Is it possible to install gstreamer there?

@artofey
Copy link

artofey commented Mar 21, 2022

Hi, Saeed! All these libraries must be installed on the system. It won't work without them. It's not a mistake.
For example this is commands for install it on Ubuntu\Debian os

apt-get install pkg-config
apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-ugly gstreamer1.0-libav```

@brucekim
Copy link
Collaborator

In order to install gstreamer from source coude, you can refer the guideline below

@its-saeed
Copy link
Author

its-saeed commented Apr 5, 2022

Thanks for your help. Is it possible to link to GStreamer libraries statically? Do I need to recompile it from the source?

@brucekim
Copy link
Collaborator

brucekim commented Apr 5, 2022

If you built gstreamer, you can see numerous libraries generated in dynamic linking form. It is not only hard to make it but also just time consuming stuff.
I think, it is nothing worth if you succeed how to figure out making static linking of gstreamer with your app.

You can install gstreamer in several ways. The most convenient way is to use package manager like apt-get, yum and somethings like that.

Once you properly install gstreamer on your system, your app will look up gstreamer libraries on system path and found.

For example, you need a video player to play movie.mp4 file where movie.mp4 is your app and video player is gstreamer.
Likewise, it is nothing worth to integrate a video player into movie.mp4.

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

3 participants