I get a linker error when building "mplayer" on cygwin. The command
that fails follows:
(I removed some stuff for readibilty, I just hope I didn't removed the
important stuff...)
$> gcc ... libavcodec/libavcodec.a ... -lfaac...
//...
libavcodec/libavcodec.a(faac.o):faac.c:(.text+0x3f): undefined
reference to `_faacEncOpen@16'
//...
I suspect the problem is the suffix "@16" (4 x param. count?!)
$> nm libavcodec/libavcodec.a | grep EncOpen
U _faacEncOpen@16
$> nm /usr/local/lib/libfaac.a | grep EncOpen
00000520 T _faacEncOpen
Is this the issue?
If yes, any idea where the "@16" comes from? How can I get rid of it
and finally link?
If no, why I cannot link?!
Many thanks,
Petru
> I get a linker error when building "mplayer" on cygwin. The command
> that fails follows:
>
> $> gcc ... libavcodec/libavcodec.a ... -lfaac...
> //...
> libavcodec/libavcodec.a(faac.o):faac.c:(.text+0x3f): undefined
> reference to `_faacEncOpen@16'
Most likely cause: incorrect prototype for faacEncOpen() was
used when compiling faac.c
Execute this to understand why:
$ cat > junk.c <<EOF
int foo(int x) { return x+42; }
__cdecl int bar(int x) { return x+42; }
__stdcall int baz(int x) { return x+42; }
EOF
$ gcc -c junk.c && nm junk.o
Here is the output I get with cygwin/gcc-3.3.1:
...
0000000b T _bar
00000000 T _foo
00000016 T _baz@4
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
#ifdef WIN32
# ifndef FAACAPI
# define FAACAPI __stdcall
# endif
#else
# ifndef FAACAPI
# define FAACAPI
# endif
#endif
//...
int FAACAPI faacEncClose(faacEncHandle hEncoder);
I'll see now how to fix it. It should be easy...
Thanks again,
Petru