Library search path from module not exported

Hi,

I’m trying to make a module which contains precompiled libs for Lua along with the Sol wrapper. Only testing on macOS for now, I’m unable to pass linking because liblua.a is not found. If I check build settings from Xcode, I can see extra Headers Search Paths (one added from the module definition), but no extra Library Search Path (as defined from the module files hiercharchy).

My module folder luna contains:

libs/
  MacOSX/
    x86_64/
      liblua.a
luna/
  forward.hpp
  lauxlib.h
  lua.h
  lua.hpp
  luaconf.h
  lualib.h
  sol.h
luna.h

And here’s the root luna.h file:

/*******************************************************************************
 The block below describes the properties of this module, and is read by
 the Projucer to automatically generate project code that uses it.
 For details about the syntax and how to create or use a module, see the
 JUCE Module Format.txt file.


 BEGIN_JUCE_MODULE_DECLARATION

  ID:               luna
  vendor:           mathieudemange
  version:          0.1.0
  name:             Luna
  description:      Lua and sol-wrapper

  minimumCppStandard:  17
  searchpaths:         luna
  OSXLibs:             lua
  

 END_JUCE_MODULE_DECLARATION

*******************************************************************************/

#include "luna/sol.hpp"

Any clue?

Thanks a lot!

I actually managed to make my module without relying on a precompiled liblua.a with inspiration from VFLib (thanks @TheVinn). But, for the sake of curiosity, I’d still like to understand why my previous attempt failed :slight_smile:

I’ve been working on including a precompiled library file in a JUCE module the last couple days, which was a bit of a struggle, and this post came up in my searches. I eventually got it working for my module here.

Looking at what you posted, I wonder if you need to include the searchpaths directive at all, since the luna directory is already inside the module? (My understanding was that it was for paths outside the module, but I could be wrong about that.)

Also you #include luna/sol.hpp, but that file isn’t listed in the folder contents… although that would throw a compiler error, not a linker error, if that was a problem (maybe you just renamed the file).