The Library Builder

SCons Reference Manual 0.98.0
Prev | Chapter 2. Builder Reference | Next

# 2.7. The Library Builder

## 2.7.1. Linking With a Library

          env = Environment(CC = 'gcc',
                            LIBS = 'world')
          env.Program('hello.c')

% `scons`
gcc -c hello.c -o hello.o
gcc -c world.c -o world.o
gcc -o hello hello.o -lworld

## 2.7.2. Creating a Library

          env = Environment(CC = 'gcc',
                            LIBS = 'world')
          env.Program('hello.c')
          env.Library('world.c')

% `scons`
gcc -c hello.c -o hello.o
gcc -c world.c -o world.o
ar r libworld.a world.o
ar: creating libworld.a
ranlib libworld.a
gcc -o hello hello.o libworld.a

## 2.7.3. The `Library` Builder

X

Prev | Home | Next
The InstallAs Builder | Up | The Object Builder