0

I'm pretty new at command line stuff...currently trying to compile some library projects that are mostly built in C++, on my 2007-era MacBook Pro running snow leopard. I was trying to download some necessary libraries using MacPorts, which places them in opt/local/... which is not a default search path. I know that if I was compiling individual c++ programs I could just use the -L tag when running g++ but I am actually running scons scripts which compile dozens of lines at a time. I can't place dozens or hundreds of -L tags throughout these programs.

I don't know how to add /opt/local to the default library directories for gcc/g++ and I don't know how to get these Macports-installed libraries from /opt/local into a default directory. I would think either should work. I saw a related topic on a different board that recommended recompiling gcc, but I am using the older version of gcc which came with Xcode, I'd rather not risk screwing things up with Xcode unless I know that is the only way.

RussH
  • 329
  • 2
  • 17
  • Possible duplicate of http://stackoverflow.com/q/4678548/172599. Short answer: scons doesn't have a default way of passing in environment variables, you'll have to edit the SConstruct unless the program/library's author has provided a way to do so. – Dave Bacher Oct 17 '11 at 17:38

1 Answers1

0

Try adding '/opt/local/lib' to the LIBPATH in the Environment() in the SCons build system.

bdbaddog
  • 3,357
  • 2
  • 22
  • 33