How do I link in more than one COFF file during the process of making an exe?

Toshi Morita tm2@best.com
Thu Apr 19 09:54:00 GMT 2001


> 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




More information about the Gcc mailing list