using namespace std;
using namespace Msp;
-Link::Link(Builder &b, const Executable &exe, const Component &comp):
+Link::Link(Builder &b, const Executable &exe):
ExternalAction(b)
{
+ const Component &comp=exe.get_component();
+
+ //XXX Determine whether to use g++ or gcc
argv.push_back("g++");
if(comp.get_type()==Component::LIBRARY)
argv.push_back("-o");
argv.push_back(exe.get_name());
- const list<Target *> &deps=exe.get_depends();
- for(list<Target *>::const_iterator i=deps.begin(); i!=deps.end(); ++i)
+ const TargetList &deps=exe.get_depends();
+ for(TargetList::const_iterator i=deps.begin(); i!=deps.end(); ++i)
if(dynamic_cast<ObjectFile *>(*i))
argv.push_back((*i)->get_name());