PDA

View Full Version : Compiling Qt tutorial 1 through Makefile


afflictedd2
October 28th, 2008, 08:00 PM
Hi Everyone,

Hi guys,

I've been trying to build the first tutorial for Qt in a Mac computer, but I want the application to build with regular gcc, so that it is a native unix application. This is the makefile I'm using.


CXX = g++
TARGET = tut1
OBJECTS = tut1.o
CXXFLAGS = -I/opt/Qt-4.4.3/includeLDFLAGS = -L/opt/Qt-4.4.3/lib -lQtGui
.PHONY : all
all: $(TARGET)
$(TARGET) : $(OBJECTS)
$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)


This is the error I get when I try to make:

steel:tut1 Naix$ make
g++ -I/opt/Qt-4.4.3/include -c -o tut1.o tut1.cpp
g++ -I/opt/Qt-4.4.3/include -o tut1 tut1.o -L/opt/Qt-4.4.3/lib -lQtGui
ld: library not found for -lQtGui
collect2: ld returned 1 exit status
make: *** [tut1] Error 1

Any help Appreciated,

Ed

ElDiabloConCaca
October 29th, 2008, 11:59 AM
g++ -I/opt/Qt-4.4.3/include -o tut1 tut1.o -L/opt/Qt-4.4.3/lib -lQtGui
Do these directories and files actually exist on your system?

afflictedd2
October 29th, 2008, 12:05 PM
hmmm libQtGui.a doesn't exist.. but theres's a QtGui.la