我在 /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/