c++ - 只是想调用一个库的函数

标签 c++ ogg-theora

我在 /root_project/main.cpp 中有如下代码:

#include "theoraplayer/TheoraVideoClip.h"

unsigned int tex_id;
TheoraVideoManager* mgr;
TheoraVideoClip* clip;
std::string window_name="glut_player";
bool started=1;
int window_w=800,window_h=600;

void draw()
{
    glBindTexture(GL_TEXTURE_2D,tex_id);

    TheoraVideoFrame* f=clip->getNextFrame();   //this gives an error!!!
    if (f)
    {

TheoraVideoClip.h 文件位于 /root_project/include/theoraplayer/

TheoraVideoClip.h 里面有这个:

TheoraVideoFrame* getNextFrame();

当我尝试使用 g++ -o app main.cpp -lGL -lglut -lGLU 进行编译时 我遇到了这个错误:

main.cpp:(.text+0xac2): undefined reference to `TheoraVideoClip::getNextFrame()'

有人知道为什么吗?

Ubuntu 11.10

最佳答案

您还需要链接到 libtheoraplayer

关于c++ - 只是想调用一个库的函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10046947/

相关文章:

c++ - 用于 Native C++ 应用程序的 GUI 库

c++ - 访问全局数组比作为参数传递更有效?

c++ - boost::async - 不确定实现

c++ - 直接显示捕获过滤器 "wrapper"

directshow - DirectShow 中的自动 YUV -> RGB 用于自定义解码器

c++ - 从 std::string 的两端删除子字符串?

ffmpeg - 如何为 MacOSX 安装 libtheora (ffmpeg)

ffmpeg - ffmpeg 是否支持将原始视频序列编码为原始 Theora Packets/Elementary bits tream

ffmpeg - mpeg1、vp9、theora和h264帧内无损编码的奇怪结果

c - 如何用 C 将位图作为框架写入 Ogg Theora?