delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/10/26/18:58:57

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=0.9 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE,TW_NX
X-Spam-Check-By: sourceware.org
X-Yahoo-SMTP: Uu383n6swBCEN1G9up0WSnxbvN8fCPmk
Message-ID: <4CC75D1F.3040001@cygwin.com>
Date: Tue, 26 Oct 2010 18:58:39 -0400
From: "Larry Hall \(Cygwin\)" <reply-to-list-only-lh AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.21) Gecko/20090320 Remi/2.0.0.21-1.fc8.remi Lightning/0.9 Thunderbird/2.0.0.21 Mnenhy/0.7.5.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: side effects after installing gcc-3.4.4.999
References: <gofr4i$s1t$1 AT ger DOT gmane DOT org> <30001579 DOT post AT talk DOT nabble DOT com>
In-Reply-To: <30001579.post@talk.nabble.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 10/19/2010 11:47 AM, Afflictedd2 wrote:
> Akakima wrote:
>>
>> After updating gcc in my cygwin installation, i discovered
>> that i cannot run gcc.exe from the native winxp console (cmd.exe).
>>
>> gcc.exe has been replaced by gcc-3.exe.
>>
>> Of course, this works fine under bash and ash, but it does not work
>> anymore
>> under cmd.exe.
>>
>> since i prefer to work under cmd.exe. i tried to fix this problem by:
>> adding .LNK to PATHEXT
>> and adding /usr/bin/alternatives to the PATH
>>
>> and now if i type "gcc", cmd finds gcc-3.exe and launch it.
>> But, this is not perfect. gcc (or someone else) wait until i press
>> enter to continue.
>>
>> Anybody knows a better solution ?
>
> I've got a simple solution  that I am not sure if it has been mentioned here.
> take the link g++, and rename it g++.bak
> and make a copy of the g++ you want to use g++-3 or 4
> and rename it g++
>
> No more access denied problem.

Better solutions than what you found are:

  o Invoke g++-3, gcc-3, g++-4, or gcc-4 directly.  These are executables
    and work fine from the command prompt.
  o Create g++.bat and gcc.bat that call your preferred executable.

These are better options than the one you found because they protect the
integrity and structure of the package.  Upgrades will not have leftover
".bak" files from earlier versions and so on.  Also, your approach interferes
with the use of 'alternatives' to select the compiler version you want.  This
is made convenient by 2 scripts, set-gcc-default-3.sh and set-gcc-default-4.sh.
This mechanism is the reason that gcc, g++, gcj, and gnat are symbolic links
now rather than executables.

-- 
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?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019