[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: KDE2 helloworld.cpp



On Tue, 2002-10-01 at 14:54, Sean 'Shaleh' Perry wrote:
> On Monday 30 September 2002 18:26, John Batistic wrote:
> > >
> > > You do not state so let's start at the beginning.
> > >
> > > Do you have the -dev version of the kdelibs as well as qt installed? 
> > > Rather than depend on environment variables I usually define the path to
> > > my include files in a makefile.  Also Debian is a little different
> > > because we actually install qt so that /usr/include/qt exists so you
> > > should not really need any special variables set.
> >
> > Yes, I do have kdelibs-dev.
> >
> > If I fully define the header file path in helloworld.cpp the make fails
> > when it reaches other .h calls.
> >
> > Can you give me an example of how you define the environment variables
> > in your makefile to suit the Debian locations?
> >
> 
> CXXFLAGS=-g -O2 -Wall -W -pedantic
> INCLUDES=-I/home/shaleh/blackbox/current/blackbox-cvs/lib -I/usr/X11R6/include
> LIBS=-L/home/shaleh/blackbox/current/blackbox-cvs/lib -L/usr/X11R6/lib 
> -lblackb\
> ox -lX11
> CXX=g++-3.2
> 
> all:
>         $(CXX) $(CXXFLAGS) $(INCLUDES) wmtest.cc -o wmtest $(LIBS)
> 
> is a makefile I use for a project I am working on currently.  it is not qt 
> based but the ideas are the same.  Also qt requires moc to be run, this may 
> also be part of the problem.
> 
Herewith:
[1]my cutdown compile only makefile
[2]my source code
[3]make's output

What am I missing?

****************************************************************
[1]
INCLUDES= -I/usr/share/qt/include -I/etc/kde2/include
CFLAGS= -pipe -02 -fno-strength-reduce
LFLAGS= -L/usr/share/qt/lib/ -L/usr/lib/kde2/lib -L/usr/X11R6/lib
LIBS= -lqt -lX11 -ltext
CC=g++

helloworld: helloworld.o
	$(CC) $(LFLAGS) -o helloworld helloworld.o $(LIBS)
	
****************************************************************
[2]
/* helloworld.cpp */
#include <qapplication.h>
#include <qlabel.h>
#include <qstring.h>

int main(int argc, char**argv)
{
	QApplication app(argc,argv);
	QLabel *label = new QLabel (NULL);
	QString string ("Hello, world");
	label -> setText(string);
	label -> setAlignment(Qt::AlignVCenter | Qt::AlignHCentre);
	label -> setGeometry(0,0,180,75);
	label -> show();
	app.setMainWidget(label);
	return(app.exec());
}

********************************************************************
[3]
jbat@xxxx:~/gcc/kde$ make
g++    -c -o helloworld.o helloworld.cpp
helloworld.cpp:2: qapplication.h: No such file or directory
helloworld.cpp:3: qlabel.h: No such file or directory
helloworld.cpp:4: qstring.h: No such file or directory
make: *** [helloworld.o] Error 1

*********************************************************************



Reply to: