This is the mail archive of the cygwin@cygwin.com 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: g++ link errors


WFM.

Your compile displays "gcc version 3.2.3" but
cygcheck output says you have 3.3.* installed.

May I suggest that you try to uninstall+reinstall the gcc packages?
Though: I'm not sure this will help you.

--
$ cat >nolink.c

#include <iostream>

using namespace std;

int
main(int, char**)
{
   cout << "hello.";
}

$ g++ -Wall -v nolink.cc
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/specs
Configured with:
/GCC/gcc-3.3.1-3/configure --with-gcc --with-gnu-ld --with-gnu-as --prefix=/
usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr
/sbin --mandir=/usr/share/man --infodir=/usr/share/info --enable-languages=c
,ada,c++,f77,pascal,java,objc --enable-libgcj --enable-threads=posix --with-
system-zlib --enable-nls --without-included-gettext --enable-interpreter --e
nable-sjlj-exceptions --disable-version-specific-runtime-libs --enable-share
d --disable-win32-registry --enable-java-gc=boehm --disable-hash-synchroniza
tion --verbose --target=i686-pc-cygwin --host=i686-pc-cygwin --build=i686-pc
-cygwin
Thread model: posix
gcc version 3.3.1 (cygming special)

/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/cc1plus.exe -quiet -v -D__GNUC__=3 -D_
_GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=1 -D__CYGWIN32__ -D__CYGWIN__ -Dunix -
D__unix__ -D__unix -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../include/w32api -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cygwin/lib/../../i
nclude/w32api nolink.cc -D__GNUG__=3 -quiet -dumpbase nolink.cc -auxbase
nolink -Wall -version -o /cygdrive/d/TEMP/ccdwC2g8.s
GNU C++ version 3.3.1 (cygming special) (i686-pc-cygwin)
        compiled by GNU C version 3.3.1 (cygming special).
GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=32710
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.1
 /usr/include/c++/3.3.1/i686-pc-cygwin
 /usr/include/c++/3.3.1/backward
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/include
 /usr/include
 /usr/include/w32api
End of search list.

/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cygwin/bin/as.exe 
--traditional-format -o /cygdrive/d/TEMP/ccCbCnHa.o
/cygdrive/d/TEMP/ccdwC2g8.s

/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/collect2.exe -Bdynamic --dll-search-pr
efix=cyg /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../crt0.o
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/crtbegin.o -L/usr/lib/gcc-lib/i686-pc-
cygwin/3.3.1 -L/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../..
/cygdrive/d/TEMP/ccCbCnHa.o -lstdc++ -lgcc -lcygwin -luser32 -lkernel32 -lad
vapi32 -lshell32 -lgcc /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/crtend.o
Hannu@P450 ~/tests bash (P)PID=(152)2356, s=0
$ a
hello.Hannu@P450 ~/tests bash (P)PID=(152)2356, s=0
$


/Hannu E K Nevalainen, B.Sc. EE - 59+16.37'N, 17+12.60'E

** on a mailing list; please keep replies on that particular list **
-- printf("LocalTime: UTC+%02d\n",(DST)? 2:1); --




> From: Dean Scarff
> Sent: Sunday, December 07, 2003 7:34 AM

> Hi,
> I'm getting link errors with libstdc++.  At first I thought I must have
> been missing a package, but AFAICS I have all the relevant ones.  I
> assumed libstdc++ would be linked in by default from a g++ command line.
>   I couldn't see anything similar mentioned in the archives.  I assume
> c++ wouldn't be broken by default for the whole distribution like this,
> what have I forgotten (and out of interest, why does the 3.3.1 version
> of gcc and g++ use the 3.2.3 specs)?
>
> scarff-box ~ $ cat nolink.cc
>
> #include <iostream>
>
> using namespace std;
>
> int
> main(int, char**)
> {
>    cout << "hello.";
> }
>
> scarff-box ~ $ g++ -Wall -v nolink.cc
> Reading specs from /usr/local/lib/gcc-lib/i686-pc-cygwin/3.2.3/specs
> Configured with: ./configure --enable-languages=objective-c
> --with-system-zlib --without-included-gettext --host=i686-pc-cygwin
> --target=i686-pc-cygwin --prefix=/usr/local/ --exec-prefix=/usr/local :
> (reconfigured) ./configure --target=i686-pc-cygwin --prefix=/usr/local
> --with-as=/usr/bin/as.exe --with-ld=/usr/bin/ld.exe
> --enable-threads=win32 -enable-languages=c,c++,objc
> Thread model: win32
> gcc version 3.2.3
>   /usr/local/lib/gcc-lib/i686-pc-cygwin/3.2.3/cc1plus.exe -v
> -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=3
> -D__GXX_ABI_VERSION=102 -D_X86_=1 -D_X86_=1 -Asystem=winnt
> -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386
> -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__
> -D__stdcall=__attribute__((__stdcall__))
> -D__cdecl=__attribute__((__cdecl__))
> -D_stdcall=__attribute__((__stdcall__))
> -D_cdecl=__attribute__((__cdecl__)) -D__declspec(x)=__attribute__((x))
> -D__i386__ -D__i386 -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__
> -D__unix -isystem /usr/local/include -idirafter
> /usr/local/i686-pc-cygwin/include -idirafter /usr/include -idirafter
> /usr/local/i686-pc-cygwin/include/w32api -idirafter /usr/include/w32api
> nolink.cc -D__GNUG__=3 -D__DEPRECATED -D__EXCEPTIONS -quiet -dumpbase
> nolink.cc -Wall -version -o
> /mnt/data/Profiles/scarff/LOCALS~1/Temp/ccSJf53h.s
> ignoring nonexistent directory "/usr/local/i686-pc-cygwin/include"
> ignoring nonexistent directory "/usr/local/i686-pc-cygwin/include/w32api"
> GNU CPP version 3.2.3 (cpplib) (80386, BSD syntax)
> GNU C++ version 3.2.3 (i686-pc-cygwin)
>          compiled by GNU C version 3.2 20020927 (prerelease).
> #include "..." search starts here:
> #include <...> search starts here:
>   /usr/local/include
>   /usr/local/include/c++/3.2.3
>   /usr/local/include/c++/3.2.3/i686-pc-cygwin
>   /usr/local/include/c++/3.2.3/backward
>   /usr/local/lib/gcc-lib/i686-pc-cygwin/3.2.3/include
>   /usr/include
>   /usr/include/w32api
> End of search list.

<SNIP>

> gcc                  3.3.1-3            OK
> gcc-g++              3.3.1-3            OK
> gcc-mingw            20030911-4         OK
> gcc-mingw-core       20031020-1         OK
> gcc-mingw-g++        20031020-1         OK
> gdbm                 1.8.3-7            OK

<SNIP>

--END OF MESSAGE--


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


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