LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-11-2005, 06:04 AM   #1
jagman
LQ Newbie
 
Registered: Feb 2005
Posts: 17

Rep: Reputation: 0
Question building a C code with Gdcahrt lib


good day to all of you.
i´m having a problem building a simple C program, it`s a sample that comes with the GdChart library.
here´s the code

/* GDCHART 0.10.0dev 1st CHART SAMPLE 2 Nov 2000 */
/* Copyright Bruce Verderaime 1998-2004 */

/* writes gif file to stdout */

/* sample gdchart usage */
/* this will produce a 3D BAR chart */
/* this is suitable for use as a CGI */

/* for CGI use un-comment the "Content-Type" line */

#include <stdio.h>

#include "gdc.h"
#include "gdchart.h"

main()
{
/* ----- set some data ----- */
/* float a[6] = { 0.5, 0.09, 0.6, 0.85, 0.0, 0.90 }, */
/* b[6] = { 1.9, 1.3, 0.6, 0.75, 0.1, 2.0 }; */
float a[2][6] = { { 0.5, 0.09, 0.6, 0.85, 0.0, 0.90 },
{ 1.9, 1.3, 0.6, 0.75, 0.1, 2.0 } };

/* ----- X labels ----- */
char *t[6] = { "Chicago", "New York", "L.A.", "Atlanta", "Paris, MD\n(USA) ", "London" };
/* ----- data set colors (RGB) ----- */
unsigned long sc[2] = { 0xFF8080, 0x8080FF };

GDC_BGColor = 0xFFFFFFL; /* backgound color (white) */
GDC_LineColor = 0x000000L; /* line color (black) */
GDC_SetColor = &(sc[0]); /* assign set colors */

/* printf( "Content-Type: image/gif\n\n" ); tell browser type */
GDC_image_type = GDC_GIF;
/* ----- call the lib ----- */
GDC_out_graph( 250, 200, /* short width, height */
stdout, /* FILE* open FILE pointer */
GDC_3DBAR, /* GDC_CHART_T chart type */
6, /* int number of points per data set */
t, /* char*[] array of X labels */
2, /* int number of data sets */
(float*)a, NULL ); /* float[] data set 1 */
/* b ); ... data set n */

exit(0);
}
I tried to link all the libraries needed for this sorce but i´m still having the problem.
and here it`s the error:

gcc -Wall -g -o tabla ejemgdchart.o -lgif /usr/lib/libgd.so -L/usr/X11R6/lib -lXpm -lX11 -lfontconfig /usr/lib/libfreetype.so -lz -lgdc /usr/lib/libjpeg.so -lm -lpng
/usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../libgdc.a(gdc_pie.o)(.text+0x1239): In function `GDC_out_pie':
: undefined reference to `GDCPIE_title_font'
/usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../libgdc.a(gdc_pie.o)(.text+0x1241): In function `GDC_out_pie':
: undefined reference to `GDCPIE_label_font'
/usr/lib/gcc-lib/i386-redhat-linux/3.3.3/../../../libgdc.a(gdc_pie.o)(.text+0x1249): In function `GDC_out_pie':

the function GDC_out_pie it`s from a function of the gdchart, I tried
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
User Preferences: Use HTML code instead of vB code? (vB code is overrated) stefanlasiewski LQ Suggestions & Feedback 5 07-26-2005 01:37 AM
Source-code error in Tripwire when building Ephracis Linux - Software 2 02-24-2005 12:02 PM
Problem in Building socket code from Stevens book Prakhardeep Linux - Networking 1 12-22-2004 04:46 PM
Compromised? Files "/usr/lib.hwm", "/usr/lib.pwd", "/usr/lib.pwi" Klaus Pforte Linux - Security 4 09-28-2004 11:33 PM
iiimf-client-lib & iiimf-protocol-lib cooldownguy86 Linux - Software 1 06-29-2004 06:25 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration