l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
September 2: Social gathering
Next Installfest:
TBD
Latest News:
Aug. 18: Discounts to "Velocity" in NY; come to tonight's "Photography" talk
Page last updated:
2002 Apr 08 10:45

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] kde/qt programming question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] kde/qt programming question



The problem is by creating a symlink, you only "fixed" finding the 
headers for your program. It does nothing to help the compiler to 
find the headers that other headers might include because they still 
just include <blah.h>, not <qt/blah.h>. This is why you get those 
errors after doing the symlink. What you need to do is remove the 
symlink, put your program back in its original form and pass the 
proper include directory to g++ when invoking the compiler. Try something 
like:

g++ -I/usr/lib/qt2/include -o 1 1.cpp

Look at "man gcc" and "man g++" to learn how to use the compiler 
and give it the proper command line args for a given situation.

Shwaine the Wandering Arch of Malevolence
--------------------------------------------------------------
http://www.malevolence.com              http://www.shwaine.com
telnet://shwaine.dyn.greystoneapts.com:3000


On 7 Apr 2002 Patrick Stockton <codejnki@codejnki.com> wrote:
> 
> I'm starting to read a few tutorials on kde/qt programming
> 
> One of the first programs they have you do has the following source:
> 
> #include <qapplication.h>
> #include <qpushbutton.h>
> 
> int main( int argc, char **argv )
> {
> QApplication a( argc, argv );
> 
> QPushButton hello( "Hello world!" );
> hello.resize( 100, 30 );
> 
> a.setMainWidget( &hello );
> hello.show();
> return a.exec();
> }
> 
> When I first tried to compile it using "g++ 1.cpp -o 1" it gave 
me errors:
> 1.cpp:1:30: qapplication.h: No such file or directory
> 1.cpp:2:29: qpushbutton.h: No such file or directory
> 
> That said to me that it couldn't find the right libraries.
> So from inside my /usr/include directory I did a:
> ln -s /usr/lib/qt2/include qt2
> 
> and then modified the two include lines to read:
> #include <qt2/qapplication.h>
> #include <qt2/qpushbutton.h>
> 
> Well now I am getting:
> 
> In file included from /usr/include/qt2/qobjectdefs.h:42,
>                  from /usr/include/qt2/qwindowdefs.h:43,
>                  from /usr/include/qt2/qwidget.h:42,
>                  from /usr/include/qt2/qapplication.h:42,
>                  from 1.cpp:1:
> /usr/include/qt2/qglobal.h:448:23: qfeatures.h: No such file or 
directory
> 
> Now qglobal.h and qfeatures.h are both inside the /usr/include/qt2 
directory
> so I know it's not a problem of the files not being there.  How 
or what
> should I edit path/shell variable wise to get the compiler to look 
in all the
> right spots to find all the right header files.






_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.