Article View: es.comp.os.linux.programacion
Article #12018Re: Compilar aplicaciones QT
From: xsidius
Date: Mon, 10 Sep 2001 12:26
Date: Mon, 10 Sep 2001 12:26
52 lines
2283 bytes
2283 bytes
zx128k wrote:
> #include <kapp.h>
> #include <qpushbutton.h>
>
> int main( int argc, char **argv )
> {
> KApplication a( argc, argv );
>
> QPushButton hello( "Hello world!" );
> hello.resize( 100, 30 );
>
> a.setTopWidget( &hello );
>
> connect(&hello, SIGNAL( clicked() ), &a, SLOT( quit() ));
>
> hello.show();
> return a.exec();
> }
>
>
> Este es un programa de ejemplo que baje de una faq de la pagina de KDE,
> es un programa tontisimo, pero no se con que librerias enlzarlo para
> compilarlo.
>
>
> Ya no lo recuerdo.
>
> ivan@darkstar:~/borra$ gcc 1.c -o u
> 1.c:1: qapplication.h: No such file or directory
> 1.c:2: qpushbutton.h: No such file or directory
>
>
>
> Lo hice a si y no es correcto, con que libreria lo enlazo?.
>
>
> Salu2.
>
>
g++ -I/usr/include/qt -lqt archivo.cc -p salida
analizo:
g++ -> ya que es codigo en c++ no en c
-I/usr/include/qt -> tengo que especificar el directorio de los include
-lqt -> los linko con la libreria de las qt
a parte si utilizas singnals and slots deberas preprocesar el codigo con el
moc.
Saludos...
Technical Details
Message-ID:
<3b9cb17f$1@filemon.telecable.es>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!212.74.64.35!colt.net!newspeer.clara.net!news.clara.net!btnet-peer!btnet!newsfeed.bt.es!news.bt.es!filemon.telecable.esReferences:
<9ngbt6$f9e$1@diana.bcn.ttd.net>Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII-7-bit X-Google-Thread: f86c8,4f0da3789aaec2a8 X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2001-09-10 05:27:05 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!212.74.64.35!colt.net!newspeer.clara.net!news.clara.net!btnet-peer!btnet!newsfeed.bt.es!news.bt.es!filemon.telecable.es From: xsidius <dahernan@telecable.es> Newsgroups: es.comp.os.linux.programacion Subject: Re: Compilar aplicaciones QT Date: Mon, 10 Sep 2001 14:26:45 +0200 Organization: BT Tel. Netnews service (readers) Lines: 54 Message-ID: <3b9cb17f$1@filemon.telecable.es> References: <9ngbt6$f9e$1@diana.bcn.ttd.net> NNTP-Posting-Host: filemon.telecable.es Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: titan.bt.es 1000124600 11779 212.89.0.4 (10 Sep 2001 12:23:20 GMT) X-Complaints-To: abuse@bt.es NNTP-Posting-Date: 10 Sep 2001 12:23:20 GMT User-Agent: KNode/0.4 X-Original-NNTP-Posting-Host: cm08250.telecable.es X-Original-Trace: 10 Sep 2001 14:26:39 +0100, cm08250.telecable.es