只是尝试调用库的函数

Just trying to call a function of a library

本文关键字:函数 调用      更新时间:2023-10-16

我在下面有这样的代码/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):未定义的引用 'TheoraVideoClip::getNextFrame()'

有人知道为什么吗?

乌班图11.10

您还需要链接到libtheoraplayer