public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: y2bismil@engmail.uwaterloo.ca
To: GCC- help <gcc-help@gcc.gnu.org>
Subject: linking with ar help
Date: Tue, 28 Oct 2003 20:38:00 -0000	[thread overview]
Message-ID: <1067373517.3f9ed3cda1504@www.nexusmail.uwaterloo.ca> (raw)

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

                 reply	other threads:[~2003-10-28 20:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1067373517.3f9ed3cda1504@www.nexusmail.uwaterloo.ca \
    --to=y2bismil@engmail.uwaterloo.ca \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).