gcc: installation problem, cannot exec 'cc1'
Hello, This is my first post here. I recently installed Cygwin again after my harddisk crashed and had to be formatted and all. I mainly use an ELF cross compiler for doing OS dev. So it was when I tried to compile a simple app using the normal GCC that I ran into this error. $ gcc -mno-cygwin -o hello hello.c gcc: installation problem, cannot exec 'cc1': No such file or directory I see that it occurs only when I use the -mno-cygwin option. I searched google. I found I have to install gcc-mingw package. I installed it. But the problem still prevails. I also see that there is no /usr/lib/gcc-lib directory. I found cc1.exe in the /lib/gcc/i686-pc-cygwin/3.4.4 directory. I tried adding that to the PATH. But then I get the error. ld: crt2.o: No such file: No such file or directory I have also tried reinstalling those packages (gcc, binutils etc.) . But it still doesnt work. I am also attaching the output of cygcheck -r -s -v , in case it helps. Please help. Thanks, Thomas Cygwin Configuration Diagnostics Current System Time: Thu Jan 11 22:35:02 2007 Windows XP Professional Ver 5.1 Build 2600 Service Pack 2 Path: C:\cygwin\lib\gcc\i686-pc-cygwin\3.4.4 C:\cygwin\usr\local\bin C:\cygwin\bin C:\cygwin\bin C:\cygwin\usr\X11R6\bin C:\cygwin\usr\cross\bin c:\WINDOWS\system32 c:\WINDOWS c:\WINDOWS\System32\Wbem c:\Program Files\ATI Technologies\ATI.ACE\ c:\MySQL\bin Output from C:\cygwin\bin\id.exe (nontsec) UID: 1003(Tom) GID: 513(None) 0(root) 513(None) 544(Administrators) 545(Users) Output from C:\cygwin\bin\id.exe (ntsec) UID: 1003(Tom) GID: 513(None) 0(root) 513(None) 544(Administrators) 545(Users) SysDir: C:\WINDOWS\system32 WinDir: C:\WINDOWS USER = 'Tom' PWD = '/home/Tom' HOME = '/home/Tom' MAKE_MODE = 'unix' HOMEPATH = '\Documents and Settings\Tom' MANPATH = '/usr/local/man:/usr/share/man:/usr/man::/usr/ssl/man' APPDATA = 'C:\Documents and Settings\Tom\Application Data' HOSTNAME = 'toms-pc' TERM = 'cygwin' PROCESSOR_IDENTIFIER = 'x86 Family 15 Model 4 Stepping 7, GenuineIntel' WINDIR = 'C:\WINDOWS' OLDPWD = '/usr/bin' USERDOMAIN = 'TOMS-PC' OS = 'Windows_NT' ALLUSERSPROFILE = 'C:\Documents and Settings\All Users' !:: = '::\' TEMP = '/cygdrive/c/DOCUME~1/Tom/LOCALS~1/Temp' COMMONPROGRAMFILES = 'C:\Program Files\Common Files' USERNAME = 'Tom' PROCESSOR_LEVEL = '15' FP_NO_HOST_CHECK = 'NO' SYSTEMDRIVE = 'C:' USERPROFILE = 'C:\Documents and Settings\Tom' CLIENTNAME = 'Console' PS1 = '\[\e]0;[EMAIL PROTECTED] \[\e[33m\]\w\[\e[0m\]\n\$ ' LOGONSERVER = '\\TOMS-PC' PROCESSOR_ARCHITECTURE = 'x86' !C: = 'C:\cygwin\bin' SHLVL = '1' PATHEXT = '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH' HOMEDRIVE = 'C:' PROMPT = '$P$G' COMSPEC = 'C:\WINDOWS\system32\cmd.exe' TMP = '/cygdrive/c/DOCUME~1/Tom/LOCALS~1/Temp' SYSTEMROOT = 'C:\WINDOWS' PRINTER = 'EPSON Stylus C45 Series' CVS_RSH = '/bin/ssh' PROCESSOR_REVISION = '0407' INFOPATH = '/usr/local/info:/usr/share/info:/usr/info:' PROGRAMFILES = 'C:\Program Files' NUMBER_OF_PROCESSORS = '2' SESSIONNAME = 'Console' COMPUTERNAME = 'TOMS-PC' _ = '/usr/bin/cygcheck' POSIXLY_CORRECT = '1' HKEY_CURRENT_USER\Software\Cygnus Solutions HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2 HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2 (default) = '/cygdrive' cygdrive flags = 0x0022 HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/ (default) = 'C:\cygwin' flags = 0x000a HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin (default) = 'C:\cygwin/bin' flags = 0x000a HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib (default) = 'C:\cygwin/lib' flags = 0x000a HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options c: hd NTFS 15358Mb 63% CP CS UN PA FC d: hd NTFS 15358Mb 88% CP CS UN PA FC e: hd FAT3230702Mb 92% CPUN f: hd NTFS 51199Mb 99% CP CS UN PA FC Local Disk g: hd NTFS 51199Mb 91% CP CS UN PA FC h: hd NTFS 20481Mb 41% CP CS UN PA FC i: cd N/AN/A j: cd CDFS 632Mb 100%CS UN AURACD2 k: cd CDFS 525Mb 100%CS UN RTMI_CD1 C:\cygwin / system binmode C:\cygwin/bin /usr/bin system binmode C:\cygwin/lib /usr/lib system binmode . /cygdrive system binmode,cygdrive Found: C:\cygwin\bin\awk.exe Found: C:\cygwin\bin\bash.exe Found: C:\cygwin\bin\cat.exe Found: C:\cygwin\bin\cp.exe Found: C:\cygwin\bin\cpp.exe Not Found: crontab Found: C:\cygwin\bin\find.exe Found: C:\cygwin\bin\gcc.exe Not Found: gdb Found: C:\cygwin\bin
Re: gcc: installation problem, cannot exec 'cc1'
Hello, It still doesnt work. I reinstalled all the GCC and GCC-mingw packages. The cc1.exe is present. But it still doesnt work. Here is output of ls -l /usr/lib/gcc/i686-pc-mingw32/3.4.4/ $ ls -l /usr/lib/gcc/i686-pc-mingw32/3.4.4/ total 1234 -rwxr-xr--+ 1 Tom Users 547 Jan 6 20:44 cc1.exe.lnk -rwxr-xr--+ 1 Tom Users 567 Jan 6 20:44 cc1plus.exe.lnk -rwxr-xr--+ 1 Tom Users 573 Jan 6 20:44 collect2.exe.lnk -rwx--+ 1 Tom None 412 May 24 2005 crtbegin.o -rwx--+ 1 Tom None 492 May 24 2005 crtend.o drwxrwxr--+ 2 Tom Users 0 Jan 12 08:18 debug drwxrwxr--+ 3 Tom Users 0 Jan 12 08:18 include drwxrwxr--+ 3 Tom Users 0 Jan 12 08:18 install-tools -rwx--+ 1 Tom None52594 May 24 2005 libgcc.a -rwx--+ 1 Tom None 9772 May 24 2005 libgcov.a -rwx--+ 1 Tom None 1063604 May 24 2005 libstdc++.a -rwx--+ 1 Tom None 685 May 24 2005 libstdc++.la -rwx--+ 1 Tom None 116074 May 24 2005 libsupc++.a -rwx--+ 1 Tom None 685 May 24 2005 libsupc++.la -rwxr-xr--+ 1 Tom Users 537 Jan 6 20:44 specs.lnk And here is the output of the second one: $ ls -l /etc/postinstall/gcc* -rwxr-x---+ 1 Tom Users 69347 Jun 4 2005 /etc/postinstall/gcc-mingw-core-3.4 .4-20050522-1.tgz -rwxr-x---+ 1 Tom Users 787 Jun 4 2005 /etc/postinstall/gcc-mingw-core.sh. done -rwxr-x---+ 1 Tom Users 1964271 Jun 4 2005 /etc/postinstall/gcc-mingw-g++-3.4. 4-20050522-1.tgz -rwxr-x---+ 1 Tom Users 783 Jun 4 2005 /etc/postinstall/gcc-mingw-g++.sh.d one -rwxr-x---+ 1 Tom Users 783 Jun 9 2005 /etc/postinstall/gcc-mingw-g77.sh.d one I ran the cc1.exe link from windows. It gave me error that cygwin1.dll couldnt be found. But on adding the Cygwin/bin directory to the PATH (in windows), removed that error and CC1.exe shows a blank console window. But the error while compiling still persists. Maybe I should backup my stuff and try a new install. ~ Thomas On 1/11/07, Brian Dessent <[EMAIL PROTECTED]> wrote: Don't do that. It's not necessary and won't help. When you specify -mno-cygwin you switch to using MinGW's version of gcc, an entirely separate version of gcc that is installed alongside the Cygwin version. This is why you must install the gcc-mingw-* packages for this to work. Incidently, I don't understand how you managed to at first install gcc-core but *not* gcc-mingw-core, since gcc-core lists gcc-mingw-core as a prerequisite in the setup.ini file (and so on for the other languages), so selecting one should have selected the other, and breaking this dependancy should have given you a big fat warning message. The cc1 that it is looking for when you use -mno-cygwin should be /usr/lib/gcc/i686-pc-mingw32/3.4.4/cc1.exe. What does "ls -l /usr/lib/gcc/i686-pc-mingw32/3.4.4/" show? Did you have any problems running the postinstall scripts? Do you have any that are not renamed .done? What does "ls -l /etc/postinstall/gcc*" show? > ld: crt2.o: No such file: No such file or directory This is part of mingw-runtime, and should be present in /usr/lib/mingw. Brian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: gcc: installation problem, cannot exec 'cc1'
Hello, Come to think of it, I had removed the read only stuff when it drove me nuts with silly errors when I tried to delete or move files. But not on C drive. Anyway, I removed those links using the script you said and reinstalled. Now ls lists them correctly $ ls -l /usr/lib/gcc/i686-pc-mingw32/3.4.4/ total 1234 lrwxrwxrwx 1 Tom None 34 Jan 12 09:34 cc1.exe -> ../../i686-pc-cygwin/3.4 .4/cc1.exe lrwxrwxrwx 1 Tom None 38 Jan 12 09:32 cc1plus.exe -> ../../i686-pc-cygwin /3.4.4/cc1plus.exe lrwxrwxrwx 1 Tom None 39 Jan 12 09:34 collect2.exe -> ../../i686-pc-cygwi n/3.4.4/collect2.exe -rwxr-xr-x 1 Tom None 412 May 24 2005 crtbegin.o -rwxr-xr-x 1 Tom None 492 May 24 2005 crtend.o drwxrwxr--+ 2 Tom Users 0 Jan 12 09:32 debug drwxrwxr--+ 3 Tom Users 0 Jan 12 09:34 include drwxrwxr--+ 3 Tom Users 0 Jan 12 09:34 install-tools -rwxr-xr-x 1 Tom None52594 May 24 2005 libgcc.a -rwxr-xr-x 1 Tom None 9772 May 24 2005 libgcov.a -rwx--+ 1 Tom None 1063604 May 24 2005 libstdc++.a -rwx--+ 1 Tom None 685 May 24 2005 libstdc++.la -rwx--+ 1 Tom None 116074 May 24 2005 libsupc++.a -rwx--+ 1 Tom None 685 May 24 2005 libsupc++.la lrwxrwxrwx 1 Tom None 32 Jan 12 09:34 specs -> ../../i686-pc-cygwin/3.4.4 /specs But now, while compiling I get the error $ gcc -mno-cygwin -o hello hello.c /usr/bin/ld: crt2.o: No such file: No such file or directory collect2: ld returned 1 exit status ?? Now what? ~ Thomas On 1/12/07, Dave Korn <[EMAIL PROTECTED]> wrote: On 12 January 2007 03:17, Larry Hall (Cygwin) wrote: > All your links have been incorrectly created or you're not using Cygwin's > "ls". Or he used windows explorer to recursively adjust the file attributes for the whole tree, perhaps in an attempt to turn off the R/O flag. That turns link files into .lnk files automanglicly. This /might/ just help: cd /usr/lib/gcc/i686-pc-mingw32/3.4.4/ attrib +R '*.lnk' cheers, DaveK -- Can't think of a witty .sigline today -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: gcc: installation problem, cannot exec 'cc1'
Hello, The file crt2.o is present in /usr/lib/mingw. But the error remains the same. [EMAIL PROTECTED] ~ $ gcc -mno-cygwin hello.c /usr/bin/ld: crt2.o: No such file: No such file or directory collect2: ld returned 1 exit status I also found that I get another error if I compile the program from within the directory /usr/lib/mingw .See this: [EMAIL PROTECTED] /usr/lib/mingw $ gcc -mno-cygwin ~/hello.c /usr/bin/ld: cannot find -lmingw32 collect2: ld returned 1 exit status ~ Thomas On 1/12/07, Larry Hall (Cygwin) <[EMAIL PROTECTED]> wrote: Thomas Antony wrote: > Hello, >Come to think of it, I had removed the read only stuff when it > drove me nuts with silly errors when I tried to delete or move files. > But not on C drive. Anyway, I removed those links using the script you > said and reinstalled. Now ls lists them correctly > > $ ls -l /usr/lib/gcc/i686-pc-mingw32/3.4.4/ > total 1234 > lrwxrwxrwx 1 Tom None 34 Jan 12 09:34 cc1.exe -> > ../../i686-pc-cygwin/3.4 > .4/cc1.exe > lrwxrwxrwx 1 Tom None 38 Jan 12 09:32 cc1plus.exe -> > ../../i686-pc-cygwin > /3.4.4/cc1plus.exe > lrwxrwxrwx 1 Tom None 39 Jan 12 09:34 collect2.exe -> > ../../i686-pc-cygwi > n/3.4.4/collect2.exe > -rwxr-xr-x 1 Tom None 412 May 24 2005 crtbegin.o > -rwxr-xr-x 1 Tom None 492 May 24 2005 crtend.o > drwxrwxr--+ 2 Tom Users 0 Jan 12 09:32 debug > drwxrwxr--+ 3 Tom Users 0 Jan 12 09:34 include > drwxrwxr--+ 3 Tom Users 0 Jan 12 09:34 install-tools > -rwxr-xr-x 1 Tom None52594 May 24 2005 libgcc.a > -rwxr-xr-x 1 Tom None 9772 May 24 2005 libgcov.a > -rwx--+ 1 Tom None 1063604 May 24 2005 libstdc++.a > -rwx--+ 1 Tom None 685 May 24 2005 libstdc++.la > -rwx--+ 1 Tom None 116074 May 24 2005 libsupc++.a > -rwx--+ 1 Tom None 685 May 24 2005 libsupc++.la > lrwxrwxrwx 1 Tom None 32 Jan 12 09:34 specs -> > ../../i686-pc-cygwin/3.4.4 > /specs > > But now, while compiling I get the error > $ gcc -mno-cygwin -o hello hello.c > /usr/bin/ld: crt2.o: No such file: No such file or directory > collect2: ld returned 1 exit status > > ?? > > Now what? > Is crt2.o in /usr/lib/mingw? Does it look OK? -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 216 Dalton Rd. (508) 893-9889 - FAX Holliston, MA 01746 _ A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting annoying in email? -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: gcc: installation problem, cannot exec 'cc1'
... Nop. [EMAIL PROTECTED] ~ $ grep 'gcc\|mingw\|w32api' a.txt b.txt a.txt:gcc 3.4.4-3OK a.txt:gcc-core 3.4.4-3OK a.txt:gcc-g++ 3.4.4-3OK a.txt:gcc-mingw20040810-1 OK a.txt:gcc-mingw-core 20050522-1 OK a.txt:gcc-mingw-g++20050522-1 OK a.txt:mingw-runtime3.11-1 OK a.txt:w32api 3.8-1 OK b.txt:gcc 3.4.4-3OK b.txt:gcc-core 3.4.4-3OK b.txt:gcc-g++ 3.4.4-3OK b.txt:gcc-mingw20040810-1 OK b.txt:gcc-mingw-core 20050522-1 OK b.txt:gcc-mingw-g++20050522-1 OK b.txt:mingw-runtime3.11-1 OK b.txt:w32api 3.8-1 OK I guess I am gonna have to reinstall the whole thing. ~ Thomas On 1/13/07, Dave Korn <[EMAIL PROTECTED]> wrote: On 13 January 2007 11:26, Thomas Antony wrote: > Hello, >The file crt2.o is present in /usr/lib/mingw. But the error remains > the same. > > [EMAIL PROTECTED] ~ > $ gcc -mno-cygwin hello.c > /usr/bin/ld: crt2.o: No such file: No such file or directory > collect2: ld returned 1 exit status > > I also found that I get another error if I compile the program from > within the directory /usr/lib/mingw .See this: > > [EMAIL PROTECTED] /usr/lib/mingw > $ gcc -mno-cygwin ~/hello.c > /usr/bin/ld: cannot find -lmingw32 > collect2: ld returned 1 exit status I think it's time to cut the gordian knot here. Somehow your installation has got thoroughly busted; we could be here all week trying to find and fix it one problem at a time. Re-run setup.exe. Use the "install from local package directory" option. Click straight through to the chooser page. Set the following packages to 'reinstall': gcc, gcc-core, any other installed language packages gcc-mingw, gcc-mingw-core, any other installed gcc-mingw languages mingw-runtime w32api It would be helpful if you could run "cygcheck -c >a.txt" before doing so, "cygcheck -c >b.txt" afterwards, and then show us the output of "grep 'gcc\|mingw\|w32api' a.txt b.txt". It would be good if we verify whether cygcheck spots these busted links and identifies them as a problem cheers, DaveK -- Can't think of a witty .sigline today -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/