Article View: es.comp.os.linux.programacion
Article #11829Compilar C++
From: Nacho Garc�a
Date: Fri, 28 Sep 2001 15:16
Date: Fri, 28 Sep 2001 15:16
60 lines
3477 bytes
3477 bytes
Hola,
Me gustar�a saber como se compila un programa sencillo C++ en linux. Tengo
la versi�n Suse 6.0
Lo he intentado con:
gcc Ej1.C Ej.C -v -I/usr/include/g++-2.7/
Poniendo la opci�n -I por que sino me dice que no encuentra el iostream.h,
que es el �nico include que he puesto.
Compilando con -v para ver los commandos ejecutados en tiempo de compilaci�n
el resultado es:
Reading specs from /usr/lib/gcc-lib/i486-linux/egcs-2.91.60/specs
gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)
/usr/lib/gcc-lib/i486-linux/egcs-2.91.60/cpp -lang-c++ -v -I/usr/include/g++
-2.7/ -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -D_
_ELF__ -Dunix -Di386 -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__
i386__ -D__linux__ -D__unix -D__i386 -D__linux -Asystem(posix) -D__EXCEPTION
S -Asystem(unix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di4
86 -D__i486 -D__i486__ Ej.C /tmp/ccFAQzQZ.ii
GNU CPP version egcs-2.91.60 19981201 (egcs-1.1.1 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/include/g++-2.7
/usr/local/include
/usr/i486-linux/include
/usr/lib/gcc-lib/i486-linux/egcs-2.91.60/include
/usr/include
End of search list.
cc1plus /tmp/ccFAQzQZ.ii -quiet -dumpbase Ej.cc -version -o /tmp/cc2QzwuS.s
GNU C++ version 2.7.2.3 (i386 Linux/ELF) compiled by GNU C version 2.7.2.3.
In file included from /usr/include/g++-2.7/iostream.h:31,
from Ej.C:1:
/usr/include/g++-2.7/streambuf.h:394: `__null' was not declared in this
scope
/usr/include/g++-2.7/streambuf.h: In method `int streambuf::have_backup()':
/usr/include/g++-2.7/streambuf.h:330: `__null' undeclared (first use this
function)
/usr/include/g++-2.7/streambuf.h:330: (Each undeclared identifier is
reported only once
/usr/include/g++-2.7/streambuf.h:330: for each function it appears in.)
/usr/include/g++-2.7/streambuf.h: In method `int streambuf::have_markers()':
/usr/include/g++-2.7/streambuf.h:331: `__null' undeclared (first use this
function)
/usr/include/g++-2.7/streambuf.h: In method `void streambuf::allocbuf()':
/usr/include/g++-2.7/streambuf.h:375: `__null' undeclared (first use this
function)
/usr/include/g++-2.7/iostream.h: At top level:
In file included from Ej.C:1:
/usr/include/g++-2.7/iostream.h:50: `__null' was not declared in this scope
/usr/include/g++-2.7/iostream.h:121: `__null' was not declared in this scope
/usr/include/g++-2.7/iostream.h:225: `__null' was not declared in this scope
Ej.C: In function `int main()':
Ej.C:7: parse error before string constant
Muchas gracias
Nacho
Technical Details
Message-ID:
<3bb49933@news.airtel.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!npeer.kpnqwest.net!news.airtel.netShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f86c8,666170cb722fbe13,start X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2001-09-28 08:37:36 PST From: "Nacho Garc�a" <ngarciab@airtel.net> Newsgroups: es.comp.os.linux.programacion Subject: Compilar C++ Date: Fri, 28 Sep 2001 17:16:56 +0200 Lines: 63 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2479.0006 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2479.0006 NNTP-Posting-Host: 212.73.55.98 X-Original-NNTP-Posting-Host: 212.73.55.98 Message-ID: <3bb49933@news.airtel.net> X-Trace: news.airtel.net 1001691443 212.73.55.98 (28 Sep 2001 17:37:23 +0200) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!npeer.kpnqwest.net!news.airtel.net