Article View: es.comp.os.linux.programacion
Article #11787[c++] problemas compilando un encabezado
From: jlan
Date: Fri, 05 Oct 2001 12:54
Date: Fri, 05 Oct 2001 12:54
68 lines
3243 bytes
3243 bytes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bueno posteare por aqu� que estoy como mas en casa que en los grupos de c y c++. Pues estoy compilando una biblioteca de funciones,y entre ellas esta este encabezado: //archivo de encabezado 5.11.h #ifndef __LST05-11_H #define __LST05-11_H int fib (int n); #endif y como me seguia dando problemas he tratado de compilarlo por su lado con g++ -c lst05-11.cpp. Y me dice : In file included from lst05-11.cpp:2: lst05-11.h:2: warning: garbage at end of `#ifndef' argument lst05-11.h:3: warning: missing white space after `#define __LST05' No entiendo muy bien el problema, pero por lo menos compila el modulo. Existen lst05-11.cpp , lst05-12.cpp , lst05-11.h y lst05-11.o (el modulo). Tras lo cual compilo e, principal : g++ lst05-12.cpp lst05-11.o -o lst05-12 y dice: In file included from lst05-12.cpp:2: lst05-11.h:2: warning: garbage at end of `#ifndef' argument lst05-11.h:3: warning: missing white space after `#define __LST05' /tmp/ccG7Y0AA.o: In function `main': /tmp/ccG7Y0AA.o(.text+0x4c): undefined reference to `fib(int)' lst05-11.o: In function `fitb(int)': lst05-11.o(.text+0xde): undefined reference to `fib(int)' lst05-11.o(.text+0xf0): undefined reference to `fib(int)' collect2: ld returned 1 exit status El problema de antes del tal.h , que como es un warning igual no es demasiado importante, y el problema en la funcion principal que tmapoco entiendo bien. Si alguien ha leido hasta aqu� ;-) , le dir� que es un libro de ejemplos de c++ y que estoy aprendiendo , pero estoy bastante verde aun. ~ludos. - -- ___________________________________________________________________ Jose Luis Alcazar <NeumaNN> GNU/linux Debian Linux registered user: #172297 Registered Machine : #76125 <jlalcazar@iespana.es> PGP KeyId: 0x044E638B Fingerprint = 34DA 5038 2DCC A55C C143 7382 4C68 847D 044E 638B ___________________________________________________________________ BOFH excuse #103: operators on strike due to broken coffee machine -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE7va2RTGiEfQROY4sRAjr4AJ4/f7hVfee3dKeT4oaQKIW3JGyOqACgl1fQ dpfb0tncS8BX9d7/bVUtDB4= =sacT -----END PGP SIGNATURE-----
Technical Details
Message-ID:
<slrn9rrbcd.lf5.j_l_a_n@blade.dune>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!213-99-157-16.uc.nombres.ttd.ES!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f86c8,83de9f97201d08bc,start X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2001-10-05 09:15:12 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!213-99-157-16.uc.nombres.ttd.ES!not-for-mail From: j_l_a_n@terra.es (jlan) Newsgroups: es.comp.os.linux.programacion Subject: [c++] problemas compilando un encabezado Date: Fri, 5 Oct 2001 14:54:43 +0200 Lines: 68 Message-ID: <slrn9rrbcd.lf5.j_l_a_n@blade.dune> Reply-To: jlalcazar@iespana.es NNTP-Posting-Host: 213-99-157-16.uc.nombres.ttd.es (213.99.157.16) Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: fu-berlin.de 1002298509 19552890 213.99.157.16 (16 [67517]) X-Orig-Path: j_l_a_n User-Agent: slrn/0.9.6.2 (Linux)