[Ffmpeg-devel] link error

Måns Rullgård mru
Tue Jul 26 11:06:11 CEST 2005


Behrbaum, Jeffrey S said:
> Hi all. I hope this is where I should post this question.  Please let me know
> if it is not. Thanks.
>
> I have the FFMepg tar.gz file uncompressed and build on a win2k machine.
> (Before anyone decides to lynch me, we have some
> hardware specific issues on this project and we had to use the win2k OS for
> some proprietary hardware drivers) So, using MinGW
> and Msys I compiled the avcodec.lib. Seems good to go. Now when I compile
> (Using VC++ 6.0) and link this simple program, I
> get the link errors.  If anyone has dealt with this or has any idea about
> what's going on, PLEASE help me!  Thanks in advance to anyone
> for their time.
>
> Below are the link errors I'm getting.
>
> LINK : warning LNK4049: locally defined symbol "__iob" imported
> avcodec.lib(dsputil.o) : error LNK2001: unresolved external symbol __alloca
> avcodec.lib(dsputil_mmx.o) : error LNK2001: unresolved external symbol
> _ff_pw_20
> avcodec.lib(dsputil_mmx.o) : error LNK2001: unresolved external symbol
> _ff_pw_3
> avcodec.lib(
> ue) : error LNK2001: unresolved external symbol _bone
> avcodec.lib(
> ue) : error LNK2001: unresolved external symbol _wm1010
> avcodec.lib(
> ue) : error LNK2001: unresolved external symbol _d40000
> Debug/FFMpeg_FirstPract.exe : fatal error LNK1120: 6 unresolved externals
> Error executing link.exe.

Last time I saw those errors, they were caused by those variables only being
used within asm() blocks, so the compiler incorrrectly optimized them out.
IIRC, this was fixed quite a while ago.  Are your sources up to date.

The missing alloca is probably a windows specific problem.

> Here's myt test program. Note that if the "avoption_parse" function call is
> taken out, the program links and runs without error.
>
> #include <iostream>
> #include <string>
>
> extern "C"
> {
> #include "avcodec.h"
> }
>
> using namespace std;
>
> void* compressData(void *clientData);
>
> int main(int arg, char **argc)
> {
> 	//Just to test a run
> 	RcOverride strctOverRide;
> 	strctOverRide.qscale         = 0;
> 	strctOverRide.end_frame      = 0;
> 	strctOverRide.start_frame    = 0;
> 	strctOverRide.quality_factor = 0.0;
>
> 	//If taken out, we run and link just fine

That's because the program then no longer depends at all on libavcodec, and
none of it will be included, specifically the bits with the unresolved
references.

> 	int retVal = avoption_parse(NULL, NULL, NULL);
>
> 	cout << "Now cleanly exiting..." << endl;
>
> 	return EXIT_SUCCESS;
> }//End main
>

-- 
M?ns Rullg?rd
mru at inprovide.com





More information about the ffmpeg-devel mailing list