Bug 641 - file format not recognized; treating as linker script
Summary: file format not recognized; treating as linker script
Status: RESOLVED INVALID
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: unspecified
: P1 critical
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-06 16:16 UTC by Jeff
Modified: 2006-03-28 00:57 UTC (History)
2 users (show)

See Also:
Host: Windows 2000, I686
Target: Windows 2000, I686
Build: Windows 2000, I686
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff 2005-01-06 16:16:57 UTC
Compile seems to work fine but will not link.  Any thoughts?



**** Full rebuild of configuration Release for project Auth ****

make -k clean all 
rm -rf     AuthTest.o AuthTestDlg.o stdafx.o       AuthTest.d AuthTestDlg.d
stdafx.d   Auth.exe
Building file: ../AuthTest.cpp
g++ -O3 -Wall -fpreprocessed -M -v -oAuthTest.o ../AuthTest.cpp
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls
--without-included-gettext --enable-libgcj --with-system-zlib
--enable-interpreter --enable-threads=posix --enable-java-gc=boehm
--enable-sjlj-exceptions --disable-version-specific-runtime-libs
--disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/cc1plus.exe -E -D__GNUG__=3 -quiet -v -M
-D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -D__CYGWIN32__
-D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../include/w32api -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/lib/../../include/w32api
../AuthTest.cpp -oAuthTest.o -Wall -fpreprocessed -O3
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/i686-pc-cygwin/include"
ignoring duplicate directory "/usr/i686-pc-cygwin/lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/3.3.3
 /usr/include/c++/3.3.3/i686-pc-cygwin
 /usr/include/c++/3.3.3/backward
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/include
 /usr/include
 /usr/include/w32api
End of search list.
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls
--without-included-gettext --enable-libgcj --with-system-zlib
--enable-interpreter --enable-threads=posix --enable-java-gc=boehm
--enable-sjlj-exceptions --disable-version-specific-runtime-libs
--disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/cc1plus.exe -E -D__GNUG__=3 -quiet -v -P
-M -MM -MG -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3
-D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../include/w32api -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/lib/../../include/w32api
../AuthTest.cpp -Wall -w -fpreprocessed -O3
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/i686-pc-cygwin/include"
ignoring duplicate directory "/usr/i686-pc-cygwin/lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/3.3.3
 /usr/include/c++/3.3.3/i686-pc-cygwin
 /usr/include/c++/3.3.3/backward
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/include
 /usr/include
 /usr/include/w32api
End of search list.
Finished building: ../AuthTest.cpp
 
Building file: ../AuthTestDlg.cpp
g++ -O3 -Wall -fpreprocessed -M -v -oAuthTestDlg.o ../AuthTestDlg.cpp
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls
--without-included-gettext --enable-libgcj --with-system-zlib
--enable-interpreter --enable-threads=posix --enable-java-gc=boehm
--enable-sjlj-exceptions --disable-version-specific-runtime-libs
--disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/cc1plus.exe -E -D__GNUG__=3 -quiet -v -M
-D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -D__CYGWIN32__
-D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../include/w32api -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/lib/../../include/w32api
../AuthTestDlg.cpp -oAuthTestDlg.o -Wall -fpreprocessed -O3
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/i686-pc-cygwin/include"
ignoring duplicate directory "/usr/i686-pc-cygwin/lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/3.3.3
 /usr/include/c++/3.3.3/i686-pc-cygwin
 /usr/include/c++/3.3.3/backward
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/include
 /usr/include
 /usr/include/w32api
End of search list.
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls
--without-included-gettext --enable-libgcj --with-system-zlib
--enable-interpreter --enable-threads=posix --enable-java-gc=boehm
--enable-sjlj-exceptions --disable-version-specific-runtime-libs
--disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/cc1plus.exe -E -D__GNUG__=3 -quiet -v -P
-M -MM -MG -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3
-D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../include/w32api -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/lib/../../include/w32api
../AuthTestDlg.cpp -Wall -w -fpreprocessed -O3
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/i686-pc-cygwin/include"
ignoring duplicate directory "/usr/i686-pc-cygwin/lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/3.3.3
 /usr/include/c++/3.3.3/i686-pc-cygwin
 /usr/include/c++/3.3.3/backward
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/include
 /usr/include
 /usr/include/w32api
End of search list.
Finished building: ../AuthTestDlg.cpp
 
Building file: ../stdafx.cpp
g++ -O3 -Wall -fpreprocessed -M -v -ostdafx.o ../stdafx.cpp
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls
--without-included-gettext --enable-libgcj --with-system-zlib
--enable-interpreter --enable-threads=posix --enable-java-gc=boehm
--enable-sjlj-exceptions --disable-version-specific-runtime-libs
--disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/cc1plus.exe -E -D__GNUG__=3 -quiet -v -M
-D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -D__CYGWIN32__
-D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../include/w32api -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/lib/../../include/w32api
../stdafx.cpp -ostdafx.o -Wall -fpreprocessed -O3
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/i686-pc-cygwin/include"
ignoring duplicate directory "/usr/i686-pc-cygwin/lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/3.3.3
 /usr/include/c++/3.3.3/i686-pc-cygwin
 /usr/include/c++/3.3.3/backward
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/include
 /usr/include
 /usr/include/w32api
End of search list.
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls
--without-included-gettext --enable-libgcj --with-system-zlib
--enable-interpreter --enable-threads=posix --enable-java-gc=boehm
--enable-sjlj-exceptions --disable-version-specific-runtime-libs
--disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/cc1plus.exe -E -D__GNUG__=3 -quiet -v -P
-M -MM -MG -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3
-D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../include/w32api -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/lib/../../include/w32api
../stdafx.cpp -Wall -w -fpreprocessed -O3
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/i686-pc-cygwin/include"
ignoring duplicate directory "/usr/i686-pc-cygwin/lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/3.3.3
 /usr/include/c++/3.3.3/i686-pc-cygwin
 /usr/include/c++/3.3.3/backward
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/include
 /usr/include
 /usr/include/w32api
End of search list.
Finished building: ../stdafx.cpp
 
