public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* How do I link in more than one COFF file during the process of making an exe?
@ 2001-04-18 23:39 HassanAA33
  2001-04-19  0:43 ` Nick Clifton
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: HassanAA33 @ 2001-04-18 23:39 UTC (permalink / raw)
  To: gcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 686 bytes --]

I have a source file hello.cpp.  I also have two resource files: helloRc.rc 
and helloRc2.rc.  When I compile hello.cpp using g++.exe and helloRc.rc and 
helloRc2.rc using windres.exe I end up with
the folling output files:  hello.o, helloRc.o(COFF file), and helloRc2.o(COFF 
file). Now when I link these files together using the command line:
         g++ -o hello.exe hello.o helloRc.o helloRc2.o
helloRc2.o does not get linked in and I can't figure out why.  It seems as 
though g++ will only accept one COFF file -- the first one listed.  My 
question is: How do I link in more than one COFF file during the process of 
making an executable?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How do I link in more than one COFF file during the process of making an exe?
  2001-04-18 23:39 How do I link in more than one COFF file during the process of making an exe? HassanAA33
@ 2001-04-19  0:43 ` Nick Clifton
  2001-04-19  9:54 ` Toshi Morita
  2001-04-19 10:45 ` DJ Delorie
  2 siblings, 0 replies; 4+ messages in thread
From: Nick Clifton @ 2001-04-19  0:43 UTC (permalink / raw)
  To: HassanAA33; +Cc: gcc

Hi Hassan,

> I have a source file hello.cpp.  I also have two resource files: helloRc.rc 
> and helloRc2.rc.  When I compile hello.cpp using g++.exe and helloRc.rc and 
> helloRc2.rc using windres.exe I end up with
> the folling output files:  hello.o, helloRc.o(COFF file), and helloRc2.o(COFF 
> file). Now when I link these files together using the command line:
>          g++ -o hello.exe hello.o helloRc.o helloRc2.o
> helloRc2.o does not get linked in and I can't figure out why.  It seems as 
> though g++ will only accept one COFF file -- the first one listed.  My 
> question is: How do I link in more than one COFF file during the process of 
> making an executable?

Normally all object files specified on the command line will be linked
in to the final executable.  So something a little bit unusual must be
going on.

First of all - how do you know that the second resource file is not
being linked in ?

Secondly - what is the output if you add the -v command line switch
when you invoke g++ to link together the object files ?  (The -v
switch tells g++ to be verbose and show the commands that it is
running.  In this particular case, it should show how the linker is
being invoked, and may possibly gives us a clue as to what is going
wrong).

Cheers
        Nick

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How do I link in more than one COFF file during the process of making an exe?
  2001-04-18 23:39 How do I link in more than one COFF file during the process of making an exe? HassanAA33
  2001-04-19  0:43 ` Nick Clifton
@ 2001-04-19  9:54 ` Toshi Morita
  2001-04-19 10:45 ` DJ Delorie
  2 siblings, 0 replies; 4+ messages in thread
From: Toshi Morita @ 2001-04-19  9:54 UTC (permalink / raw)
  To: HassanAA33; +Cc: gcc

> I have a source file hello.cpp.  I also have two resource files: helloRc.rc 
> and helloRc2.rc.  When I compile hello.cpp using g++.exe and helloRc.rc and 
> helloRc2.rc using windres.exe I end up with
> the folling output files:  hello.o, helloRc.o(COFF file), and helloRc2.o(COFF 
> file). Now when I link these files together using the command line:
>          g++ -o hello.exe hello.o helloRc.o helloRc2.o
> helloRc2.o does not get linked in and I can't figure out why.  It seems as 
> though g++ will only accept one COFF file -- the first one listed.  My 
> question is: How do I link in more than one COFF file during the process of 
> making an executable?

GCC doesn't link files. GCC converts C/C++/etc source files into assembly
code, which is then converted to object files by GAS and linked via LD.

This problem sounds like you are using Cygwin, which is a Windows-specific
version of GCC. There is a specific mailing list dedicated to the Cygwin
tools, and you will probably get an answer here, since most of us here
don't use Windows.

Toshi


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How do I link in more than one COFF file during the process of making an exe?
  2001-04-18 23:39 How do I link in more than one COFF file during the process of making an exe? HassanAA33
  2001-04-19  0:43 ` Nick Clifton
  2001-04-19  9:54 ` Toshi Morita
@ 2001-04-19 10:45 ` DJ Delorie
  2 siblings, 0 replies; 4+ messages in thread
From: DJ Delorie @ 2001-04-19 10:45 UTC (permalink / raw)
  To: gcc


HassanAA33@aol.com writes:
> I also have two resource files:

You can't have two resource files.  It doesn't work that way.  You are
limited to one resource file.  If you link in more than one, only the
first is seen.

Further questions should be sent to either
binutils@sources.redhat.com, where the resource compiler is
maintained.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-04-19 10:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-18 23:39 How do I link in more than one COFF file during the process of making an exe? HassanAA33
2001-04-19  0:43 ` Nick Clifton
2001-04-19  9:54 ` Toshi Morita
2001-04-19 10:45 ` DJ Delorie

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).