Sponsored Content
Top Forums Programming Question on using gd lib with c++ Post 302290171 by shahrulb on Sunday 22nd of February 2009 06:42:10 AM
Old 02-22-2009
Sorry about that, here's the detail of my problem. I'm using the gd library to crop an image to a given width and height. In window, I include the gd.h as below:

using namespace std;

#include <float.h> //for DBL_MAX
#include <math.h>

#include <iostream>
#include <fstream>
#include <ctime>
#include "../gdwin32/gd.h"

#define _CANVAS_WIDTH 800
#define _CANVAS_HEIGHT 560
#define _TILE_WIDTH 25
#define _TILE_HEIGHT 20


I actually compiling it as: g++ -o main *.cpp ../gdwin32/libbgd.a and it works.

So now, I'm trying to run the same file in cygwin. I've already installed the zlib, libpng and gd-20.33 in the same folder as the source code which is main.cpp . I've also copied the gd.c and gd.h into the same folder as the source code. I've changed the include part of main.cpp to these:

#include <iostream>
#include <fstream>
#include <ctime>
#include "gd.h"


The problem occur when I run the makefile for gd which gave me these error messages:

extracting exported symbol list from `cygXpm-4.dll'
test -f .libs/impgen.c || \
sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \
*\// { s/^# //;s/^# *$//; p; }" -e d < ./libtool > .libs/impgen.c
test -f .libs/impgen.exe || (cd .libs && \
if test "x" != "x" ; then -o impgen impgen.c ; \
else gcc -o impgen impgen.c ; fi)
.libs/impgen /usr/lib/../bin/cygXpm-4.dll > .libs/cygXpm-4.dll-def
generating import library for `cygXpm-4.dll'
dlltool --as=as --dllname cygXpm-4.dll --def .libs/cygXpm-4.dll-def --output-lib
.libs/libimp-cygXpm-4.a
grep: /usr/lib/libiconv.la: No such file or directory
/usr/bin/sed: can't read /usr/lib/libiconv.la: No such file or directory
libtool: link: `/usr/lib/libiconv.la' is not a valid libtool archive
make[2]: *** [libgd.la] Error 1
make[2]: Leaving directory `/home/shah/hsv/gd-2.0.33'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/shah/hsv/gd-2.0.33'
make: *** [all] Error 2

I'm not sure how to fix this and actually don't have a clue how to compile the program. Could anyone help me on how to use gd with c++ in linux?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

/usr/lib/32/32-> Question

Hello UNIX people. I was just cruising around my UFS and came across the directory /usr/lib/32. This directory continues up many directories (/usr/lib/32/32/32/32->). Each level of 32/ directory seems to be a copy of the previous one. I have been working with UNIX for a little while now, but I... (3 Replies)
Discussion started by: shaggy
3 Replies

2. Programming

LIB question

a program on linux uses three libs: libutil.a libtermcap.a libpthread.a. If I want to transplant this program to Solaris, where can I get the three libs? Thanks. (2 Replies)
Discussion started by: hewlet
2 Replies

3. Linux

ct-lib on Lynix

Hi Friends ! Where can I get free ct-lib for Lynix ?? My problem is something like this-- Sybase server is running on a Solaris machine. Now I trying to access the Sybase from a Lynix machine for which i need ct-lib. I tried by downloading some free ct-libs for Lynix on the net, but they... (2 Replies)
Discussion started by: mrgubbala
2 Replies

4. Programming

To use lib or lib32?

A good day to you, dear experts, I am a newbie, I noticed in binutils or gcc there are lib and lib32 and lib64, to take binutils as an example, My system is sgi IRIX6.5, which is suggested to use "n32" flag during the compiling and linking, is that mean that I need to use lib32? Q1. which one... (2 Replies)
Discussion started by: lakeat
2 Replies

5. Programming

2D Graphics Lib

