This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc and iostream - final issue

On Fri, 31 Oct 2003 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 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:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]