Send SPI Data inside a cpp file

I'm trying to add SPI communication to an existing library, rather than using the parallel ports.

I've included the following inside the CPP file:

#include <SPI.h>

Then inside the init function, where the ports were defines as inputs/outputs

SPI.begin();
  PinMode (4, OUTPUT) 
  SPI.setBitOrder(MSBFIRST);
  SPI.setClockDivider(SPI_CLOCK_DIV64);

and finally where the data was written I replaced with

PORTD &= ~_BV(4);              // Turn SS LOW); 
SPI.transfer ((byte)data);        // send out 8 bits
PORTD |= _BV(4);               // Turn SS high - data output changes on this rising edge

Nothing ever comes out from the SPI port. What am I missing?
PS: Empty space on the code = forum bug?

The problem is in the rest of the code.

Could you be more specific in regards to that?

How do I make a direct call to the hardware, say by writing to the SPDR register, rather than using the arduino library?