0

Linuxマシンでopenwebrtcを使用して、webrtcプロトコルを介してオーディオとビデオをストリーミングするための単純なネイティブクライアントを取得しようとしています。

ここのビルド手順に従いました。https://github.com/EricssonResearch/openwebrtc/wiki/Building-OpenWebRTC

Linux のサンプル コードがないので、何かが機能するようになるまで、OSX コードを少しずつコピーしようとしています。https://github.com/EricssonResearch/openwebrtc-examples/blob/master/osx/Camera%20Test/Camera%20Test/AppDelegate.m

#include <stdio.h>

#include <owr/owr.h>
#include <owr/owr_media_source.h>
#include <owr/owr_types.h>
#include <owr/owr_video_renderer.h>

#define SELF_VIEW_TAG "self-view"

static void got_sources(GList *sources, gpointer user_data) {
    g_assert(sources);

    // haven't actually gotten to showing video yet
    // the above line does not compile =(
}

int main(void) {
    printf("starting owr\n");
    owr_init(NULL);
    owr_run_in_background();

    owr_get_capture_sources(OWR_MEDIA_TYPE_VIDEO, got_sources, NULL);

    printf("exiting owr\n");
    owr_quit();
    return 0;
}

問題は、g_assert や g_object_get などの glib 関数でコンパイル エラーが発生することです。

> make
gcc webrtc-client.c -o webrtc-client -lopenwebrtc
/usr/bin/ld: /tmp/ccd4VTU9.o: undefined reference to symbol 'g_object_get'
/opt/openwebrtc-0.3/lib/libgobject-2.0.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:23: recipe for target 'webrtc-client' failed

これらは、Makefile で設定した環境変数です

export PATH:=/opt/openwebrtc-0.3/bin:$(PATH)
export LD_LIBRARY_PATH:=/opt/openwebrtc-0.3/lib:$(LD_LIBRARY_PATH)
export GST_PLUGIN_PATH_1_0:=/opt/openwebrtc-0.3/lib/gstreamer-1.0/:$(GST_PLUGIN_PATH_1_0)
export PKG_CONFIG_PATH:=/opt/openwebrtc-0.3/lib/pkgconfig:$(PKG_CONFIG_PATH)
export CPATH:=/opt/openwebrtc-0.3/include:/opt/openwebrtc-0.3/include/glib-2.0:/opt/openwebrtc-0.3/lib/glib-2.0/include:$(CPATH)
export LIBRARY_PATH:=/opt/openwebrtc-0.3/lib:$(LIBRARY_PATH)

openwebrtc のインストールの一部として、cerbero は glib を の下にインストールしまし/opt/openwebrtc-0.3/lib/た。また、apt パッケージlibglib2.0-devをインストールして、PKG_CONFIG_PATH をコメントアウトしようとしましたが、うまくいきませんでした。

ビルド プロセスに glib を適切に組み込むにはどうすればよいですか?

4

1 に答える 1

0

g_object_get は glib ではなく gobject の一部です。

-lgobject-2.0旗が欲しかった

くそっ、自分が嫌いだ

于 2016-04-13T01:53:04.430 に答える