This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Using GNU ld version 2.13.90.0.18 20030206 (comes with Redhat 9) Also experienced with previous 3.x and 2.9x versions.
one.cc ------ #include <stdio.h>
class A {
public:
A() { printf("Hello world!\n"); }
};
A a;
------two.cc
------
int main() {}
------combined.cc ----------- #include "one.cc" #include "two.cc" -----------
Makefile -------- CPP=g++ test:main1 main2 main3 main4 ./main1 ./main2 ./main3 ./main4 %.o:%.cc $(CPP) -c $< lib%.a:%.o ar rv $@ $< both.a:one.o two.o ar rv $@ $^ main1:one.o two.o $(CPP) one.o two.o -o main1 main2:libone.a libtwo.a $(CPP) libone.a libtwo.a -o main2 main3:both.a $(CPP) both.a -o main3 main4:libcombined.a $(CPP) libcombined.a -o main4 clean: rm -f *.a *.o main* --------
thanks for your time. Hal
Attachment:
static_init.tar.bz2
Description: Binary data
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |