lua-users home
lua-l archive

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


Hi, I'm sorry to bug you guys with something this mundane.  I've been
trying to get this working for two days and feel like I'm in a bit
over my head.  I've managed to get it to compile and link, but when
running the library, I get this error:

    lua: error loading module 'luagd' from file './luagd.so':
	    dlopen(./luagd.so, 2): Symbol not found: _gdFontGetGiant
      Referenced from: /Users/mjudge/Downloads/lua-gd-2.0.33r2/luagd.so
      Expected in: dynamic lookup

(Thanks for your help)

------------------------------------------------------------
Here's the log of steps I took to compile it:

Downloaded the lua source for 5.1.3, compiled via:

* make macosx
* sudo make install

Installed gd via macports:

* sudo port install gd2

Downloaded lua-gd-2.0.33r2 (for Lua 5.1), compiled via:

* gcc -O2 -fno-common -I/usr/local/include/ -I/opt/local/include/ -c
-o luagd.o luagd.c
  luagd.c:2165: error: 'LgdImageCreateFromPng' undeclared here (not in
a function)
  luagd.c:2166: error: 'LgdImageCreateFromPngPtr' undeclared here (not
in a function)

* Edited luagd.c to wrap those lines in an ifdef GD_PNG:

    #ifdef GD_PNG
        { "createFromPng",          LgdImageCreateFromPng },
        { "createFromPngStr",       LgdImageCreateFromPngPtr },
    #endif

* Recompiled
    gcc -O2 -fno-common -I/usr/local/include/ -I/opt/local/include/ -c
-o luagd.o luagd.c

* Linked
    gcc -bundle -undefined dynamic_lookup -Wl -bind_at_load -o luagd.so luagd.o

* Copied to my lua include path
   sudo cp luagd.so /usr/local/lib/lua/5.1/

* Fired it up

    lua -l luagd
    lua: error loading module 'luagd' from file './luagd.so':
	    dlopen(./luagd.so, 2): Symbol not found: _gdFontGetGiant
      Referenced from: /Users/mjudge/Downloads/lua-gd-2.0.33r2/luagd.so
      Expected in: dynamic lookup

* Stumped