[ell-i-developers] Re: Problem with Array Initialization

  • From: Pekka Nikander <pekka.nikander@xxxxxx>
  • To: ell-i-developers@xxxxxxxxxxxxx
  • Date: Fri, 7 Mar 2014 08:56:33 +0200

> I encountered a problem with the linking order of the libraries (link). In 
> summary, the enc28j60 library should be provided to the linker command before 
> the SPI library in order to define the "spi_master_begin" and 
> "spi_master_begin" functions.

I think your solution is fine, for now.

> Is that the "right" way to do it, or is there some method that does not rely 
> on the order of the arguments for the linker command? The quick internet 
> search points out that, from the gnu documentation (link), the order matters. 
> But just asking if there is some other method.

Honestly, I don't remember, and I don't have the wits to research that now.  
But IIRC there may be command line options that cause the linker to search a 
given set of libraries repeatedly.  If not, then an (perhaps not so) obvious 
approach is to combine the libraries with ar and then link against that 
combined library.


Other related posts: