From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5ec8c2333db24f01,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-01 07:47:00 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: x24702@usma.edu (Zach Swanson) Newsgroups: comp.lang.ada Subject: ImageMagick libs and Ada Date: 1 Feb 2002 07:46:59 -0800 Organization: http://groups.google.com/ Message-ID: <50c1a1b.0202010746.3ee4bd7a@posting.google.com> NNTP-Posting-Host: 134.240.36.230 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1012578419 2246 127.0.0.1 (1 Feb 2002 15:46:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 1 Feb 2002 15:46:59 GMT Xref: archiver1.google.com comp.lang.ada:19481 Date: 2002-02-01T15:46:59+00:00 List-Id: I'm hoping that perhaps someone here has tried to use the ImageMagick graphics suite and sucessfully imported functions into Ada95. Working on my senior year capstone project at USMA, my team is developing a computer vision system and doing some parabolic mirror image undistortion using ImageMagick-5.4.1 to access the bitmaps/pixels. We are compiling the C code in Cygwin, and the Ada code using GNAT under Windows 2000. We have written our initial functions for this in ANSI C, the language that ImageMagick is developed in. We would like to be able to import these functions into Ada95, otherwise our only option is to compile the C as an exectuble and use the GNAT "spawn" command to run the binary as a seperate process. This is undesirable though since we cannot pass/recieve paramaters this way. Our import looks like this so far: pragma import (C, undistort_func, "undistort_func"); pragma linker_options("img_manip.o"); pragma linker_options("img_functions.o"); With just this code the link would fail though because the ImageMagick functions aren't included in the object code, so we also provided a linker argument to the lib files provided by ImageMagick. This argument was found using the Magick-Config file: pragma linker_options("-L c:\cygwin\usr\local\lib\ -lmagick -ljpeg -lz -lm -lpthread"); At this point all the lib files are found by the linker, but it generates several hundred errors. The errors are generated inside the source code of all the ImageMagick routines. The error message looks like this: "In function 'GetImageMagick' magick.c:178: undefined reference to '__assert' Other values that the linker is unable to reconcile are __impure_ptr and __errno. My faculty advisors suggested adding the linker argument -lc to include the standard C library, but this didn't work either. If anyone has successfully imported the ImageMagick library into Ada95, or if you are familiar with the type of problem we're having, help or suggestions would be much appreciated. Thank you Zach Swanson, United States Military Academy