help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems in Linking.


From: Amit
Subject: Problems in Linking.
Date: 18 Aug 2005 13:43:35 -0700
User-agent: G2/0.2

Hi,
 I have posted this on gnu.g++.help but the message has not appeared
there yet, so I am posting it to this group in case someone is able to
help me out.
I am using gcc 3.3 on os X 10.3.9
I am trying to create a library in c++. So first I compile all the
files and create object files. Then I do the following:

ar ruv libmy.a file1.o file2.o file3.o file4.o

After this I try to use it in a test program as follows:

g++ -pg  -O -Wno-deprecated  -ansi -pedantic -o test test.C
-DANSI_HEADERS -D_G_HAVE_BOOL -I. -I/ALLINCLUDEDIRS -lmy -L.

but the linker complains saying,

ld: archive: ./librat.a has no table of contents, add one with
ranlib(1) (can't load from it)

How can I resolve this? I have used the same approach before for
creating the library on gcc 3.1 on RH 9.0. Am I missing something?

thanks,
amit.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]