--My error - solved

Hi,

I am currently learning C++ from a book called Accelerated C++, whose website can be found here. I copied out the source code for producing a framed greeting message, and it is as follows:
Code:
//ask for a person's name, and generate a framed greeting
#include <iostream>
#include <string>

int main()
{
  std::cout << "Please enter your first name: ";
  std::string name;
  std::cin >> name;

  //build the message that we intend to write
  const std::string spaces(greeting.size(), ' ');
  const std::string second = "* " + spaces + " *";

  //build the first and fifth lines of the output
  const std::string first(second.size(), '*');

  //write it all
  std::cout << std::endl;
  std::cout << first << std::endl;
  std::cout << second << std::endl;
  std::cout << "* " << greeting << " *" << std::endl;
  std::cout << second << std::endl;
  std::cout << first << std::endl;

  return 0;
}
I then tried to compile it, but Borland said:
"untitled1.cpp": E2451 Undefined symbol 'greeting' in function main() at line 12
So, I thought there may be something wrong with my copied-out source code (I had checked the line mentioned against the line in the book and they were exactly the same). I downloaded the Borland sources for the programs in the book, and opened up their version of the program. It was exactly the same, and it also refused to compile, returning the same error. How can this be? The program MUST work, but my compiler denies this...Any help would be greatly appreciated, thanks in advance!

edit: Just retried it and the Borland's source code does work... Here is Borland source:
Code:
// ask for a person's name, and generate a framed greeting
#include <iostream>
#include <string>

int main()
{
	std::cout << "Please enter your first name: ";
	std::string name;
	std::cin >> name;

	// build the message that we intend to write
	const std::string greeting = "Hello, " + name + "!";

	// build the second and fourth lines of the output
	const std::string spaces(greeting.size(), ' ');
	const std::string second = "* " + spaces + " *";

	// build the first and fifth lines of the output
	const std::string first(second.size(), '*');

	// write it all
	std::cout << std::endl;
	std::cout << first << std::endl;
	std::cout << second << std::endl;
	std::cout << "* " << greeting << " *" << std::endl;
	std::cout << second << std::endl;
	std::cout << first << std::endl;

	return 0;
}
I tried copying their "line 12" and putting it into my source code, but that didn't work...

edit2: My mistake! So sorry everyone, I must've missed the following lines:
Code:
// build the message that we intend to write
const std::string greeting = "Hello, " + name + "!";
Sorry again!

J_K9