chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] find-library only tests static libs on Windows?


From: Matt Gushee
Subject: [Chicken-users] find-library only tests static libs on Windows?
Date: Mon, 4 May 2015 18:08:26 -0600

Hi, all--

I ran into something peculiar last night while attempting to install the canvas-draw egg. There was a linker error saying that the function "cdInitContextPlus" was undefined. This didn't make sense at first, since I knew the appropriate library, 'cdcontextplus,' was installed, and all environment variables related to libraries were correct.

However, I noticed that the compiler command line as reported by chicken-install was missing '-lcdcontextplus.' Then I checked the canvas-draw.setup file, and I saw:

    ,@(cond-expand
         [disable-canvas-draw-native
             '()]
         [else
             (append
                  (if (find-library "cdx11" "cdContextNativeWindow")
                      '("-lcdx11") '())
                  (if (find-library "cdcontextplus" "cdInitContextPlus")
                      '("-lcdcontextplus") '()))])

Then I checked the docs for find-library, and found:

    (find-library NAME PROC) [procedure]

        Returns #t if the library named libNAME.[a|so] (unix) or NAME.lib (windows) could be found by compiling and linking a test program.

I gather that .lib is the extension for static libraries on Windows, whereas I had installed only the DLL version of the IM, CD, and IUP libraries. So that seemed to explain the error. And indeed, I found that when I replace the IF clause in the setup file with just

    '("-lcdcontextplus")

The egg then compiled without error.

But I'm wondering why I needed to do that. Is there some reason why it would be a bad idea, or would not work, for find-library to test DLLs as well as static libs?

TIA for any info.

--
Matt Gushee

reply via email to

[Prev in Thread] Current Thread [Next in Thread]