If you have multiple Lua versions installed side-by-side, i.e.

/usr/local/lib
├── liblua.5.1.5.dylib
├── liblua.5.1.dylib
├── liblua.5.2.4.dylib
├── liblua.5.2.dylib

/usr/local/include
├── lua-5.1
├── lauxlib.h
├── lua.h
├── lua.hpp
├── luaconf.h
├── lualib.h

The build, semi-predictably, fails with a linking error as it tries to
hook the Lua headers in /usr/local/include belonging to Lua 5.2, rather
than the headers in the Lua-5.1 folder.

Less predictably if you pass:

"-DLUA_INCLUDE_DIR:PATH=/usr/local/include/lua-5.1"

to CMake it reports that correctly:

-- Found Lua50: /usr/local/lib/liblua5.1.dylib
-- Found Lua: /usr/local/lib/liblua5.1.dylib
Lua found - PoDoFoImpose and PoDoFoColor will be built with Lua support
 * Lua include directory: /usr/local/include/lua-5.1
 * Lua libraries: /usr/local/lib/liblua5.1.dylib

But still fails with linking errors suggesting it's trying to cling onto
the wrong Lua headers regardless:

===
Undefined symbols for architecture x86_64:
  "_luaL_loadfilex", referenced from:
      LuaConverter::LuaConverter(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&) in
luaconverter.cpp.o
  "_lua_callk", referenced from:
      LuaConverter::StartPage(PoDoFo::PdfPage*, int) in luaconverter.cpp.o
      LuaConverter::EndPage(PoDoFo::PdfPage*, int) in luaconverter.cpp.o
      LuaConverter::StartXObject(PoDoFo::PdfXObject*) in luaconverter.cpp.o
      LuaConverter::EndXObject(PoDoFo::PdfXObject*) in luaconverter.cpp.o
      LuaConverter::SetStrokingColorGray(PoDoFo::PdfColor const&) in
luaconverter.cpp.o
      LuaConverter::SetStrokingColorRGB(PoDoFo::PdfColor const&) in
luaconverter.cpp.o
      LuaConverter::SetStrokingColorCMYK(PoDoFo::PdfColor const&) in
luaconverter.cpp.o
      ...
  "_lua_getglobal", referenced from:
      LuaConverter::StartPage(PoDoFo::PdfPage*, int) in luaconverter.cpp.o
===

Ideally, as something of a feature request, it'd be possible to disable
the behaviour of scooping non-mandatory dependencies up from the
environment automatically unless requested.

You can seemingly do something like `-DLUA_INCLUDE_DIR:PATH=FALSE` but
not sure if that's an intentional feature looking through the source?

Thanks,

Dom
==
Sent from OS X.

------------------------------------------------------------------------------
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to