unable to link mpeg lib
Jacek Wojdel
wojdel at kbs.twi.tudelft.nl
Tue Aug 31 14:13:52 BST 1999
-----BEGIN PGP SIGNED MESSAGE-----
On Tue, 31 Aug 1999, you wrote:
> hi:
> i am making a project about mpeg.i choose mpeg_lib.
> but i can not link to the library 'libmpeg.so'.it does exist,and its
> examples can link to it without any problem.
>
> g++ -o qmpeg -L/usr/X11/lib -L/usr/qt/lib -L/usr/lib -lX11 -lXext -lqt -lmpeg \
> main.o qmpeg.o qcontrolpanel.o qmpeg.moc.o qcontrolpanel.moc.o
>
> qmpeg.o: In function `QMpeg::slotMpegPlay(void)':
> /root/mpeg/mpeg/qmpeg.cpp:121: undefined reference to `SetMPEGOption(MPEGOptionEnum, int)'
> /root/mpeg/mpeg/qmpeg.cpp:122: undefined reference to `OpenMPEG(_IO_FILE *, ImageDesc *)'
> /root/mpeg/mpeg/qmpeg.cpp:151: undefined reference to `GetMPEGFrame(char *)'
> /root/mpeg/mpeg/qmpeg.cpp:161: undefined reference to `CloseMPEG(void)'
> collect2: ld returned 1 exit status
> make: *** [qmpeg] Error 1
>
> it seems as if i do not use " -lmpeg" option,but i DO.any suggestion?
> (libmpeg.so installed in /usr/lib)
Try putting #include <mpeg.h> within 'extern "C" {}' like so:
extern "C" {
include <mpeg.h>
}
the C functions in the library are prefixed with underscore, so linker can't
resolve them. Moreover, get the really newest version of mpeg library - version
1.2 was quite buggy (hours spent on looking where it crashes just to find that
it wasn't my fault :).
Regards,
Jacek
P.S. Of course I assume we're talking about libmpeg from Greg Ward
--
+-------------------------------------+
|from: J.C.Wojdel |
| J.C.Wojdel at cs.tudelft.nl |
+-------------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
MessageID: 4MFmnOWLTlTnU1G7G0+yTvI1DJNOtcHv
iQCVAwUBN8vXdYWy7tU6a5rbAQF+swP8Diw/J6yRhrwSzmocNlljTgtAdi0eNb0Z
eV8hJKEqTtqBsjXgvsFHDybUehPleA+8efLFeGVKntRRuimDq0/rHI4NJ2ygSx8s
JJsLNo6yJOx7DedmRECr7puM2yYlKDPbJoY42Xp+KX+xCllWRdlg6mk2SFuEtqUm
NwuAFDu4gDE=
=lLAA
-----END PGP SIGNATURE-----
More information about the KDevelop
mailing list