libftdi Archives

Subject: Re: Can not link with libftdi

From: Jim Paris <jim@xxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Thu, 14 Feb 2013 15:00:20 -0500
Ori Idan wrote:
> I tried: gcc -o i2csend i2csend.c -lftdi
> 
> Just changing -lftdi to be at the end of the command line and it workd.
> I still wonder why?

Your GCC probably passes --as-needed to the linker by default.  Ubuntu
started doing this in Natty and Debian in Wheezy.  This means the
linker only pulls in symbols from a library if it needs them.  When
you put libftdi first, none of those symbols are needed yet and so
nothing gets included.

See e.g. http://wiki.debian.org/ToolChain/DSOLinking#Onlylinkwithneededlibraries
  
-jim

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread