Dan Tumaykin
Dan Tumaykin

Reputation: 1253

Using GStreamer in C++ with Visual Studio

Is it possible to use GStreamer C binding in C++ project?

When I compile GStreamer HelloWorld sample in C++ VS enviroment, gst_init() gets mangled to _gst_init() and then linker is unable to find the function in GStreamer .lib. The same also happens with other GStreamer functions.

I've tried to enclose include directive with "extern C" declaration like this:

extern "C" {
    #include <gst/gst.h>
}

but it was of no help.

Can I tell to the compiler how exactly to mangle the names? Is there any C++ wrapper for GStreamer, or I need to write one, in order to use it?

Upvotes: 2

Views: 2058

Answers (1)

voodooattack
voodooattack

Reputation: 1176

When I tried this long ago I ran into problems as well, I guess gstreamer and glib are not really VS-friendly.

You can try OSSBuild's version, it provides binaries, solution files, and even some patches to build gstreamer with Visual Studio.

I personally wound up compiling gstreamer and glib with MinGW/GCC instead, and it was still usable with Visual Studio. As for a C++ wrapper, take a look at gstreamermm.

Upvotes: 2

Related Questions