Re: ccc
Falk Hueffner wrote:
Adam C Powell IV <hazelsct@mit.edu> writes:
One warning though: since gcc became gcc-3.2, I haven't been able to
build a working cxx. It must be trying to call gcc, which is 3.2,
but cxx's name mangling is incompatible with 3.2 so there are always
missing symbols (like cout).
Hmm, works for me[tm] on sid with cxx cxx-6.5.9.31. My comp.config
looks like this:
-Wl,--demangle=compaq -tk -h/usr/bin -B -tl -h/usr/bin -B -ts -h/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/bin -B_rh70 -D__DECCXX_LIBCXX_RH70 -D__linux_dist_debian -SD/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/include/cxx -SD/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/include -SD/usr/local/include -SD/usr/lib/gcc-lib/alpha-linux/3.2.2/include -SD/usr/include | -SysIncCxxDir /usr/lib/compaq/cxx-6.5.9.31/alpha-linux/include/cxx -SysIncDir /usr/lib/compaq/cxx-6.5.9.31/alpha-linux/include -SysIncDir /usr/local/include -SysIncDir /usr/lib/gcc-lib/alpha-linux/3.2.2/include -SysIncDir /usr/include -L/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/lib -L/usr/lib/gcc-lib/alpha-linux/3.2.2 -std strict_ansi
(Hmm, 3.2.2 should really be 3.2.3. Still works :)
Aha, I had an identical file minus the -std strict_ansi. But with
those, it gives me compiler errors:
zither:/# cxx /tmp/bye.C -o /tmp/bye
cxx: Error: /tmp/bye.C, line 4: identifier "cout" is undefined
cout << "Hello world" << endl;
--^
cxx: Error: /tmp/bye.C, line 4: identifier "endl" is undefined
cout << "Hello world" << endl;
---------------------------^
cxx: Info: 2 errors detected in the compilation of "/tmp/bye.C".
zither:/# more /tmp/bye.C
#include <iostream>
int main()
{
cout << "Hello world" << endl;
return 0;
}
Funny, because at the top of cxx's iostream.hxx it says something about
can't define -D__STD_STRICT_ANSI and use iostream, but that error
doesn't show up. Without -std strict_ansi, it gave:
# cxx -v /tmp/bye.C -o /tmp/bye
comp.config contains: -Wl,--demangle=compaq -tk -h/usr/bin -B -tl
-h/usr/bin -B -ts -h/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/bin -B_rh70
-D__DECCXX_LIBCXX_RH70 -D__linux_dist_debian
-SD/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/include/cxx
-SD/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/include
-SD/usr/local/include -SD/usr/lib/gcc-lib/alpha-linux/3.2.3/include
-SD/usr/include | -SysIncCxxDir
/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/include/cxx -SysIncDir
/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/include -SysIncDir
/usr/local/include -SysIncDir /usr/lib/gcc-lib/alpha-linux/3.2.3/include
-SysIncDir /usr/include -L/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/lib
-L/usr/lib/gcc-lib/alpha-linux/3.2.3
/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/bin/lnxexx -D__LANGUAGE_C__
-D__unix__ -D__alpha -D_SYSTYPE_BSD -D_LONGLONG -D__arch64__
-D__LANGUAGE_C -D__ELF__ -D__alpha__ -D__linux -D__linux__ -D__unix
-D__signed__=signed -D__const__=const -D__volatile__=volatile -g0 -O2
-preempt_module -model ansi -D__DECCXX_LIBCXX_RH70 -D__linux_dist_debian
-SD/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/include/cxx
-SD/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/include
-SD/usr/local/include -SD/usr/lib/gcc-lib/alpha-linux/3.2.3/include
-SD/usr/include -v
-I/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/include/cxx
-I/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/include/cxx_cname
-I/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/include/cxx
-I/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/include -I/usr/local/include
-I/usr/lib/gcc-lib/alpha-linux/3.2.3/include -I/usr/include -o bye.o
/tmp/bye.C
These macros are in effect at the start of the compilation.
----- ------ --- -- ------ -- --- ----- -- --- ------------
-D__linux_dist_debian -D__DECCXX_LIBCXX_RH70 -D__volatile__=volatile
-D__const__=const -D__signed__=signed -D__linux -D__ELF__ -D__LANGUAGE_C
-D__LANGUAGE_C__ -Dunix -D__linux__ -D_SYSTYPE_BSD -D__unix__ -D__unix
-D__INITIAL_POINTER_SIZE=0 -D__arch64__ -D__IEEE_FLOAT -D__Alpha_AXP
-D_LONGLONG -D__alpha__ -D__alpha -D__ALPHA -D__DECCXX_VER=60590031
-D__MODEL_ANSI -D__STD_ANSI -D__STDC__ -D__IMPLICIT_INCLUDE_ENABLED
-D__STDNEW
-D__X_FLOAT=0 -D__PRAGMA_ENVIRONMENT -D__DECCXX -D__EDG_VERSION__=245
-D__EDG__ -D__IMPLICIT_USING_STD -D__RTTI -D__EXCEPTIONS
-D__GLOBAL_ARRAY_NEW
-D__BOOL_IS_A_RESERVED_WORD -D_BOOL_EXISTS -D__WCHAR_T -D_WCHAR_T
-D__cplusplus=199711L -D__TIME__="02:08:29" -D__DATE__="Mar 23 2003"
/usr/bin/ld -o /tmp/bye --demangle=compaq
-L/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/lib
-L/usr/lib/gcc-lib/alpha-linux/3.2.3 -O1 -m elf64alpha -G 8 -rpath
/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/bin/
-L/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/bin/ -dynamic-linker
/lib/ld-linux.so.2 /usr/lib/compaq/cxx-6.5.9.31/alpha-linux/bin/crt1.o
/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/bin/crti.o
/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/bin/crtbegin.o
/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/bin/_mainma.o bye.o
-lcxxstdma_rh70 -lcxxma_rh70 -lc -lots
/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/bin/crtend.o
/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/bin/crtn.o --no-demangle
--warn-once
/usr/bin/ld -o /tmp/bye --demangle=compaq
-L/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/lib
-L/usr/lib/gcc-lib/alpha-linux/3.2.3 -O1 -m elf64alpha -G 8 -rpath
/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/bin/
-L/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/bin/ -dynamic-linker
/lib/ld-linux.so.2 /usr/lib/compaq/cxx-6.5.9.31/alpha-linux/bin/crt1.o
/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/bin/crti.o
/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/bin/crtbegin.o
/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/bin/_mainma.o bye.o
-lcxxstdma_rh70 -lcxxma_rh70 -lc -lots
/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/bin/crtend.o
/usr/lib/compaq/cxx-6.5.9.31/alpha-linux/bin/crtn.o
bye.o(.text+0x10): In function `main':
: undefined reference to `__7__ls__7ostreamFPCc'
bye.o(.text+0x20): In function `main':
: undefined reference to `__7__ls__7ostreamFPCc'
bye.o(.text+0x20): In function `main':
: undefined reference to `__7__ls__7ostreamFPCc'
bye.o(.text+0x14): In function `main':
: undefined reference to `cout'
bye.o(.text+0x30): In function `main':
: undefined reference to `__7endl__FR7ostream'
I'm confused -- how did you get this to work? I'm really not a C++
person, but would love to provide a working cxx to those who need it.
Thanks,
--
-Adam P.
GPG fingerprint: D54D 1AEE B11C CE9B A02B C5DD 526F 01E8 564E E4B6
Welcome to the best software in the world today cafe!
<http://lyre.mit.edu/%7Epowell/The_Best_Stuff_In_The_World_Today_Cafe.ogg>
Reply to:
- Follow-Ups:
- Re: ccc
- From: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
- References:
- ccc
- From: Joakim Roubert <jokke@df.lth.se>
- Re: ccc
- From: Adam C Powell IV <hazelsct@mit.edu>
- Re: ccc
- From: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>