Can't locate loadable object for module GD in @INC

I am trying to use the GD module on a on Unix Solaris environment machine by including gd.pm from a temporary location
but I am receiving the following error:

perl -w polyline.pl > imageoutput.png
Can't locate loadable object for module GD in @INC (@INC contains: /home2/work/tmp/Work1/GD-2.01 /opt/perl/5.8.0.1/lib/5.8.0/sun4-solaris /opt/perl/5.8.0.1/lib/5.8.0 /opt/perl/5.8.0.1/lib/site_perl/5.8.0/sun4-solaris /opt/perl/5.8.0.1/lib/site_perl/5.8.0 /opt/perl/5.8.0.1/lib/site_perl .) at /home2/work/tmp/Work1/GD-2.01/GD/Polyline.pm line 49
Compilation failed in require at /home2/work/tmp/Work1/GD-2.01/GD/Polyline.pm line 49.
BEGIN failed--compilation aborted at /home2/work/tmp/Work1/GD-2.01/GD/Polyline.pm line 49.
Compilation failed in require at polyline.pl line 13.
BEGIN failed--compilation aborted at polyline.pl line 13.

The following is my code.

use lib "/home2/work/tmp/Work1/GD-2.01";
##use GD;
use GD::Polyline;

$PI = 3.14159; $TWO_PI = 2 * $PI;
sub r2d {$_[0] * 180 / $PI};

$splinekey = "<UL><LI>Green: original polygon or polyline<LI>Blue: control points added with addControlPoints()<LI>Black: spline generated by toSpline()</UL>";

if (1) {

\#\#use GD;
\#\#use GD::Polyline;

\# create an image
$image = new GD::Image \(500,300\);
$white  = $image-&gt;colorAllocate\(255,255,255\);
$black  = $image-&gt;colorAllocate\(  0,  0,  0\);
$red    = $image-&gt;colorAllocate\(255,  0,  0\);

\# create a new polyline
$polyline = new GD::Polyline;

\# add some points
$polyline-&gt;addPt\(  0,  0\);
$polyline-&gt;addPt\(  0,100\);
$polyline-&gt;addPt\( 50,125\);
$polyline-&gt;addPt\(100,  0\);

\# polylines can use polygon methods \(and vice versa\)
$polyline-&gt;offset\(200,100\);

\# rotate 60 degrees, about the centroid
$polyline-&gt;rotate\(3.14159/3, $polyline-&gt;centroid\(\)\);

\# scale about the centroid
$polyline-&gt;scale\(1.5, 2, $polyline-&gt;centroid\(\)\);

\# draw the polyline
$image-&gt;polydraw\($polyline,$black\);

\# create a spline, which is also a polyine
$spline = $polyline-&gt;addControlPoints-&gt;toSpline;
$image-&gt;polydraw\($spline,$red\);

\# output the png
\#binmode STDOUT;
\#print $image-&gt;png;

SampleImage\($image, "polyline-synopsis.png", "Synopsis", "Polyline created by 'SYNOPSIS' section of documentation."\);

}

if (1) {
$image = NewImage();

$offset = 50;


for $poly \(new GD::Polygon, new GD::Polyline\) \{

	$table_info = [];

	$poly-&gt;addPt\(  0,  0\);
	$poly-&gt;addPt\(  0,100\);
	$poly-&gt;addPt\( 50,125\);
	$poly-&gt;addPt\(100,  0\);

	\#print "this " . ref\($poly\) . " has " . $poly-&gt;length\(\) . " points\\n";

	push @$table_info, ["&lt;B&gt;".ref\($poly\)."&lt;/B&gt;"];
	push @$table_info, ['vertex number: ', 0..\($poly-&gt;length\(\)-1\)];

	@coords = $poly-&gt;vertices\(\);
	@coords = map \{"[".int\($\_-&gt;[0]\).",".int\($_-&gt;[1]\)."]"\} @coords;
	push @$table_info, ['coordinates \(pre-offset\): ', @coords];

	@lengths = $poly-&gt;segLength\(\);
	@lengths = map \{int\($_\+0.5\)\} @lengths;
	\#print "segLengths are   : @lengths\\n";
	\#print "perimeter is     : " . int\($poly-&gt;segLength\(\)\) . "\\n";
	push @$table_info, ['segment lengths: ', @lengths];

	@angles = $poly-&gt;segAngle\(\);
	@angles = map \{int\(r2d\($_\)\+0.5\)\} @angles;
	\#print "seg angles are   : @angles\\n";
	push @$table_info, ['segment angles: ', @angles];

	@angles = $poly-&gt;vertexAngle\(\);
	@angles = map \{defined \($_\) ? int\(r2d\($_\)\+0.5\) : "undef"\} @angles;
	\#print "vertex angles are: @angles\\n";
	push @$table_info, ['vertex angles: ', @angles];

	$poly-&gt;offset\(50 \+ $offset,80\);
	$offset \+= 200;

	\# draw the original poly
	$image-&gt;polydraw\($poly,$black\);

	\#print "\\n\\n";

	push @$summary_table, genHTMLTable\($table_info, 0\);
\}

SampleImage\($image, "polyline-simple.png", "Simple", "GD::Polygon and GD::Polyline with same vertexes.&lt;/P&gt;" . genHTMLTable\([$summary_table], 1\)\);

}

if (1) {
$image = NewImage();

$offset = 50;

for $poly \(new GD::Polygon, new GD::Polyline\) \{

	$poly-&gt;addPt\(  0,  0\);
	$poly-&gt;addPt\(  0,100\);
	$poly-&gt;addPt\( 50,125\);
	$poly-&gt;addPt\(100,  0\);

	$poly-&gt;offset\(50 \+ $offset,80\);
	$offset \+= 200;

	\# draw the original poly
	$image-&gt;polydraw\($poly,$green\);

	\# create and draw the control line for the spline
	$ctrlline = $poly-&gt;addControlPoints\(\);
	$image-&gt;polydraw\($ctrlline,$cyan\);

	\# create and draw the spline itself
	$spline = $ctrlline-&gt;toSpline\(\);
	$image-&gt;polydraw\($spline,$black\);

\}

SampleImage\($image, "polyline-spline.png", "Spline", "Splines fit to vertices of polygon and polyline.  $splinekey"\);

}

if (1) {
$image = NewImage();

$triangle = new GD::Polygon;

$triangle-&gt;addPt\(  0,  0\);
$triangle-&gt;addPt\(-19, 95\);
$triangle-&gt;addPt\( 19, 95\);

$triangle-&gt;offset\(250,50\);

foreach \(1..9\) \{
	$image-&gt;polydraw\($triangle,gdBrushed\);
	$triangle-&gt;rotate\($TWO_PI / 9, 250, 150\);
\}

SampleImage\($image, "polyline-star9.png", "Nine Pointed Star", "A triangle, rotated about a point other than the origin.&lt;BR&gt;Demonstration of \\$poly-&gt;rotate\(\) and \\$poly-&gt;offset\(\)"\);

}

if (1) {
$image = NewImage();

$cloverControl = new GD::Polyline;
$cloverControl-&gt;addPt\(45,45\);
$cloverControl-&gt;addPt\(10,10\);
$cloverControl-&gt;addPt\(90,10\);
$cloverControl-&gt;addPt\(55,45\);
$cloverControl-&gt;addPt\(90,10\);
$cloverControl-&gt;addPt\(90,90\);
$cloverControl-&gt;addPt\(55,55\);
$cloverControl-&gt;addPt\(90,90\);
$cloverControl-&gt;addPt\(10,90\);
$cloverControl-&gt;addPt\(45,55\);
$cloverControl-&gt;addPt\(10,90\);
$cloverControl-&gt;addPt\(10,10\);
$cloverControl-&gt;addPt\(45,45\);

$clover = $cloverControl-&gt;toSpline\(\);

\# note that the three following transformations
\# could have been called on $cloverControl, instead,
\# followed by the above call

$clover-&gt;offset\($clover-&gt;centroid\(-1\)\);
$clover-&gt;scale\(3, 3\);
$clover-&gt;offset\(250, 150\);

$image-&gt;filledPolygon\($clover,$green\);

SampleImage\($image, "polyline-clover.png", "Clover", "Sample image generated by GD::Polygon"\);

}

if (1) {
$image = NewImage();

$polyline = new GD::Polyline;

for \(0..15\) \{
	$polyline-&gt;addPt\(30 * $_ \+ 10, rand\(90\) \+ 5\);
\}

$image-&gt;polyline\($polyline,$green\);

$ctrlline = $polyline-&gt;addControlPoints\(\);
$ctrlline-&gt;offset\(0,100\);
$image-&gt;polyline\($ctrlline,$cyan\);

$spline = $ctrlline-&gt;toSpline\(\);
$spline-&gt;offset\(0,100\);
$image-&gt;polyline\($spline,$black\);

SampleImage\($image, "polyline-zigzag.png", "Zigzag", "Spline fit to random function.  $splinekey"\);

}