Building target: Auth.exe
g++ -v -o Auth.exe     AuthTest.o AuthTestDlg.o stdafx.o    
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls
--without-included-gettext --enable-libgcj --with-system-zlib
--enable-interpreter --enable-threads=posix --enable-java-gc=boehm
--enable-sjlj-exceptions --disable-version-specific-runtime-libs
--disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/collect2.exe -Bdynamic
--dll-search-prefix=cyg -o Auth.exe
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../crt0.o
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/crtbegin.o
-L/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3
-L/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../.. AuthTest.o AuthTestDlg.o
stdafx.o -lstdc++ -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/crtend.o
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/bin/ld:AuthTest.o:
file format not recognized; treating as linker script
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/bin/ld:AuthTest.o:1:
syntax error
collect2: ld returned 1 exit status
make: *** [Auth.exe] Error 1
make: Target `all' not remade because of errors.
Build complete for project Auth


------- Additional Comment #1 From Andrew Pinski 2005-01-05 21:56 [reply] -------

This is not a gcc bug, either this is your bug and the .o file is not an object
file or this is a binutils bug.


------- Additional Comment #2 From Jeff 2005-01-06 15:33 [reply] -------

(In reply to comment #1)
> This is not a gcc bug, either this is your bug and the .o file is not an
object file or this is a binutils bug.

Andrew, then perhaps you can explain why the exact same code compiles, links and
runs fine in a Microsoft environment?  So the only thing that has changed is I
am using GCC....  Hmmmmm..


------- Additional Comment #3 From Andrew Pinski 2005-01-06 15:42 [reply] -------

(In reply to comment #2)
> (In reply to comment #1)
> > This is not a gcc bug, either this is your bug and the .o file is not an
> object file or this is a binutils bug.
> 
> Andrew, then perhaps you can explain why the exact same code compiles, links and
> runs fine in a Microsoft environment?  So the only thing that has changed is I
> am using GCC....  Hmmmmm..

But GCC is only the compiler, not the assembler and linker, report this to the
binutils project, <http://
sourceware.org/bugzilla/> which controls both the assembler and the linker, yes
this is confusing but 
correct.
Comment 1 Nick Clifton 2005-01-06 17:21:21 UTC
Hi Jeff,

  I think that the problem is the command line that you are using to compile
your object files.  For example:

  g++ -O3 -Wall -fpreprocessed -M -v -oAuthTest.o ../AuthTest.cpp

This will create an *executable* file called "AuthTest.o" and not a object file.

Alternatively if the "-c" switch is being specified somewhere and it is just not
visible in the output you attached, then can you the AuthTest.o file ?  How big
is it ?  If you run "file" on it, what output do you get ?

Ideally in order to debug this problem we need a small test program and makefile
or list of commands.

Cheers
  Nick
Comment 2 Jeff 2005-01-10 17:20:52 UTC
(In reply to comment #1)
> Hi Jeff,
> 
>   I think that the problem is the command line that you are using to compile
> your object files.  For example:
> 
>   g++ -O3 -Wall -fpreprocessed -M -v -oAuthTest.o ../AuthTest.cpp
> 
> This will create an *executable* file called "AuthTest.o" and not a object file.
> 
> Alternatively if the "-c" switch is being specified somewhere and it is just not
> visible in the output you attached, then can you the AuthTest.o file ?  How big
> is it ?  If you run "file" on it, what output do you get ?
> 
> Ideally in order to debug this problem we need a small test program and makefile
> or list of commands.
> 
> Cheers
>   Nick
> 

Nick, 

I tried it with -c same result.  Also, when I ran file on it it says ASCII text.

Here are the messages

**** Full rebuild of configuration Release for project Auth ****

make -k clean all 
rm -rf     AuthTest.o AuthTestDlg.o stdafx.o       AuthTest.d AuthTestDlg.d
stdafx.d   Auth.exe
Building file: ../AuthTest.cpp
g++ -O3 -Wall -c -fpreprocessed -M -v -oAuthTest.o ../AuthTest.cpp
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls
--without-included-gettext --enable-libgcj --with-system-zlib
--enable-interpreter --enable-threads=posix --enable-java-gc=boehm
--enable-sjlj-exceptions --disable-version-specific-runtime-libs
--disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/cc1plus.exe -E -D__GNUG__=3 -quiet -v -M
-D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -D__CYGWIN32__
-D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../include/w32api -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/lib/../../include/w32api
../AuthTest.cpp -oAuthTest.o -Wall -fpreprocessed -O3
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/i686-pc-cygwin/include"
ignoring duplicate directory "/usr/i686-pc-cygwin/lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/3.3.3
 /usr/include/c++/3.3.3/i686-pc-cygwin
 /usr/include/c++/3.3.3/backward
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/include
 /usr/include
 /usr/include/w32api
End of search list.
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls
--without-included-gettext --enable-libgcj --with-system-zlib
--enable-interpreter --enable-threads=posix --enable-java-gc=boehm
--enable-sjlj-exceptions --disable-version-specific-runtime-libs
--disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/cc1plus.exe -E -D__GNUG__=3 -quiet -v -P
-M -MM -MG -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3
-D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../include/w32api -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/lib/../../include/w32api
../AuthTest.cpp -Wall -w -fpreprocessed -O3
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/i686-pc-cygwin/include"
ignoring duplicate directory "/usr/i686-pc-cygwin/lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/3.3.3
 /usr/include/c++/3.3.3/i686-pc-cygwin
 /usr/include/c++/3.3.3/backward
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/include
 /usr/include
 /usr/include/w32api
End of search list.
Finished building: ../AuthTest.cpp
 
Building file: ../AuthTestDlg.cpp
g++ -O3 -Wall -c -fpreprocessed -M -v -oAuthTestDlg.o ../AuthTestDlg.cpp
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls
--without-included-gettext --enable-libgcj --with-system-zlib
--enable-interpreter --enable-threads=posix --enable-java-gc=boehm
--enable-sjlj-exceptions --disable-version-specific-runtime-libs
--disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/cc1plus.exe -E -D__GNUG__=3 -quiet -v -M
-D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -D__CYGWIN32__
-D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../include/w32api -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/lib/../../include/w32api
../AuthTestDlg.cpp -oAuthTestDlg.o -Wall -fpreprocessed -O3
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/i686-pc-cygwin/include"
ignoring duplicate directory "/usr/i686-pc-cygwin/lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/3.3.3
 /usr/include/c++/3.3.3/i686-pc-cygwin
 /usr/include/c++/3.3.3/backward
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/include
 /usr/include
 /usr/include/w32api
End of search list.
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls
--without-included-gettext --enable-libgcj --with-system-zlib
--enable-interpreter --enable-threads=posix --enable-java-gc=boehm
--enable-sjlj-exceptions --disable-version-specific-runtime-libs
--disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/cc1plus.exe -E -D__GNUG__=3 -quiet -v -P
-M -MM -MG -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3
-D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../include/w32api -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/lib/../../include/w32api
../AuthTestDlg.cpp -Wall -w -fpreprocessed -O3
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/i686-pc-cygwin/include"
ignoring duplicate directory "/usr/i686-pc-cygwin/lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/3.3.3
 /usr/include/c++/3.3.3/i686-pc-cygwin
 /usr/include/c++/3.3.3/backward
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/include
 /usr/include
 /usr/include/w32api
End of search list.
Finished building: ../AuthTestDlg.cpp
 
Building file: ../stdafx.cpp
g++ -O3 -Wall -c -fpreprocessed -M -v -ostdafx.o ../stdafx.cpp
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls
--without-included-gettext --enable-libgcj --with-system-zlib
--enable-interpreter --enable-threads=posix --enable-java-gc=boehm
--enable-sjlj-exceptions --disable-version-specific-runtime-libs
--disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/cc1plus.exe -E -D__GNUG__=3 -quiet -v -M
-D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -D__CYGWIN32__
-D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../include/w32api -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/lib/../../include/w32api
../stdafx.cpp -ostdafx.o -Wall -fpreprocessed -O3
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/i686-pc-cygwin/include"
ignoring duplicate directory "/usr/i686-pc-cygwin/lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/3.3.3
 /usr/include/c++/3.3.3/i686-pc-cygwin
 /usr/include/c++/3.3.3/backward
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/include
 /usr/include
 /usr/include/w32api
End of search list.
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls
--without-included-gettext --enable-libgcj --with-system-zlib
--enable-interpreter --enable-threads=posix --enable-java-gc=boehm
--enable-sjlj-exceptions --disable-version-specific-runtime-libs
--disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/cc1plus.exe -E -D__GNUG__=3 -quiet -v -P
-M -MM -MG -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3
-D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../include/w32api -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/lib/../../include/w32api
../stdafx.cpp -Wall -w -fpreprocessed -O3
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/i686-pc-cygwin/include"
ignoring duplicate directory "/usr/i686-pc-cygwin/lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/3.3.3
 /usr/include/c++/3.3.3/i686-pc-cygwin
 /usr/include/c++/3.3.3/backward
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/include
 /usr/include
 /usr/include/w32api
End of search list.
Finished building: ../stdafx.cpp
 
Building target: Auth.exe
g++ -v -o Auth.exe     AuthTest.o AuthTestDlg.o stdafx.o    
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls
--without-included-gettext --enable-libgcj --with-system-zlib
--enable-interpreter --enable-threads=posix --enable-java-gc=boehm
--enable-sjlj-exceptions --disable-version-specific-runtime-libs
--disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/collect2.exe -Bdynamic
--dll-search-prefix=cyg -o Auth.exe
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../crt0.o
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/crtbegin.o
-L/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3
-L/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../.. AuthTest.o AuthTestDlg.o
stdafx.o -lstdc++ -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/crtend.o
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/bin/ld:AuthTest.o:
file format not recognized; treating as linker script
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/bin/ld:AuthTest.o:1:
syntax error
collect2: ld returned 1 exit status
make: *** [Auth.exe] Error 1
make: Target `all' not remade because of errors.
Build complete for project Auth
Comment 3 Nick Clifton 2005-01-10 17:57:07 UTC
Subject: Re:  file format not recognized; treating as linker script

