Hi, I'm building Godot mono version with my custom module, I using boost library by adding the path in the SCsub file but always get an error message that says can't find the lib file. I'm pretty sure that the lib is just in the folder, how do I fix it?

SCsub file:

Import('env')
env.add_source_files(env.modules_sources, "*.cpp") #this will add all the cpp files
env.Append(CPPPATH=["D:/CPP_Libs/boost_1_77_0"])
env.Append(LIBPATH=['D:/CPP_Libs/boost_1_77_0/stage/lib'])

Error Message when building in terminal:

LINK : fatal error LNK1104: cannot open file 'libboost_locale-vc142-mt-s-x64-1_77.lib'
scons: *** [bin\godot.windows.tools.64.mono.exe] Error 1104
scons: building terminated because of errors.

Error Message when building in visual studio:

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK1104	cannot open file 'libboost_locale-vc142-mt-s-x64-1_77.lib'	godot	D:\Git\GodotEngine\godot_mono\LINK	1	
Error	MSB3073	The command "echo Starting SCons && cmd /V /C set "plat=x64" ^& (if "x64"=="x64" (set "plat=x86_amd64")) ^& set "tools=True" ^& (if "debug"=="release" (set "tools=no")) ^& call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" !plat! ^& scons vsproj=yes --directory="D:\Git\GodotEngine\godot_mono" platform=windows target=debug progress=no tools=!tools! -j1" exited with code 2.	godot	C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets	54
2 months later

in the last year i used boost in many programs. asio and beast. to be true atm not in godot. but never used as lib - boost is a header based library so i use the hpp's with includes like this "#include <boost/beast/core.hpp>"

I think what is missing in the OPs post is adding the LIBS environment variable, so it knows which libraries it needs to link to. I think adding env.Append(LIBS=["libboost_locale-vc142-mt-s-x64-1_77.lib"]) after setting the library path may make it compile successfully.

Though for the automatic crash reporting module I made, I ended up using env.Append(LINKFLAGS=["path_to_libary.lib"] directly, as I couldn't quite get Scons to find the libraries automatically. I really good reference I found for how to setup a module with library dependencies is the Godot Steam library, as it has a really nice SCsub file that shows how the Steam libraries are included in the module.

Indeed, I add the lib path and compile it again, everything working well now! Though I just add a very simple function that let me catch the player's system locale.

This is my setting in the SCub file:

Import('env')

env.add_source_files(env.modules_sources, "*.cpp") #this will add all the cpp files

env.Append(CPPPATH=["D:/CPP_Libs/boost_1_76_0"])
env.Append(LIBPATH=['D:/CPP_Libs/boost_1_76_0/bin/x64/lib'])

#env.Append(LIBS=['Locale'])

a year later