if (1) {
$image = NewImage();

$ring_network = new GD::Polygon;

$num_nodes = 10;
$randfactor = 80;

for \(1..$num_nodes\) \{
	$x = 250 \+ 150 * cos\($TWO_PI * $\_/$num_nodes\);
	$y = 150 \+ 100 * sin\($TWO_PI * $\_/$num_nodes\);
	$x \+= rand\($randfactor\)-$randfactor/2;
	$y \+= rand\($randfactor\)-$randfactor/2;
	$ring_network-&gt;addPt\($x, $y\);
\}

$image-&gt;setBrush\($brush2\);
$image-&gt;polyline\($ring_network-&gt;addControlPoints-&gt;toSpline,gdBrushed\);

$ring_node = new GD::Polygon;

$ring_node-&gt;addPt\( 0, 0\);
$ring_node-&gt;addPt\(10, 0\);
$ring_node-&gt;addPt\(10,10\);
$ring_node-&gt;addPt\( 0,10\);

for $ring_vertex \($ring_network-&gt;vertices\(\)\) \{
	$ring\_node-&gt;offset\($ring_node-&gt;centroid\(-1\)\);
	$ring\_node-&gt;offset\(@$ring_vertex\);
	$image-&gt;filledPolygon\($ring_node,$grey\);
\}

SampleImage\($image, "polyline-ring-network.png", "Ring Network", "Closed spline fit to nodes at somewhat random positions."\);

}

WriteToFile("polyline-example.html", theHTML());

print "\n";
print "open 'polyline-example.html' in your favorite browser that supports PNG.\n";
print "\n";

print "done! " . localtime() . "\n";

##########################
#
# helper functions
#

sub NewImage {
$image = new GD::Image (500,300);

$white  = $image-&gt;colorAllocate\(255,255,255\);
$black  = $image-&gt;colorAllocate\(  0,  0,  0\);
$grey   = $image-&gt;colorAllocate\(128,128,128\);
$red    = $image-&gt;colorAllocate\(255,  0,  0\);
$orange = $image-&gt;colorAllocate\(255,196,  0\);
$green  = $image-&gt;colorAllocate\(  0,255,  0\);
$blue   = $image-&gt;colorAllocate\(  0,  0,255\);
$cyan   = $image-&gt;colorAllocate\(  0,255,255\);
$purple = $image-&gt;colorAllocate\(206,  0,165\);

$brush_width = 2;
$brush_color = [255,128,0];
	$brush = new GD::Image\($brush\_width,$brush_width\);
	$brush-&gt;transparent\($brush-&gt;colorAllocate\(255,255,255\)\);
	$brush-&gt;filledRectangle\(0,0,$brush\_width,$brush\_width,$brush-&gt;colorAllocate\(@$brush_color\)\);
$brush1 = $brush;

$brush_width = 3;
$brush_color = [206,0,165];
	$brush = new GD::Image\($brush\_width,$brush_width\);
	$brush-&gt;transparent\($brush-&gt;colorAllocate\(255,255,255\)\);
	$brush-&gt;filledRectangle\(0,0,$brush\_width,$brush\_width,$brush-&gt;colorAllocate\(@$brush_color\)\);
$brush2 = $brush;

$image-&gt;setBrush\($brush1\);

$image;

}

my $html;

sub SampleImage {
my $image = shift;
my $file = shift;
my $title = shift;
my $text = shift;

WriteToBinaryFile\($file, $image-&gt;png\(\)\);

$html .= "&lt;IMG SRC='$file'&gt;&lt;BR&gt;\\n";
$html .= "&lt;B&gt;$title&lt;/B&gt; - $file&lt;BR&gt;\\n";
$html .= "&lt;P&gt;$text&lt;/P&gt;&lt;HR&gt;\\n";

}

sub theHTML {
$html;
}

sub WriteToFile {
my $file = shift || return 0;
my $contents = shift || "";

open \(NEWFILE, "&gt;" . $file\) or die "couldn't write to file $file";
print NEWFILE $contents;
close\(NEWFILE\);

print "created file $file\\n";

}

sub WriteToBinaryFile {
my $file = shift || return 0;
my $contents = shift || "";

open \(NEWFILE, "&gt;" . $file\) or die "couldn't write to file $file";
binmode NEWFILE;
print NEWFILE $contents;
close\(NEWFILE\);

print "created file $file\\n";

}

sub genHTMLTable {
my $array_of_arrays = shift;
my $border = shift;
my $html_table;

$html_table .= "&lt;TABLE BORDER='$border'&gt;";
for my $array\_of_items \(@$array\_of_arrays\) \{
	$html_table .= "&lt;TR&gt;&lt;TD&gt;";
	$html_table .= join\("&lt;/TD&gt;&lt;TD&gt;", @$array\_of_items\);
	$html_table .= "&lt;/TD&gt;&lt;/TR&gt;";
\}
$html_table .= "&lt;/TABLE&gt;";
$html_table;

}

Please help me in knowing what my error is.
Thanks,
Pooja

You probably have to install GD, you can't just use it from another location like you can with a pure perl module.