Hi Jeff,

> I tried it with -c same result.  Also, when I ran file on it it says ASCII text.

Hmm, what size is the file ?

> Here are the messages
> 
> **** Full rebuild of configuration Release for project Auth ****
Note - I would strongly suggest that you halt the build process after 
the creation of the first object file.  Things have definitely gone 
wrong by this point.  We are not looking at a linker bug, we are looking 
at a gcc bug or possibly a gas bug.

There appears to be something very odd going on when an object file is 
built:


> g++ -O3 -Wall -c -fpreprocessed -M -v -oAuthTest.o ../AuthTest.cpp

So G++ is invoked on AuthTest.cpp.  I assume that the "-fpreprocessed" 
switch is correct and that this source file has already been pre-processed ?

> Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
> Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr
> --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib
> --mandir=/usr/share/man --infodir=/usr/share/info
> --enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls
> --without-included-gettext --enable-libgcj --with-system-zlib
> --enable-interpreter --enable-threads=posix --enable-java-gc=boehm
> --enable-sjlj-exceptions --disable-version-specific-runtime-libs
> --disable-win32-registry
> Thread model: posix
> gcc version 3.3.3 (cygwin special)
>  /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/cc1plus.exe -E -D__GNUG__=3 -quiet -v -M
> -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -D__CYGWIN32__
> -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter
> /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../include/w32api -idirafter
> /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/lib/../../include/w32api
> ../AuthTest.cpp -oAuthTest.o -Wall -fpreprocessed -O3

