2008-07-15 14:11:34     libasound linker errors

Document created by Aaronwu Employee on Aug 7, 2013
Version 1Show Document
  • View in full screen mode

2008-07-15 14:11:34     libasound linker errors

Steve Strobel (UNITED STATES)

Message: 58865   

 

I am currently writing a program using alsa that is essentially a stripped-down version of aplay/arecord with some additional logic.  It compiles fine, but when linking I get the following output:

 

make all

Building target: crosspoint

Invoking: GCC C++ Linker

bfin-uclinux-g++ -L/usr/local/lib -elf2flt -o"crosspoint"  ./SimpleFileReaderWrapper.o ./SimpleFileWriterWrapper.o ./crosspoint.o   -lasound

/opt/uClinux-SVN/out-uclinux/bin/../lib/gcc/bfin-uclinux/4.1.2/../../../../bfin-uclinux/bin/ld.real: skipping incompatible /usr/local/lib/libasound.so when searching for -lasound

/opt/uClinux-SVN/out-uclinux/bin/../lib/gcc/bfin-uclinux/4.1.2/../../../../bfin-uclinux/bin/ld.real: skipping incompatible /usr/local/lib/libasound.so when searching for -lasound

/opt/uClinux-SVN/out-uclinux/bin/../lib/gcc/bfin-uclinux/4.1.2/../../../../bfin-uclinux/bin/ld.real: cannot find -lasound

collect2: ld returned 1 exit status

make: *** [crosspoint] Error 1

 

I can build the alsa-utils from within the uClinux-dist directory without problems, and most of my code I just copied/pasted from aplay.c so I can't figure out why libasound.so is "incompatible."

 

Any help with this would be greatly appreciated.

 

Thank you

QuoteReplyEditDelete

 

 

2008-07-15 19:20:36     Re: libasound linker errors

Mike Frysinger (UNITED STATES)

Message: 58872   

 

you cant link against the libraries that exist on your host ... those arent Blackfin libraries

 

you need to compile against the ones in the staging directory (which is what alsa-utils and everything else does)

 

look in the staging directory in the top level uclinux-dist directory

QuoteReplyEditDelete

 

 

2008-07-15 19:35:28     Re: libasound linker errors

Mike Frysinger (UNITED STATES)

Message: 58875   

 

this document explains things already:

http://docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:existing_libraries#using_libs_in_external_applications

QuoteReplyEditDelete

 

 

2008-07-16 10:20:28     Re: libasound linker errors

Steve Strobel (UNITED STATES)

Message: 58954   

 

That's just the thing; I still get the same errors when I link against the libasound found in the staging directory.  Here's what I was trying originally:

 

Invoking: GCC C++ Linker

bfin-uclinux-g++ -L/home/ubuntu/Blackfin/uClinux/staging/usr/local/lib -elf2flt -o"crosspoint"  ./SimpleFileReaderWrapper.o ./SimpleFileWriterWrapper.o ./crosspoint.o   -lasound

/home/ubuntu/Blackfin/uClinux/staging/usr/local/lib/libasound.so: could not read symbols: File in wrong format

collect2: ld returned 1 exit status

make: *** [crosspoint] Error 1

 

I'm using eclipse and the 2007RC3 version of the blackfin toolchain if it helps.

QuoteReplyEditDelete

 

 

2008-07-16 21:32:49     Re: libasound linker errors

Mike Frysinger (UNITED STATES)

Message: 58979   

 

you cannot mix file formats which is what you're attempting to do ... FLAT and FDPIC have different ABIs

QuoteReplyEditDelete

 

 

2008-07-17 18:35:07     Re: libasound linker errors

Steve Strobel (UNITED STATES)

Message: 59031   

 

Thank you, I figured it out.  I had just copied the settings from a previous project and forgotten that I needed to change the makefile.  *slaps forehead*

Attachments

    Outcomes