gnu.gcc.help
[Top] [All Lists]

Re: linker error on cygwin

Subject: Re: linker error on cygwin
From: Paul Pluzhnikov
Date: Sat, 22 Jul 2006 09:58:12 -0700
Newsgroups: gnu.gcc.help
petru.marginean@xxxxxxxxx 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.

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy