delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/10/31/16:34:44

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
X-Authentication-Warning: eos.vss.fsi.com: ford owned process doing -bs
Date: Fri, 31 Oct 2003 15:34:13 -0600 (CST)
From: Brian Ford <ford AT vss DOT fsi DOT com>
X-X-Sender: ford AT eos
To: cygwin AT cygwin DOT com
cc: y2bismil AT engmail DOT uwaterloo DOT ca
Subject: Re: gcc and iostream - final issue
In-Reply-To: <1067629896.3fa2bd48db2e8@www.nexusmail.uwaterloo.ca>
Message-ID: <Pine.GSO.4.56.0310311515330.9896@eos>
References: <1067549281 DOT 3fa18261b9137 AT www DOT nexusmail DOT uwaterloo DOT ca>
<133687559107 DOT 20031031100848 AT familiehaase DOT de> <1067616628 DOT 3fa2897461121 AT www DOT nexusmail DOT uwaterloo DOT ca>
<1067617166 DOT 3fa28b8ecc072 AT www DOT nexusmail DOT uwaterloo DOT ca>
<1067622375 DOT 3fa29fe7e6898 AT www DOT nexusmail DOT uwaterloo DOT ca> <Pine DOT GSO DOT 4 DOT 56 DOT 0310311303170 DOT 9896 AT eos>
<1067629896 DOT 3fa2bd48db2e8 AT www DOT nexusmail DOT uwaterloo DOT ca>
MIME-Version: 1.0

On Fri, 31 Oct 2003 y2bismil AT engmail DOT uwaterloo DOT ca wrote:

> 1.  Putting libraries at the end has not helped
>
You must always do this.  This is the way linkers work.

> 2.  I'm using g++ only now in both compile and link stages...Just out of
> curiousity though, isn't gcc supposed to 'call' g++ internally based on
> the file extension?
>
I believe it does when compiling with the -c switch.  But, for linking,
you must use g++ as there is no file extension to base this on (.o).

> 3.  In terms of cygwin handling C:\ type paths.  It always seem to be able to,
> but I will try to fully qualify them with /cygdrive/c/...
>
Cygwin emulates Posix.  Posix does not understand C:\.  So, Cygwin's gcc
doesn't/shouldn't understand C:\.

> Just to clarify.  I'm using G++, but the code makes some use of the conio
> functions which need then be linked with the mingw libraries.  I figured that
> should only inlcude the mingw headers/libraries (including the stdc++ one),
> instead of the one provided in the other g++ dirs.  Hence the use the
> attempted uses of -nocygwin and -nostdinc++.
>
Just -mno-cygwin is sufficient.

> exact compilation line (bare in mind, its been through several iterations):
> *******************************************
> HdrPath
> +=$(BLDVOL)\Allegro\RP306\RomPager\Includes;$(BLDVOL)\Allegro\RP306\Engine\Includes;.\hdr
>
I don't know what kind of a make system you are using, but I don't
recognize any of that syntax.

> SysHdrPath +=C:\cygwin\usr\include\mingw;
> SysHdrPath +=C:\cygwin\usr\include\mingw\g++-3;
> SysHdrPath +=C:\cygwin\usr\include\mingw\sys
>
None of this is needed with -mno-cygwin and should not be used.

> g++
>  -c
> $(CC_FLAGS_386) $(CC_DBG_FLAG_386) $(CC_OPT_PCH) #bunch of -D..flags
> -D$(CC_DEFS_386,W -D)
> -I$(HdrPath:;= -I)

> -nostdinc++
> -isystem$(SysHdrPath:;= -isystem)
>
Don't do either of these.

> $(.SOURCE)
> *******************************************
>
> Linking (using clearcase make...so the %foreach turns out correctly)
> *******************************************
>
Ok, I don't know anything about how clearcase works.

> g++
>    -mno-cygwin  -g -o$(_Target)
>    -nostdinc++
>
Again, don't use -nostdinc++.

>    #-nodefaultlibs
>    -L/cygdrive/c/cygwin/lib/mingw
>
Or this -L.

>    -Wl,--start-group
>    %foreach Link in $(LinkFiles)
>    $(LinksPath)\$(Link)
>    %end
>    -L/cygdrive/c/cygwin/lib/mingw
>
Again, don't use this -L.

>    -lwsock32

>    -lstdc++
>    -lgcc
>
Don't use either of these.  g++ will handle them for you.

>    -Wl,--end-group
>    -Wl,-L/cygdrive/c/cygwin/lib/mingw
>
Not this -L either.

What I/we really wanted to see is the EXACT command line as it appears on
the console, and the output g++ sends to the console.  NOT you clearcase
make stuff.

It is impossible to guess how clearcase, etc. gets from here to there.

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax:   314-551-8444

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

- Raw text -


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