On 2014–07–03, at 20:09 , Asif Sardar <engr.asif.sardar@xxxxxxxxxxxxxx> wrote: > I was compiling the SPI from library by including the .o files inside the > app.mk e.g. following lines added > > APP_OBJS ?= main.o $(APP).o $(VARIANT).o wiring_digital.o > wiring_digital_pinMode.o ellduino_Serial.o ellduino_spi.o SPIClass.o > spiStruct.o > > VPATH += $(TOP)cores/arduelli $(TOP)variants/$(VARIANT) $(TOP)libraries/SPI > > Also, I splitted the wiring_digital.h and wiring_digital_pinmode.h into there > own source (.c) files to avoid multiple declaration, because the SPIClass.h > is also including the wiring_digital.h using the digitalWrite and pinMode > functions. The files are attached to the e-mail. > > Still I am getting following error: > > ellduino_spi.o: In function `SPIClass::begin(unsigned char) const': > /home/asif/Ell-i-Working-Directory/Ell-i-Software-Development/Runtime/stm32/build/../libraries/SPI/./SPIClass.h:81: > undefined reference to `digitalWrite' > ellduino_spi.o: In function `SPIClass::activate_ss(unsigned char)': > /home/asif/Ell-i-Working-Directory/Ell-i-Software-Development/Runtime/stm32/build/../libraries/SPI/./SPIClass.h:183: > undefined reference to `digitalWrite' > ellduino_spi.o: In function `SPIClass::deactivate_ss(unsigned char)': > /home/asif/Ell-i-Working-Directory/Ell-i-Software-Development/Runtime/stm32/build/../libraries/SPI/./SPIClass.h:184: > undefined reference to `digitalWrite' > > Any good ideas? For a quick fix, try changing the order of the objects in the command line. If that does not help, then I guess SPIClass.h is referring to digitalWrite as a C++ function while it is declared as a C function, or something similar. Please check how the files get included and if there are any warnings. --Pekka