Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

linker error on cygwin

3 views
Skip to first unread message

petru.m...@gmail.com

unread,
Jul 22, 2006, 8:54:18 AM7/22/06
to
Hi,

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

Paul Pluzhnikov

unread,
Jul 22, 2006, 12:58:12 PM7/22/06
to
petru.m...@gmail.com writes:

> 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.

petru.m...@gmail.com

unread,
Jul 23, 2006, 1:21:40 AM7/23/06
to
Hi Paul,
Thanks for the pointer!
Now I found where the inconsistency is:

#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

0 new messages