[Bug c++/19281] New: file format not recognized; treating as linker script
--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 -- Summary: file format not recognized; treating as linker script Product: gcc Version: 3.3.3 Status: UNCONFIRMED Severity: critical Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jeff at connectrf dot com CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: Windows 2000, I686 GCC host triplet: Windows 2000, I686 GCC target triplet: Windows 2000, I686 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19281
[Bug c++/19281] file format not recognized; treating as linker script
--- Additional Comments From jeff at connectrf dot com 2005-01-06 15:33 --- (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 Hm.. -- What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19281
[Bug c++/19281] file format not recognized; treating as linker script
--- Additional Comments From jeff at connectrf dot com 2005-01-10 18:45 --- Andrew, A view from the ld folks. They believe that the ld is failing due to the -fpreprocessed switch not producing the .o file.. --- Additional Comments From nickc at redhat dot com 2005-01-10 17:57 --- 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. >> F
[Bug driver/19281] file format not recognized; treating as linker script
--- Additional Comments From jeff at connectrf dot com 2005-01-11 17:44 --- Andrew, What compiler option flag do I need to set for forward Declartions then? _M was taking care of those errors however it is not producing the .o? Is there a Crossrefrence of compiler options between MC VC++ and GCC? -- What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19281
[Bug driver/19281] file format not recognized; treating as linker script
--- Additional Comments From jeff at connectrf dot com 2005-01-11 19:24 --- Andrew, let me try again. BTW I have looked at the man pages for both gcc and ld, I must say they are clear as mud, but then most are. If I take the defaults, in CDT, I receive the errors attached below. If I add the options -fpreprocessed and -M as miscellaneous options, as I found in the man pages, the files compile without issue, but gcc does not create the proper object files for linking. So what gcc options would be required for forward declarations and standard #include's? Here is the makefile... # Automatically-generated file. Do not edit! ROOT := .. -include $(ROOT)/makefile.init RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include $(SUBDIRS:%=%/subdir.mk) -include objects.mk -include $(DEPS) -include $(ROOT)/makefile.defs all: Auth.exe Auth.exe: $(OBJS) @echo 'Building target: $@' g++ -o $@ $(OBJS) $(USER_OBJS) $(LIBS) @echo 'Finished building: $@' clean: -$(RM) $(OBJS) $(DEPS) Auth.exe .PHONY: all clean dependents -include $(ROOT)/makefile.targets 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++ -IC:\Documents and Settings\jeff\Desktop\AuthTest\include -O3 -Wall -c -fmessage-length=0 -oauthtest.o ../authtest.cpp In file included from ../authtest.cpp:4: ../AuthTest.h:4:9: warning: #pragma once is obsolete ../AuthTest.h:7:10: #error include 'stdafx.h' before including this file for PCH In file included from ../authtest.cpp:4: ../AuthTest.h:18: error: parse error before `{' token ../AuthTest.h:29: error: ISO C++ forbids declaration of `DECLARE_MESSAGE_MAP' with no type ../AuthTest.h: In function `int DECLARE_MESSAGE_MAP()': ../AuthTest.h:29: error: parse error before `}' token ../AuthTest.h:31:28: warning: no newline at end of file In file included from ../authtest.cpp:5: ../AuthTestDlg.h:9: error: parse error before `{' token ../AuthTestDlg.h:17: error: parse error before `protected' ../AuthTestDlg.h:26: error: syntax error before `(' token ../AuthTestDlg.h:27: error: syntax error before `void' ../AuthTestDlg.h:28: error: syntax error before `void' ../AuthTestDlg.h:29: error: parse error before `(' token ../AuthTestDlg.h:31: error: ISO C++ forbids declaration of `DECLARE_MESSAGE_MAP' with no type ../AuthTestDlg.h: In function `int DECLARE_MESSAGE_MAP()': ../AuthTestDlg.h:31: error: redefinition of `int DECLARE_MESSAGE_MAP()' ../AuthTest.h:29: error: `int DECLARE_MESSAGE_MAP()' previously defined here ../AuthTestDlg.h:31: error: redefinition of `int DECLARE_MESSAGE_MAP()' ../AuthTest.h:29: error: `int DECLARE_MESSAGE_MAP()' previously defined here ../AuthTestDlg.h:31: error: parse error before `public' ../AuthTestDlg.h:33: error: 'CString' is used as a type, but is not defined as a type. ../AuthTestDlg.h:35: error: 'CString' is used as a type, but is not defined as a type. ../AuthTestDlg.h:37: error: 'BOOL' is used as a type, but is not defined as a type. ../AuthTestDlg.h:41: error: 'BOOL' is used as a type, but is not defined as a type. ../AuthTestDlg.h:42: error: 'BOOL' is used as a type, but is not defined as a type. ../AuthTestDlg.h:43: error: syntax error before `void' ../AuthTestDlg.h:44: error: 'CString' is used as a type, but is not defined as a type. ../AuthTestDlg.h:45: error: parse error before `}' token ../authtest.cpp:14: error: type specifier omitted for parameter `CWinApp' ../authtest.cpp:15: error: ISO C++ forbids declaration of `BEGIN_MESSAGE_MAP' with no type ../authtest.cpp: In function `int BEGIN_MESSAGE_MAP(CAuthTestApp)': ../authtest.cpp:15: error: `' has incomplete type ../AuthTest.h:17: error: forward declaration of `class CAuthTestApp' ../authtest.cpp:15: error: parse error before `(' token ../authtest.cpp:15: error: `ID_HELP' undeclared (first use this function) ../authtest.cpp:15: error: (Each undeclared identifier is reported only once for each function it appears in.) ../authtest.cpp:15: error: `CWinApp' undeclared (first use this function) ../authtest.cpp:15: error: parse error before `::' token ../authtest.cpp:16: error: ISO C++ forbids declaration of `ON_COMMAND' with no type ../authtest.cpp: In function `int ON_COMMAND(...)': ../authtest.cpp:21: error: ISO C++ forbids declaration of `END_MESSAGE_MAP' with no type ../authtest.cpp: In function `int END_MESSAGE_MAP()': ../authtest.cpp:22: error: invalid
[Bug driver/19281] file format not recognized; treating as linker script
--- Additional Comments From jeff at connectrf dot com 2005-01-11 20:03 --- Andrew, If I take the exact same code, and compile it with VC++ it does not complain! However, gcc the ONLY thing that has changed, will not compile code that works! Why? Old wise one, must one rewrite entrie working applications just so gcc understands?? -- What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19281
[Bug driver/19281] file format not recognized; treating as linker script
--- Additional Comments From jeff at connectrf dot com 2005-01-11 20:23 --- Andrew, You are sure hard to convince... Where did the error go? 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++ -IC:\Documents and Settings\jeff\Desktop\AuthTest\include -O3 -Wall -c -fmessage-length=0 -fpreprocessed -M -oauthtest.o ../authtest.cpp Finished building: ../authtest.cpp Building file: ../authtestdlg.cpp g++ -IC:\Documents and Settings\jeff\Desktop\AuthTest\include -O3 -Wall -c -fmessage-length=0 -fpreprocessed -M -oauthtestdlg.o ../authtestdlg.cpp Finished building: ../authtestdlg.cpp Building file: ../stdafx.cpp g++ -IC:\Documents and Settings\jeff\Desktop\AuthTest\include -O3 -Wall -c -fmessage-length=0 -fpreprocessed -M -ostdafx.o ../stdafx.cpp Finished building: ../stdafx.cpp Building target: Auth.exe g++ -o Auth.exe authtest.o authtestdlg.o stdafx.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 -- What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19281
[Bug driver/19281] file format not recognized; treating as linker script
--- Additional Comments From jeff at connectrf dot com 2005-01-11 21:03 --- Well that makes sense.. Does anyone have an example of the compiler options to port from VC++ to GCC? A nice Crossreference table would be just dandy. -- What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|INVALID | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19281