[Scons-users] Adding Libs and Include to a build

Dirk Bächle tshortik at gmx.de
Mon Apr 6 17:00:40 EDT 2015


Hi Owen,

On 06.04.2015 22:28, Owen Alanzo Hogarth wrote:
> I have a c++ project that I would like to add build on.
>
> [...]
>
> env.Append(LIBPATH = libPaths, CPPPATH = includePaths)
> env.add_source_files(env.modules_sources,"*.cpp")
>

where does this method "add_source_files" come from? It's not a standard SCons environment call as far as I know. Is this an 
open-source project with an already existing set of build description files? If yes, please say so...and give the repo's URL, which 
might help other people to have a closer look at your problem.

> I do not get a link error but if I try to do #include "folder/header.h"
> I get file not found linking error BUT if I do #include header.h This links correctly but then that header.h file will link to
> another file at a location like #include "folder/header2.h"
>
> If I could just get scons to find the files at #include "folder/____.h" things would work out just fine.
> Is it possible to do that?
>

SCons is basically just passing the arguments like CPPPATH to the underlying C++ compiler. If your source/header files try to 
include "header.h" as well as "folder/header.h" (inconsistent usage of include directive throughout the project) you'll have to add 
both paths

   "root-sdk/platform1/include/folder" *and*
   "root-sdk/platform1/include"

as search paths for the include files. Note, how you'd have to do the same with autotools or any other build system.

Best regards,

Dirk



More information about the Scons-users mailing list