This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos 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]

RE: how to link sevral *.o file into one *.o?


Why do you want them in a .o file?  Are you trying to link them (i.e., into
an executable or binary image)?
.o files are "object" files - you can't actually do much with them, other
than link them into an executable.
If you really want to do that, for some reason, instead of calling "gcc foo.
c -o foo.o" and then "gcc bar.c -o bar.o", try "gcc foo.c bar.c -o foo.o".
I'm not at all clear that this will actually work, though.

If you're after an executable, you probably want "gcc foo.o bar.o -o
myapp.out", or some such.
For a library, you want to use libtool - there's a multitude of options
you're going to want to look at.

I'd suggest that you look at the GNU documentation for these tools.
GCC: http://gcc.gnu.org/onlinedocs
libtool:
http://www.gnu.org/manual/libtool-1.4.2/html_chapter/libtool_toc.html

If you have further questions, feel free to e-mail me (but I think that this
is kind of out of the scope of the eCos list.)

# -----Original Message-----
# From: johnsonest@hotmail.com [mailto:johnsonest@hotmail.com]
# Sent: Monday, October 28, 2002 10:58 PM
# To: ecos-discuss@sources.redhat.com
# Subject: [ECOS] how to link sevral *.o file into one *.o?
# 
# 
# 
# Hi,all.
#      Assume I have a.o,b.o,c.o,d.o,....
# Now I want to get a whole.o
# 
# bash>gcc ....?
# conditions: maybe functions in a.o will call functions in 
# b.o,c.o,...etc.
# question:
# 
# 1.how to use a(b,c,d,...).o to get the whole.o?
# 
# 2.how to use a(b,c,d,...)>o to get a lib(eg. libwhole.a)?
# 
# could you help me?
# THANK YOU VERY MUCH!
# BRS/johnsonest
# 
# _________________________________________________________________
# 与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/lccn/

# 
# 
# -- 
# Before posting, please read the FAQ: 
# http://sources.redhat.com/fom/ecos
# and search the list archive: http://sources.redhat.com/ml/ecos-discuss
# 

--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]