[fpc-devel] [fpc-pascal] mingw libraries for C API bindings

Wolfram Kläger wolfram.klaeger at web.de
Sun Oct 25 12:31:31 CET 2009


I am trying to write fpc bindings for the GraphicsMagick imaging library. Since it's a fork of ImageMagick, its API is basically the same. 

I know there is a similar fpc package called PascalMagick. Unfortunately, this seems to be an unfinished effort. Types are redefined from c  headers, but C-API function and procedure calls are not implemented yet.

I managed to update my MinGW installation on XP, and to install GraphicsMagick on top. There are a couple of dependancies. Finally calling "make check" reports, everything is alright.

So far, so good. The interesting (and annoying) part of the story is my attempt to feed fpc with all library links required. After a while, I found myself in an endless loop of searching for undefined symbols, dropping yet another linklib in my source, in case updating search paths in my fpc.cfg, and still receiving 

Error : Undefined symbol: __imp___iob

Now I am helpless and looking for any systematic, reliable approach to solve such "errors". I can't believe it's rocket science to get appropriate info about which libraries are exactly required. 

Five underscores per identifier let me assume, I must have entered the hardcore C zone. Here's my current list of already linked libs.

  {$linklib libadvapi32}
  {$linklib libbz2}
  {$linklib libbfd}
  {$linklib libcrtdll}
  {$linklib libdxerr8}
  {$linklib libdxerr9}
  {$linklib libgcc}
  {$linklib libgcc_eh}
  {$linklib libgcov}
  {$linklib libgdi32}
  {$linklib libgomp}
  {$linklib libiberty}
  {$linklib libkernel32}
  {$linklib libltdlc}
  {$linklib libmingwex}                 
  {$linklib libmoldname}
  {$linklib libmsvcr70}
  {$linklib libmsvcr70d}
  {$linklib libmsvcr71}
  {$linklib libmsvcr71d}
  {$linklib libmsvcr80}
  {$linklib libmsvcr80d}
  {$linklib libmsvcr90}
  {$linklib libmsvcr90d}
  {$linklib libmsvcrt}
  {$linklib libmsvcrtd}                 
  {$linklib libpthreadGC2}
  {$linklib libpthreadGCE2}
  {$linklib librapi}
  {$linklib libscrnsave}
  {$linklib libssp}
  {$linklib libuser32}
  {$linklib libwinspool}
  {$linklib libXpm}

  {$linklib libGraphicsMagick}
  {$linklib libGraphicsMagickWand}

Any hints out there, what I am still missing?

Thanks in advance
Wolfram



More information about the fpc-devel mailing list