[Scons-users] Building a C++ program

William Blevins wblevins001 at gmail.com
Wed Nov 25 16:00:09 EST 2015


You haven't stated the issue.

But I am curious as to why you put g++ into the CPPPATH since that is for
includes.

V/R,
William

On Wed, Nov 25, 2015 at 7:59 PM, Christopher Dimech <
dimech.christopher at gmail.com> wrote:

> I have a c++ program with files as follows.
>
> I want to use g++ from the following path
>      /home/cdi/Local/gcc-5-20150201/bin/g++
>
> The program is raytrac.cpp and I use header files
> for some classes
>
> Currently my scons file looks as follows
>
> path = ['/bin', '/usr/bin']
>
> env = Environment (
>   ENV = {'PATH' : path},
>   CPPPATH='/home/cdi/Local/gcc-5-20150201/bin/g++',
>   CPPPATH='adt',
>   LINK='/home/cdi/Local/gcc-5-20150201/bin/g++',
>   LINKFLAGS='-g'
> )
>
> env.VariantDir (
>   variant_dir = 'build/larsa',
>   src_dir = 'larsa',
>   duplicate = 0
> )
>
> env.VariantDir (
>   variant_dir = 'build/meidum',
>   src_dir = 'meidum',
>   duplicate = 0
> )
>
> env.VariantDir (
>   variant_dir = 'build/adt',
>   src_dir = 'adt',
>   duplicate = 0
> )
>
> env.VariantDir (
>   variant_dir = 'build/main',
>   src_dir = 'main',
>   duplicate = 0
> )
>
> sources = [
>   'build/raytrac.cpp'
> ]
>
> # Constructs object files without the .mod
> allobjs = env.Object (sources)
>
> env.Program (
>   target = 'build/bin/raytrac.x',
>   source = objs
> )
>
> Here is the file structure.
>
> ├── larsa
> │   ├── error.hpp
> │   ├── parseel.hpp
> │   ├── parse.hpp
> │   └── string.hpp
> ├── meidum
> │   ├── complex.hpp
> │   ├── matrix.hpp
> │   ├── numeric.hpp
> │   └── vector.hpp
> ├── adt
> │   ├── graph.hpp
> │   ├── list.hpp
> │   ├── stack.hpp
> │   └── tree.hpp
> ├── main
> │   ├── raytrac.cpp
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20151125/4252b297/attachment.html>


More information about the Scons-users mailing list