6

I recently started using scons to build several small cross-platform projects. One of these projects needs to link against pre-built static libraries... how is this done?

In make, I'd just append "link /LIBPATH:wherever libstxxl.lib" on windows, and "stxxl.a" on unix.

oz10
  • 153,307
  • 27
  • 93
  • 128
  • One small note, it's better to say `LIBS=['foo']` rather than `LIBS=['libfoo']`. The former gives you platform independance (ie, in POSIX you will get a libfoo.a, and in Windows a foo.lib) – Imran.Fanaswala Dec 12 '08 at 00:49

1 Answers1

11

Just to document the answer, as I already located it myself.

Program( 'foo', ['foo.cpp'], LIBS=['foo'], LIBPATH='.' )

Adding the LIBS & LIBPATH parameters add the correct arguments to the build command line.

More information here.

oz10
  • 153,307
  • 27
  • 93
  • 128