Hi, I am on Fedora9 and need to do some simple 2D graphics (for game development). I am looking for an ideal 2D library/package to be used with GCC. I have come accross GRX, libmxi and some OpenGL (The 3D), but none of which seems to be ok. I could not find any tutorial or support material... (1 Reply)
Discussion started by: nasersh
1 Replies

6. Red Hat

ls: /lib/libattr.so.1: no version information available (required by /lib/libacl.so.1)

Hello, I'm experimenting a problem on my rh server. Red Hat Enterprise Linux AS release 3 (Taroon Update 8) 2.4.21-47.ELsmp #1 SMP i686 i686 i386 GNU/Linux It started with a segmentation fault on #id root To resolve it, I've installed coreutils-4.5.3-28.4.i386.rpm But, I... (6 Replies)
Discussion started by: gogol_bordello
6 Replies

7. Red Hat

Lib missing

Hai dear, I am installing some application on linux RedHat 9 It gives me following discrepancies lib.so.6 (GLIBC_2.3.4) needed lib.so.6 (GLIBC_2.4) needed libpthread.so.0(GLIBC_2.3.3) needed rtld(GNU_HASH) needed i tried to search a lot on internet to find relative rpm for these libs... (3 Replies)
Discussion started by: Danish Shakil
3 Replies

8. AIX

LIB Version

Hi...please help with command to find the library version on AIX server ---------- Post updated at 12:50 PM ---------- Previous update was at 12:31 PM ---------- AIX version is 6.1.Please (4 Replies)
Discussion started by: Sanal
4 Replies

9. AIX

Lib files

Hi All, I am trying to install IIS Suite application on AIX box. It gave an error as below Ensure the following libraries do not exist: /usr/lib/libicuio.a, /usr/lib/libicuuc.a, /usr/lib/libicui18n.a. These libraries may cause uvsh to not work properly. I manually removed these files by... (1 Reply)
Discussion started by: tostay2003
1 Replies

10. UNIX for Dummies Questions & Answers

Can't CD to lib ??? why

Hi, I have root access and user name called prod. but it doesn't matter which user I log in as. But I can't CD to the directory. Can you advise. dr-xr-xr-x 1 root root 1 Sep 12 15:40 lib $id uid=4902(prod) gid=50(develop) $cd lib -bash: cd: lib: Permission... (7 Replies)
Discussion started by: samnyc
7 Replies
raptor-config(1)					      General Commands Manual						  raptor-config(1)

NAME
raptor-config - script to get information about the installed version of Raptor SYNOPSIS
raptor-config [--cflags] [--options] [--help] [--libs] [--libtool-libs] [--private-libs] [--prefix[=DIR]] [--version-decimal] [--version] DESCRIPTION
raptor-config is a tool that is used to determine the compile and linker flags that should be used to compile and link programs that use the Raptor RDF parser library. OPTIONS
raptor-config accepts the following options: --cflags Print the compiler flags that are necessary to compile a raptor program. --options Print raptor compiled options such as parsers and serializers available, the XML parser used (if any) and the WWW retrieval library used (if any). --help Print a help message summarising usage. --libs Print the linker flags that are necessary to link a raptor program. This excludes linker arguments used to build the raptor shared library. --libtool-libs Print the path to the libtool file for raptor. --private-libs Print the linker flags that are necessary to build the raptor shared library. This option is not usually needed because the raptor shared library has already been dynamically linked against these flags. --prefix=PREFIX If specified, use PREFIX instead of the installation prefix that raptor was built with when computing the output for the --cflags and --libs options. This option must be specified before any --libs or --cflags options. --version Print the currently installed version of raptor on the standard output. --version-decimal Print the currently installed version of raptor as a decimal integer. SEE ALSO
libraptor(3) AUTHOR
Dave Beckett - http://www.dajobe.org/ <http://www.dajobe.org/> 2008-04-01 raptor-config(1)
All times are GMT -4. The time now is 02:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy