Q:

Calling 'new' to store into a referenced vector of shared_ptr's

I wanted to reword this question so it is clearer.  I have a feeling my approach is generally wrong
Does it break the intention of dependency injection to pass, into the constructor, a reference to a vector of shared pointers, with the intent of creating a new shared pointer and pushing it to the vector?
I know the new command shouldn't be used from within an object. In this instance its creating an object but storing it outside.
Is there a better way of approaching this so that the 'new' can stay on the outside?
SpottingMarker.h
#ifndef SPOTTINGMARKER_H_INCLUDE
#define SPOTTINGMARKER_H_INCLUDE

class SpottingMarker
{
public:
    SpottingMarker() {;}
            ~SpottingMarker(){;}
    void blah();

    double mPosition;
    double mDuration;
    char* mDescription;
};
    #endif

SpottingMarker.cpp
#include "SpottingMarker.h"
void blah() {;}

CsvSpottingNotes.h
#ifndef CSVSPOTTINGNOTES_H_INCLUDED
#define CSVSPOTTINGNOTES_H_INCLUDED

#include "SpottingMarker.h"
#include <boost/shared_ptr.hpp>
#include <vector>

typedef boost::shared_ptr<SpottingMarker> spottingMarker_ptr;

class CsvSpottingNotes
{
public:
    CsvSpottingNotes(const char* filename, std::vector<spottingMarker_ptr> &SpottingMarkerSet);
    ~CsvSpottingNotes(){;}
    const char* mFilename;
    const char field_terminator;
    const char line_terminator;
    const char enclosure_char;
};
    #endif

CsvSpottingNotes.cpp
#include "CsvSpottingNotes.h"
#include "SpottingMarker.h"
#include <csv_parser/csv_parser.hpp>
#include <boost/shared_ptr.hpp>

CsvSpottingNotes::CsvSpottingNotes(const char* filename, std::vector<spottingMarker_ptr> &SpottingMarkerSet) :
field_terminator(','),
line_terminator('\n'),
enclosure_char('"')

{
    spottingMarker_ptr aSpottingMarker(new SpottingMarker());
    SpottingMarkerSet.push_back(aSpottingMarker);
}

main.cpp
#include "CsvSpottingNotes.h"
#include "SpottingMarker.h"
#include <vector>

int main(int argc, char ** argv)
{
    typedef boost::shared_ptr<SpottingMarker> spottingMarker_ptr;
    const char* filename = "AT_92.csv";
    std::vector<spottingMarker_ptr> spottingMarkerSet;
    CsvSpottingNotes structure(filename, spottingMarkerSet);
}

A:

First, to address your immediate question, if I understand correctly you want to know if you can (1) create a shared pointer with local scope, (2) push it on to the back of a reference to a vector of shared pointers, and (3) have the pointer refer to the same object as when you created it.  The answer to all of these is yes, and you get that behavior pretty much for free.  For example:
void push_shared_pointer(std::vector<boost::shared_ptr<int> > &vector) {
  boost::shared_ptr<int> int_ptr(new int(5));
  vector.push_back(int_ptr);
  *int_ptr = 6;
}

std::vector<boost::shared_ptr<int> > int_vector;
push_shared_pointer(int_vector);

std::cout << *int_vector.back( ) << std::endl;

This outputs 6 because in the function since after we pushed the shared pointer onto the vector, we used the local shared pointer to modify the referenced int.  Since the shared pointer in the vector and the local shared pointer refer to the same memory location, both shared pointers are updated.
As for the rest of the code, there a few things to note.  First, the preprocessor guards were an issue, as others noted.  Second, you didn't scope the function blah() in SopttingMarker.cpp to tell the compile that it's an implementation of the blah function in the SpottingMarker class.  It should read:
#include "SpottingMarker.h"

void SpottingMarker::blah() { }

In addition, since you indicated in the header that you are going to provide a user defined default constructor, you should provide that in SpottingMarker.cpp as well.
SpottingMarker::SpottingMarker()
  : mPosition(0)
  , mDuration(0)
  , mDescription(NULL)
{ }

Third, since you declared a destructor in CsvSpottingNotes.h, you should define it in CsvSpottingNotes.cpp:
CsvSpottingNotes::~CsvSpottingNotes() {
  // implementation here
}

Those should be all the definitions you need, at least according to your build log.
The last thing I would note is that it doesn't look like your using dependency injection in a traditional manner for three reasons.  First, typically when you do dependency injection you store a reference to the injected object in the receiver object so the receiver can use over the course of its lifetime.  Here you inject the vector into CsvSpottingNotes, but you don't store a reference to it in the class; you just push a shared pointer onto it.
Second, in my experience dependency injection is for behavioral abstractions, i.e. to separate the behavior of the receiver (client) object from the behavior of the injected object using an interface.  This allows you to modify the behavior of the client by injecting different implementations of the interface.  In  this case you aren't using an interface; std::vector is a fully qualified type at compile time and CsvSpaottingMarker can't be used with any other type, so there's no reason to use dependency injection.  A better solution is to store the vector as a member of CsvSpottingMarker.
Third, as I said before, dependency injection is used mainly for behavioral abstractions, i.e. getting client objects to behave differently depending on the implementation of the interfaces that are injected into them.  The std::vector class is not a good candidate for dependency injection because it does not provide a behavior; instead, it merely saves state.  Generally the state of the object should be encapsulated as a member of the object class, which is further support for including the vector in the CsvSpottingMarker class.
Hope that helps!

