# Compiling Qt tutorial 1 through Makefile



## afflictedd2 (Oct 28, 2008)

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 (Oct 29, 2008)

```
g++ -I[b]/opt/Qt-4.4.3/include[/b] -o tut1 tut1.o -L[b]/opt/Qt-4.4.3/lib[/b] -lQtGui
```
Do these directories and files actually exist on your system?


----------



## afflictedd2 (Oct 29, 2008)

hmmm libQtGui.a doesn't exist.. but theres's a QtGui.la


----------

