[Scons-users] Building a C++ program

Christopher Dimech dimech.christopher at gmail.com
Wed Nov 25 16:42:42 EST 2015


I am now using link and using CPPPATH for my include directories. It
is a program I was building with make and I am using Scons this time.

Have changes my directory structure and trying to fix the include
paths in the files as I am getting

scons -f raytrac.py
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build/main/raytrac.o -c -Ilarsa -Imeidum -Iadt -Itomog main/raytrac.cpp
In file included from tomog/layer.hpp:23:0,
                 from main/raytrac.cpp:184:
tomog/../estim//intfc/intfc_linr.hpp:15:30: fatal error:
../raytr/intfc.hpp: No such file or directory
 #include "../raytr/intfc.hpp"
                              ^
compilation terminated.
scons: *** [build/main/raytrac.o] Error 1
scons: building terminated because of errors.


I seen some examples but some suggestions to improve
my script would be very helpful.

path = ['/bin', '/usr/bin']

env = Environment (
  ENV = {'PATH' : path},
  CPPPATH = ['larsa', 'meidum', 'adt', 'tomog'],
  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/tomog',
  src_dir = 'tomog',
  duplicate = 0
)

env.VariantDir (
  variant_dir = 'build/main',
  src_dir = 'main',
  duplicate = 0
)

sources = [
  'build/main/raytrac.cpp'
]

# Constructs object files without the .mod
allobjs = env.Object (sources)

env.Program (
  target = 'build/bin/raytrac.x',
  source = allobjs
)


On 25 November 2015 at 21:05, Dirk Bächle <tshortik at gmx.de> wrote:
> On 25.11.2015 22:00, William Blevins wrote:
>>
>> 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
>>
>
> You beat me by 28 seconds. ;)
> "The force is strong in this young one."
>
> Dirk
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users



-- 
Christopher Dimech


More information about the Scons-users mailing list