This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
linking with ar help
- From: y2bismil at engmail dot uwaterloo dot ca
- To: GCC- help <gcc-help at gcc dot gnu dot org>
- Date: Tue, 28 Oct 2003 15:38:37 -0500
- Subject: linking with ar help
Hi all,
I'm having a bit of problem linking here. I've archived several object files
and push those into the linker. Then I get some, not a long though, of
undefined refereces errors. These are straight c++ link errors. No extern "C"
or asm or anything. The 'complaining' file is c++, and the file where the
definition is, is also c++.
Now, this had my puzzled for a while, until I explicity linked to the originial
(unarchived) object files. Doing this resolved the first few errors. I'm
thinking I must be doing something wrong with the archiving.
the cygwin command I'm using.
ar.exe rP $(.TARGET) <@<
$(.SOURCES,W\n)
I have tried other option combinations "cr" ...but to no avail.
To link, I do:
*****************************
gcc -mno-cygwin
-lwsock32
-g
-o$(_Target)
$(LinkFiles)
myobject.o
*****************************
I've verified the contents of LinkFiles, which seems right. Notice the
insertion of myobject.o...this is my hack to get past the first few errors. I
don't want to add all the objects files here. I wanted to use archives for a
reason. BTW...there are duplicate object file names, but they are in different
directories. When I archive each directory, I copy each arhive to a central
link directory, where everything is linked.
Any ideas?
Thanks,
Yamin
----------------------------------------
This mail sent through www.mywaterloo.ca