LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 11-05-2005, 05:24 AM   #1
Raphexion
LQ Newbie
 
Registered: Nov 2005
Location: Sweden
Distribution: Suse 10.0
Posts: 8

Rep: Reputation: 0
Question Unable to include headers in Makefile


Hey everybody. Time for a newbie question =)

I keep bumbping in to an anoying problem all the time. When compiling I keep getting messages like
hello.cpp:2:19: qhbox,h: No such file or directory

Even though I have the file.

Now last I am trying to compile a QT program.
#include <qapplication.h>
#include <qhbox,h>
#include <qslider.h>
#include <qspinbox.h>


int main (int argc, char *argv[]) {

QApplication app (argc, argv);

QHBox *hbox = new QHBox (0);
hbox->setCaption ("Enter your age");
hbox->setMargin (6);
hbox->setSpacing (6);

QSpinBox *spinBox = new QSpinBox (hbox);
QSlider *slider = new QSlider (Qt::Horizontal, hbox);
spinBox->setRange (0,130);
slider->setRange(0,130);

QObject::connect(spinBox, SIGNAL(valueChanged(int)),
slider, SLOT(setValue(int)));
QObject::connect(slider, SIGNAL(valueChanged(int)),
spinBox, SLOT(setValue(int)));

spinBox->setValue(35);

app.setMainWidget(hbox);
hbox->show();

return app.exec();
}

With the following Makefile
#############################################################################
# Makefile for building: hello
# Generated by qmake (1.07a) (Qt 3.3.4) on: Fri Nov 4 08:24:46 2005
# Project: hello.pro
# Template: app
# Command: $(QMAKE) -o Makefile hello.pro
#############################################################################

####### Compiler, tools and options

CC = gcc
CXX = g++
LEX = flex
YACC = yacc
CFLAGS = -pipe -Wall -W -O2 -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT
CXXFLAGS = -pipe -Wall -W -O2 -DQT_NO_DEBUG -DQT_SHARED -DQT_THREAD_SUPPORT
LEXFLAGS =
YACCFLAGS= -d
INCPATH = -I/usr/share/qt3/mkspecs/default -I. -I/usr/include/qt3 -I/usr/share/qt3/include
LINK = g++
LFLAGS =
LIBS = $(SUBLIBS) -L/usr/share/qt3/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm
AR = ar cqs
RANLIB =
MOC = /usr/share/qt3/bin/moc
UIC = /usr/share/qt3/bin/uic
QMAKE = qmake
TAR = tar -cf
GZIP = gzip -9f
COPY = cp -f
COPY_FILE= $(COPY)
COPY_DIR = $(COPY) -r
INSTALL_FILE= $(COPY_FILE)
INSTALL_DIR = $(COPY_DIR)
DEL_FILE = rm -f
SYMLINK = ln -sf
DEL_DIR = rmdir
MOVE = mv -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p

####### Output directory

OBJECTS_DIR = ./

####### Files

HEADERS =
SOURCES = hello.cpp
OBJECTS = hello.o
FORMS =
UICDECLS =
UICIMPLS =
SRCMOC =
OBJMOC =
DIST = hello.pro
QMAKE_TARGET = hello
DESTDIR =
TARGET = hello

first: all
####### Implicit rules

.SUFFIXES: .c .o .cpp .cc .cxx .C

.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.cc.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.cxx.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.C.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

.c.o:
$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<

####### Build rules

all: Makefile $(TARGET)

$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(OBJCOMP) $(LIBS)

mocables: $(SRCMOC)
uicables: $(UICDECLS) $(UICIMPLS)

$(MOC):
( cd $(QTDIR)/src/moc && $(MAKE) )

Makefile: hello.pro /usr/share/qt3/mkspecs/default/qmake.conf /usr/share/qt3/lib/libqt-mt.prl
$(QMAKE) -o Makefile hello.pro
qmake:
@$(QMAKE) -o Makefile hello.pro

dist:
@mkdir -p .tmp/hello && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) .tmp/hello/ && ( cd `dirname .tmp/hello` && $(TAR) hello.tar hello && $(GZIP) hello.tar ) && $(MOVE) `dirname .tmp/hello`/hello.tar.gz . && $(DEL_FILE) -r .tmp/hello

mocclean:

uiclean:

yaccclean:
lexclean:
clean:
-$(DEL_FILE) $(OBJECTS)
-$(DEL_FILE) *~ core *.core


####### Sub-libraries

distclean: clean
-$(DEL_FILE) $(TARGET) $(TARGET)


FORCE:

####### Compile

hello.o: hello.cpp

####### Install

install:

uninstall:


my qhbox,h file is at:
njohanss@sandiego:/usr/share/qt3/include$ ls qhbox.h
qhbox.h

Basiclly I have no clue how the Makefile works, I just tried to 'include' stuff here and there...

// Raphexion
 
Old 11-05-2005, 08:35 AM   #2
jaristr
Member
 
Registered: Aug 2005
Distribution: Debian and slackware based
Posts: 119

Rep: Reputation: 15
Aha I see your problem:
hello.cpp:2:19: qhbox,h: No such file or directory

notice the "," in "qhbox,h"
it should be dot, like you know
 
Old 11-05-2005, 09:00 AM   #3
Raphexion
LQ Newbie
 
Registered: Nov 2005
Location: Sweden
Distribution: Suse 10.0
Posts: 8

Original Poster
Rep: Reputation: 0
OH MY GOD! NEWBIE MISTAKE =)

Thanks for finding that - I've been sitting with that, for I don't know how long.
// Raphexion
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Glibc Unable to Find Kernel Headers Kenji Miyamoto Linux From Scratch 6 12-30-2008 05:03 PM
kdevelop unable to recognize headers wasaabi4784 Programming 2 08-16-2005 07:12 PM
How to modify makefile.in or makefile.am QiangWan Linux - Newbie 1 05-17-2005 12:07 PM
how to get (makefile -f makefile )output into the textview widget in Pygtk sailu_mvn Programming 3 02-28-2005 04:57 AM
generate Makefile from Makefile.in without calling ./configure ? chris78 Programming 2 05-02-2004 01:23 PM


All times are GMT -5. The time now is 11:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration