NO

Author Topic: Help with LibGD  (Read 4473 times)

Mario

  • Guest
Help with LibGD
« on: May 31, 2007, 07:57:03 PM »
How to use LibGD (http://www.libgd.org) with PellesC?
I do not succeed in getting the lib from the Dll, can you help me?
Thx
Mario

koala

  • Guest
Re: Help with LibGD
« Reply #1 on: June 13, 2007, 12:03:59 PM »

I have the same problem, some solution?

(Compilation run fine, but on run some gd functions like gdImageJpeg cause segmentation fault)

Meanwhile i use PellesC to write code and mingw to compile.

Thank You


Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Re: Help with LibGD
« Reply #2 on: June 13, 2007, 03:57:21 PM »
Problem due to the wrong calling convention.
Define the symbol 'WIN32' in your projects.
From ide menu project->project_options->compiler add 'WIN32' in the symbol's define box.
From command line use switch '/D' to define symbol 'WIN32'.
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

koala

  • Guest
Re: Help with LibGD
« Reply #3 on: June 13, 2007, 05:14:08 PM »
I tried, but i have same problem.

On menu project->project_options->compiler  at the bottom, now appears:

Comand line options: (CCFLAGS)
 -Tx86-coff -Ot -W1 -Gz -Ze -DWIN32

is all right?

Thank You

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Re: Help with LibGD
« Reply #4 on: June 13, 2007, 07:58:36 PM »
Ok the problem is the incompatibility of PellesC and M$ file I/O approach.
To use the precompiled dll you have to omit the default libraries and link the msvcrt.lib instead.
Please look at the attached sample.
« Last Edit: June 13, 2007, 08:01:28 PM by frankie »
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

koala

  • Guest
Re: Help with LibGD
« Reply #5 on: June 13, 2007, 08:57:02 PM »

It's working fine!!!!


Thank You