So cc1plus.exe is run once...

> ignoring nonexistent directory "/usr/local/include"
> ignoring nonexistent directory "/usr/i686-pc-cygwin/include"
> ignoring duplicate directory "/usr/i686-pc-cygwin/lib/../../include/w32api"
> #include "..." search starts here:
> #include <...> search starts here:
>  /usr/include/c++/3.3.3
>  /usr/include/c++/3.3.3/i686-pc-cygwin
>  /usr/include/c++/3.3.3/backward
>  /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/include
>  /usr/include
>  /usr/include/w32api
> End of search list.
> Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
> Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr
> --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib
> --mandir=/usr/share/man --infodir=/usr/share/info
> --enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls
> --without-included-gettext --enable-libgcj --with-system-zlib
> --enable-interpreter --enable-threads=posix --enable-java-gc=boehm
> --enable-sjlj-exceptions --disable-version-specific-runtime-libs
> --disable-win32-registry
> Thread model: posix
> gcc version 3.3.3 (cygwin special)
>  /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/cc1plus.exe -E -D__GNUG__=3 -quiet -v -P
> -M -MM -MG -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3
> -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter
> /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../include/w32api -idirafter
> /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/lib/../../include/w32api
> ../AuthTest.cpp -Wall -w -fpreprocessed -O3

... and then it is run again with the -o switch missing ?  Why ?

> ignoring nonexistent directory "/usr/local/include"
> ignoring nonexistent directory "/usr/i686-pc-cygwin/include"
> ignoring duplicate directory "/usr/i686-pc-cygwin/lib/../../include/w32api"
> #include "..." search starts here:
> #include <...> search starts here:
>  /usr/include/c++/3.3.3
>  /usr/include/c++/3.3.3/i686-pc-cygwin
>  /usr/include/c++/3.3.3/backward
>  /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/include
>  /usr/include
>  /usr/include/w32api
> End of search list.
> Finished building: ../AuthTest.cpp

... and yet GAS has not been invoked to turn the assembler output of the 
cc1plus.exe program into an object file.

Perhaps ... the g++ driver program is picking the wrong executable to 
use to convert assembler into binary ?

Cheers
   Nick

Comment 4 Jeff 2005-01-10 18:42:11 UTC
Nick,

Thanks, I believe you are correct. It has Something to do with either
-fpreprocessed  and/or the -M switch.  Which I need for the MS code to find
things and compile.

Back to gcc for now.
Comment 5 Ben Elliston 2006-03-28 00:57:06 UTC
The problem here is that you are using the -M option to GCC.  I don't know what
this option's meaning is for Microsoft's compiler, but for GCC, it means:

`-M'
     Instead of outputting the result of preprocessing, output a rule
     suitable for `make' describing the dependencies of the main source
     file.  The preprocessor outputs one `make' rule containing the
     object file name for that source file, a colon, and the names of
     all the included files, including those coming from `-include' or
     `-imacros' command line options.

Closing.